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

Circular dependency warnings #218

Open
daleyjem opened this issue Oct 14, 2020 · 7 comments
Open

Circular dependency warnings #218

daleyjem opened this issue Oct 14, 2020 · 7 comments

Comments

@daleyjem
Copy link

Getting some Webpack circular dependency warnings after a version upgrade from v2 to v4.

WARNING in Circular dependency detected:
node_modules/react-universal-component/dist/helpers.js -> node_modules/react-universal-component/dist/index.js -> node_modules/react-universal-component/dist/helpers.js

WARNING in Circular dependency detected:
node_modules/react-universal-component/dist/index.js -> node_modules/react-universal-component/dist/helpers.js -> node_modules/react-universal-component/dist/index.js

WARNING in Circular dependency detected:
node_modules/react-universal-component/dist/requireById/index.js -> node_modules/react-universal-component/dist/utils.js -> node_modules/react-universal-component/dist/requireById/index.js

WARNING in Circular dependency detected:
node_modules/react-universal-component/dist/utils.js -> node_modules/react-universal-component/dist/requireById/index.js -> node_modules/react-universal-component/dist/utils.js

Any plans for resolving these?

@ScriptedAlchemy
Copy link
Collaborator

No current plans. I'm likely going to work with loadable component on any code splitting stuff. I'll put up a message about looking for maintainers for universal. With Module Federation, I no longer need HOCs and only need some of the chunk flushing mechanism. The rest I can bake into the webpack runtime directly.

I believe the whole code split product line - from loadable, universal, react loadable are now unnecessary.

I'll likely put out a lib or update loadables chunk extractor.

The universal component is effectively dead on webpack 5. I can hold. There might be a small wrapper I create for react but it likely won't be universal. If it is, it's a total rebuild - since it still works- I'd prefer to leave it alone and build out federated application capabilities

@daleyjem
Copy link
Author

I kind of understand. Right now we have one package utilizing this one for the default client-side export, and maybe 1 or 2 of server.js named exports.. and then all other modules import from that.. so rework could be minimal. Any quick thoughts are on what a best transition plan might look like?

@ScriptedAlchemy
Copy link
Collaborator

They work almost exactly the same. I think you can just find replace it everywhere and then just re-hook up the chunkExtractor in your SSR. If you google module-federation-examples/server-side-rendering you'll find my MF repo and i use loadable in there, it was a retrofit of my old icarus project based on universal. So its literally a OSS port to loadable.

@cdoublev
Copy link
Contributor

cdoublev commented Nov 1, 2020

Hi @ScriptedAlchemy, can you please elaborate on this?

The universal component is effectively dead on webpack 5.

If this is true, you can mark this package as deprecated, isn't it? Otherwise updating this package requires updating React peer dep to ^16.3.0 || ^17.0.0", react-test-renderer dev dep to ^17.0.0, and merging #216. Fixing this circular dependency issue is also straightforward. I would be happy to push a PR but versions/tags of this repository is a real mess, sorry.

@ScriptedAlchemy
Copy link
Collaborator

Won't deprecate till I have the chunk mechanics done. That said I no longer have time for this. If people want to PR, I'll merge things.

Will put a notice on When I have time

@cdoublev
Copy link
Contributor

cdoublev commented Nov 1, 2020

Can't reproduce the issue with webpack v4.43.2 or v5.3.2, though I had this issue in a fork of this repository bundled with Rollup.

@ithinkdancan
Copy link
Contributor

@ScriptedAlchemy do you have any good resources you could point to on how to do ssr code splitting on webpack 5. Would you still rely on federation even for a single repo?

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

4 participants