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

Do containers that are not deployed independently need to set eager to true for react and react-native dependencies? #462

Closed
JoonDong2 opened this issue Nov 6, 2023 · 4 comments

Comments

@JoonDong2
Copy link

JoonDong2 commented Nov 6, 2023

In the following document, it is mentioned to set eager of react and react-native dependencies to true.
https://re-pack.netlify.app/docs/module-federation/#react-and-react-native-must-be-eager-and-singleton

However, I think that if the host app shares react and react-native dependencies, the container app can retrieve the shared dependencies through the __webpack_require__.f.consumes function.

Is it really necessary to set the container's eager to true as described in the documentation?
Because of eager: true, the bundle file size becomes too large.

@jbroma
Copy link
Member

jbroma commented Nov 6, 2023

Hey @JoonDong2,

as far as I know, for proper initialization, setting react and react-native is required. I have not experimented in that area because it was a never a big issue to begin with. I'm unable to provide you with a more advanced take on the subject.

You're saying that bundle file size becomes too large, how large are we talking about here?. For our TesterApp, which isn't optimized at all for the main chunk filesize, it takes roughly 1,5 MB of diskspace.

@JoonDong2
Copy link
Author

JoonDong2 commented Nov 6, 2023

Hey @JoonDong2,

as far as I know, for proper initialization, setting react and react-native is required. I have not experimented in that area because it was a never a big issue to begin with. I'm unable to provide you with a more advanced take on the subject.

You're saying that bundle file size becomes too large, how large are we talking about here?. For our TesterApp, which isn't optimized at all for the main chunk filesize, it takes roughly 1,5 MB of diskspace.

Setting eager:false reduces the size in kb because react and react-native JavaScript code is excluded from the app.container.bundle file.
I think this is a significant difference when there's a need to load chunks at home.

Copy link

github-actions bot commented Dec 8, 2023

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.

@github-actions github-actions bot added the Stale label Dec 8, 2023
Copy link

This issue has been automatically closed because it has been inactive for more than 14 days. Please reopen if you want to add more context.

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

No branches or pull requests

2 participants