Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration offramp examples for nextjs #3190

Open
2 tasks done
MaykonMorais opened this issue Nov 6, 2024 · 5 comments
Open
2 tasks done

Migration offramp examples for nextjs #3190

MaykonMorais opened this issue Nov 6, 2024 · 5 comments
Assignees

Comments

@MaykonMorais
Copy link

Clear and concise description of the problem

With the change of next-mf status to maintenance, we noticed that it might be necessary to create examples for teams already considering migrating to other frameworks. I imagine that teams will make this transition gradually, so it would be helpful to consider a way for Next.js to interoperate with other frameworks, facilitating this change.

The examples could be organized by some recommended frameworks. Here are a few ideas:

  • Next.js (host) with Rsbuild/Rspack (remote)
  • Next.js (host) with ModernJS (remote)
  • Next.js (host) with Remix (remote)
    ...
    Feel free to add more recommendations.

I believe these examples will be very helpful for those already thinking about migrating and will be of great value to the community.

Suggested solution

  • Build a few of examples with different frameworks mentioned above that interop with Nextjs and post on MF Examples repo
  • Build a section with migration guide on Docs.

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@ScriptedAlchemy ScriptedAlchemy self-assigned this Nov 9, 2024
@ScriptedAlchemy
Copy link
Member

ScriptedAlchemy commented Nov 9, 2024

I think we will have to reverse the strategy.

Next.js (remote) with Rsbuild/Rspack (host)
Next.js (remote) with ModernJS (host)
Next.js (remote) with Remix (host)

Youd take your current host, make it a remote, and use a new host who actually works well to pull the legacy next app back into it.

Next hosts are almost impossible to accept non next remotes.

We would have to create share replacements/shims for link,router, etc - nextjs is a locked system and will only work with its own stuff.

Any shim we create to try and reverse the order, Vercel will most likely try and break.
We would need to disable Vercels ability to use make changes in effort to eat up our bandwidth with games of cat and mouse, the best way to lock them out of manipulating next.js deliberately to break federation offramps is to remove them as host and put a non-adversarial host in place.

Next.js is largely weaponized against federation, we have to assume its owner is hostile and act accordingly.

@MaykonMorais
Copy link
Author

MaykonMorais commented Nov 10, 2024

I agree, this approach makes a lot of sense! Reversing the role of Next.js to act as a remote while using a host with better federation compatibility is a smart strategy, especially given the constraints of the Next ecosystem.

@ScriptedAlchemy
Copy link
Member

Totally, ill work on something soon

@zackarychapple
Copy link
Collaborator

There are also some Tanstack examples in the works, with Tanstack Start coming along its a very interesting alternative as well.

@ScriptedAlchemy
Copy link
Member

@zackarychapple do they work with SSR yet?
I know vite base does not currently support ssr AFIK, are they rspack / webpack based?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants