Hello,
I’m currently in the process of rewriting parts of a Phoenix application. The frontend is primarily a React single-page app, but we’re transitioning to LiveView. To ensure a smooth rollout, I’d like to migrate specific pages from React to LiveView for a small subset of users first.
At the moment, we’re using a URL prefix approach — for example, /live/entity/123
instead of /entity/123
. However, many of our links (e.g., from emails or external systems) point to the original /entity/123
routes, and updating all those references isn’t feasible.
Ideally, I’d like to implement a mechanism in the router that conditionally serves either the LiveView or the React SPA based on a value in the session or assigns (e.g., a feature flag or user group).
Is this kind of conditional routing possible in the Phoenix router? I couldn’t find a clear way to do it. Alternatively, are there other recommended approaches to handle this kind of progressive migration?
Thanks in advance!