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

How much work is needed to allow rollup to be a remote? #11

Open
98mux opened this issue Oct 22, 2020 · 8 comments
Open

How much work is needed to allow rollup to be a remote? #11

98mux opened this issue Oct 22, 2020 · 8 comments
Assignees

Comments

@98mux
Copy link

98mux commented Oct 22, 2020

Having rollup be a remote is really useful for my project. I would love to see it be realized. I could potentially sponsor this project.

Btw, amazing work so far with module federation!

@jacob-ebey

@98mux
Copy link
Author

98mux commented Oct 22, 2020

Going to consider switching to webpack first

@98mux 98mux closed this as completed Oct 22, 2020
@jacob-ebey
Copy link
Contributor

@filipot I would consider Webpack. I do not have the time or drive to re-visit this at the moment. I'm keeping this open to potentially re-visit in the future.

@jacob-ebey jacob-ebey reopened this Oct 22, 2020
@jacob-ebey jacob-ebey self-assigned this Oct 22, 2020
@LukasHirt
Copy link

LukasHirt commented Jan 26, 2021

@jacob-ebey Is this something you'd be open to a contribution? This would be super helpful in our use case. We're using rollup in our plugin system. Enabling plugins to become remotes instead of switching to webpack would be great then! I'd be happy to try to invest some effort in contributing to this.

@jacob-ebey
Copy link
Contributor

@LukasHirt Always open for contributions, no one's stopping you ;)

@98mux
Copy link
Author

98mux commented Jan 27, 2021

@LukasHirt You may also consider using snowpack, i think that is the direction where im heading. FredKSchott/snowpack#1098

@emilio-martinez
Copy link

@jacob-ebey is there a design doc somewhere that specs module federation and how different bundlers need to interop?

I'm interested in this, and may even contribute, but webpack MF features seem to rely on _webpack* variables, whereas this projects seems to use federation. Is it that the two simply diverged?

@jacob-ebey
Copy link
Contributor

@emlio-martinez message me on twitter @ebey_jacob and we can setup a call to talk about things. I don't know of any official design docs, but you can mainly think of __webpack variables as it's module resolution stuff as it doesn't use esm imports. The main api is the get and init where sharing context is provided.

@ScottAwesome
Copy link

This effective thing with module federation is that its a webpack specific problem really, from what I can tell. All its doing is calling a custom wrapped runtime on a remote. You can do this with es modules today as far as I can tell, having looked at the code on both sides of the coin here. This is what dynamic import handles.

Unless there is something critical I misunderstand about module federation (this could be the case, I'm not going to lie, the documentation around this is not great), there's no magic here. Its the equivalent of just dynamically importing your application at runtime as needed. Adding a global "module cache" would allow you to do this in a way where you can import the module after bootstrap and it "mount" it when needed.

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

5 participants