Open mhevery opened 1 year ago
@shairez pointed me at this issue which I find very interesting as I was recently myself working on a proposal to incrementally migrate a big SPA to Qwik. While this issue is focused on NextJS, I was wondering how the migration patterns would like like in a more broader scope so posting this here in case it helps.
Some scenarios:
The last proposal (proxying through Qwik) sounds more brittle and maybe more suited for a research phase, but it would IMO cover many more tech stacks than just adding NextJS support. Big companies tend also to have front servers like Nginx or Cloudflare where the selective proxying can be done and the Qwik city express adapter would not be necessary. This approach is also less intrusive as it would avoid any changes to the production NextJS app and allows for A/B testing managed externally (ie: in some scenarios, easier to turn on and off the Qwik pages by changing the proxy configuration).
Once the infrastructure part is solved, the other issue that seemed instrumental to me was how to share the components as source code (ie: monorepo with npm workspaces and Turborepo containing the two applications as packages and a third package with the React components) so that pages from both applications would look identical by using the same React components and styles / design system (ie: React components styled with Tailwind). When I tried this approach a while ago, I faced some weird issues which I don't remember at the moment.
One idea too to make this even easier in the short term - just create a doc on basic migration strategies, like if you use Cloudflare how to do it with an edge worker, how to configure Cloudfront to point some URLs to a qwik city site (on a new host) vs your current one, how to do this with Vercel and Netlify, etc
cc @hamatoyogi as this was an idea of his
Hi @thejackshelton, are you working on this? :thinking:
Is your feature request related to a problem?
I would like to try using Qwik in my existing NextJS project in an incremental way.
Describe the solution you'd like
See this loom for more background:
File:
pages/test-page.tsx
File:
qwik-app/src/routes/test-page/index.tsx
Describe alternatives you've considered
n/a
Additional context
No response