Comments (8)
I need to write a plugin for next js. Next uses a single runtime chunk which moves all the Federation code into the main runtime. In reality I need a special runtime created that’s not bound to the normal webpack runtime
from module-federation-examples.
Thanks.. May be I will wait for the plugin then.
from module-federation-examples.
You can make a shim for next.js. It’s what I use in production
from module-federation-examples.
@ScriptedAlchemy Do you have any documentation / resources on how to do this?
from module-federation-examples.
https://gist.github.com/ScriptedAlchemy/d386a094832dbd9a04324862d26570e9
window.abtests needs to be replaced with window.[remote]
from module-federation-examples.
@ScriptedAlchemy Would you happen to have an example of federating pages between two separate next applications? I could see this being very useful where you would have a main shell application with some kind of discovery service that is able to locate different remotes and include their pages. Similar to the way zones work with next js, but truly a single-page experience.
I have a discovery service working for components / routes outside of the next js framework.
from module-federation-examples.
all examples are proprietary and in-house to solve legacy WP4 and next js. Nothing demoed in repos mostly because I don’t use WP4 anymore lol. you pretty much paste the gist into a js file and add it as a new entrypoint then change the importAll context around based on what you want to expose to other remotes. You will need to load more than one file tho. 1 the runtime chunk next makes, 2 the remote entry containing the shim along with it dynamic importing all the pages via require.context, ugly but works
from module-federation-examples.
Closing these as its a separate series of problems that will arise. There is a next.js example available now
from module-federation-examples.
Related Issues (20)
- nextjs-v13 routing does not work HOT 1
- nextjs-v13 getServerSideProps not working HOT 10
- Using external-remotes-plugin with @module-federation/nextjs-mf HOT 1
- Uncaught SyntaxError: Unexpected token function when use module federation v1.5 HOT 3
- Code Nextjs-v14 throws error when try to run HOT 5
- [Feature request/discussion] Allow having multiple instances of shared dependencies HOT 3
- Hot Module Reloading is solved! HOT 1
- [Question] Shared modules are duplicate in multi-bundle files of MF v8.2.2 above HOT 11
- Can I Remove remote.js?[hash] for cache remote.js HOT 2
- NPM package unavailable - nextjs-shared-v14 HOT 1
- [Bug][Nextjs13] Uncaught TypeError: Cannot read properties of undefined (reading 'consumes') HOT 2
- Examples issue HOT 3
- vue-cli master分支跑不起来 HOT 1
- [Question] URL parameters? HOT 6
- externals @module-federation/webpack-bundler-runtime no work HOT 1
- Dynamic-remotes shared config not work HOT 2
- Does V2 currently support Vite? HOT 1
- Microfe
- nextjs mf does not generate remoteEntry.js HOT 6
- Add ability to reduce requests waterfall for host-ui HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from module-federation-examples.