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

Rewriting ExportNamedDeclaration is causing an issue with recursive imports of shared dependencies #16

Open
MadaraUchiha-314 opened this issue Nov 2, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@MadaraUchiha-314
Copy link
Owner

  • In the example project, react-dom has a dependency on react. Since react is shared, we need to rewrite the import to a __federatedImport__ expression.
const { __moduleExports } = await __federatedImport__('./__federated__shared__react.js');

Since v1.2.0 this is what is currently being generated.

This is mostly due to the intermediate files that are created by the commonjs plugin which rewrites the content of react package and rewrites the import of react in react-dom.

@MadaraUchiha-314 MadaraUchiha-314 added the bug Something isn't working label Nov 2, 2023
github-actions bot pushed a commit that referenced this issue Nov 2, 2023
## [1.2.2](v1.2.1...v1.2.2) (2023-11-02)

### Bug Fixes

* not parsing export-named-declarations until the bug [#16](#16) is fixed ([#17](#17)) ([f1d7b23](f1d7b23))
@MadaraUchiha-314
Copy link
Owner Author

This is a key blocker for supporting nested dependencies from being federated. For eg. if the dependency tree looks something like this:

<root>
  - react
  - random_package (which only has CJS or UMD output)
    - react

Because the commonjs plugin transforms the actual module to something else which contains the exports statement, the rollup federation plugin is not able to parse it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant