Coder Social home page Coder Social logo

Comments (5)

ScriptedAlchemy avatar ScriptedAlchemy commented on July 23, 2024 2

Bump, not stale

from repack.

jbroma avatar jbroma commented on July 23, 2024

hey @ScriptedAlchemy,

you are talking about MF 1.5 correct? I'm all up for it, love the idea. Perhaps runtime plugins would actually help us solve the issue where host app can't define remotes (I think it was related to converting some part of initialisation logic to promise so RN wasn't initialising correctly). I wasn't involved in Re.Pack development at the time where MF was introduced so my knowledge is limited on why things are as they are. In the future, we're also looking forward to migrating to rspack and I know MF 1.5 is already implemented there as a plugin, but I haven't explored it much as of yet, since it's all very fresh.

Could you point me to some resources on what features MF 1.5 offers?

from repack.

ScriptedAlchemy avatar ScriptedAlchemy commented on July 23, 2024

yeah so for RN this is what i was thinking which may help the chunk manager thing.

module-federation/core#2013

Then for defining remotes etc, we can do things like this:
https://github.com/module-federation/module-federation-examples/blob/master/runtime-plugins/remote-control/app1/pick-remote.ts

Resources:
https://github.com/module-federation/universe/tree/main/packages/runtime
https://github.com/module-federation/universe/tree/main/packages/enhanced

We are also finalizing a new api for adding remotes on the fly:
module-federation/core#2171

Heres a post i wrote about it:
https://medium.com/@scriptedalchemy/emodule-federation-gets-upgraded-and-rspack-supports-it-5ddb0d1e9546

Basically youd just swap over to module-federation/enhacend, then any runtime plugins you want to make you can just add as array like i do in examples.

If you want pure at runtime you can do that too with the module-federation/runtime

If you use enhanced, then all it does is init the runtime package under the hood and pass options.
https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes/app1/src/App.js

If its something youd want to adopt, im down to help. I dont know a ton of RN but the main thing i had in mind where i could be helpful is with a runtime plugin for chunk handlers that RN needs.

Like node plugin, you make a custom chunk handler plugin. However i discovered i can do same with runtime plugin and since runtime plugins and federation runtime are embedded into the runtime chunks, they boot before any app code does, it boots along with webpacks runtime etc.

We also just rolled out data manifest plugin and preload hooks so if chunkManager needs that upfront in totality, we have a hook in runtime for preloadAssets etc. (was just merged)

from repack.

github-actions avatar github-actions commented on July 23, 2024

This issue has been marked as stale because it has been inactive for 30 days. Please update this issue or it will be automatically closed in 14 days.

from repack.

github-actions avatar github-actions commented on July 23, 2024

This issue has been marked as stale because it has been inactive for 30 days. Please update this issue or it will be automatically closed in 14 days.

from repack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.