sugo-85
(Sugo 85)
November 14, 2024, 8:01am
1
I need microfront-end remote app to create remoteEntry.js but we are facing issues and we found one link and got information like module federation is ending next.js support. Please find the link below.
opened 12:30AM - 01 Nov 24 UTC
# Deprecation Notice for `nextjs-mf`
We intend to **deprecate (`EOL`) `nextj… s-mf`**, maintained by the core authors of Module Federation.
- **Pages Router** will remain "supported," and small, easy fixes will still be back-ported.
- **No new or active development** will take place from the core team.
- **Community pull requests** will continue to be merged.
- **Vercel** should be considered the primary point of contact for anything regarding module federation & next.js. I will provide some support and examples for migrating *away* from next.
---
**If you are exploring microfrontends, _do not_ use Next.js! ~~It is a hostile framework and Vercel is an adversary of federation~~**
---
## Regarding "RSC Federation" Tweeted by Vercel
I currently have no concrete information regarding this, however my previous statements about it looking like it was just an update to next zones was incorrect.
This is the most recent information: "We did do some upgrades to zones and, independently, RSC Federation and module federation are on our minds (though we don't have anything actionable yet). Two different solutions, two different problem spaces."
*If any of this information is inaccurate or new information emerges, I will amend this section.*
## User Options
Your best options are to **contact Vercel** or **abandon Next.js**.
- Since the Pages Router still works, **Next.js 15** is probably safe.
- **Next.js 16** is TBD; if it only requires a minor fix (as with Next.js 15), I will provide a patch.
- You can use the `module-federation/runtime` package directly without a compiler plugin, but code sharing will be limited since `shared` performs build-time chunking. This means remotes must use the same versions of dependencies as hosts, and Next.js builds cannot generate remote entry files—essentially, it can only act as a host system.
We highly recommend **moving to a framework that works well with microfrontends**:
- **Modern.js** works best and will introduce RSC + Federation support in 2025, providing a solid alternative. It powers all of ByteDance and is maintained by their infrastructure team, ensuring excellent support.
- **Remix** is also a good option.
- **TanStack** looks promising as well.
If anyone wishes to become the **primary maintainer** of `nextjs-mf`, you are more than welcome.
## Timeline Until Total Deprecation
Barring any unforeseen circumstances, expect `nextjs-mf` to remain as functional as it is today until **mid to end of 2026**. This gives you approximately **two years** to make a plan.
**Note:** If Next.js 16 breaks Pages Router support beyond an easy fix, version 16 will not be supported.
### What This Means:
- Updates to our runtime packages will still ensure existing unit tests for `nextjs-mf` pass.
- Around the end of 2026, `nextjs-mf` unit tests will be removed from continuous integration.
- We will no longer track its functionality.
- If Vercel introduces significant changes that break it before the 2026 EOL, it will be retired ahead of time—assuming it's not a simple adjustment to fix.
- Most git issues on this repo related to next.js will be closed, file issues with Vercel.
## Reasoning
Many framework authors actively collaborate and want to support Module Federation. **Next.js is not one of them to date**. While there seem to be internal discussions at Vercel, ~~we have seen no indication or received any contact regarding this. Given the track record, doubt anything will materialize~~
`nextjs-mf` has involved years of "fighting the framework," and without support from the framework authors, it has been a very slow decline. Considering the substantial time and effort required to keep it somewhat functional, it is simply not worthwhile.
Supporting Next.js has come at the cost of improving the greater ecosystem. Since we stopped focusing on the project at the start of 2024, the Module Federation ecosystem has drastically expanded. This is largely due to reallocating the bandwidth that previously went into `nextjs-mf`.
*As an example, creating Module Federation v2 took about 3 months, supporting modernjs took a few weeks. Next regularly requires months of work*
`nextjs-mf` was initially started in 2021. Early on, there was alignment between Vercel and the Federation group. We enthusiastically submitted a pull request to Next.js to upgrade it to Webpack 5 and advance mutual goals of implementing Module Federation in Next.js. Ultimately, it did not pan out as Turborepo was acquired and a different approach was taken, Next in general has optimized toward bigger and faster monoliths.
I have largely been obligated to maintain this project single-handedly due to the user base being large tech companies—you cannot simply abandon a project when challenges arise. Best efforts have been made over the years to keep the project going. While I have not personally used `nextjs-mf` in about two years, it has seen two major releases.
I believe I have gone above and beyond for the users of `nextjs-mf`. While it is indeed disappointing to retire the project, **it is time**.
*its been real, its been good. But it hasn't been real good* 👋
Update:
Contact with vercel was made, it appears that they have been experimenting with federation v2.
While nothing is actionable at this time - it is encouraging to see consideration of first-class support.
If support does materialize, we will be happy to adjust this ecosystem to support Vercel's requirements.
Could you please provide an alternative solution how we can use my application as micro-frontend. Also we are using app router (nextjs)
Gouranga
pawlean
(Pauline P. Narvas)
November 14, 2024, 4:59pm
2
Hi, @sugo-85 ! Welcome to the Vercel Community
I don’t know the full answer to the module federation ending Next.js support, I can check in with the Next.js team for any insights but we have actually implemented microfrontends in our own architecture. We’ve documented our approach in a blog post that might be helpful for your situation.
The blog post discusses how we transitioned from a single large Next.js application to a microfrontend architecture, resulting in improved build times and developer experience. This approach might be a good alternative to consider for your project.
Let us know how you get on!
system
(system)
Closed
December 14, 2024, 4:59pm
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.