-
Notifications
You must be signed in to change notification settings - Fork 375
feat(infrastructure): Added ability import components directly to support fed modules tree-shaking of shared packages. #8832
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
Conversation
|
Preview: https://patternfly-react-pr-8832.surge.sh A11y report: https://patternfly-react-pr-8832-a11y.surge.sh |
02a2a82 to
787d36a
Compare
wise-king-sullyman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, didn't run into any of the issues I was running into previously.
|
@wise-king-sullyman Want to review this again. It now should generate the package.jsons for esm in the module directories at the root instead of the dist/esm directory. |
|
Not quite sure what you mean, and I tried to run it locally but it seems like something is causing errors when build:fed:packages runs now |
They are in /components, /deprecated, /helper, etc for esm. For common JS they are still in dist/cjs. |
wise-king-sullyman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments below, also as we discussed on slack I think the config files will need to be updated since the deprecated etc directories now just re-export components from dist.
…port fed modules tree-shacking of shared packages. feat(infrastructure): Added ability import components directly to support fed modules tree-shacking of shared packages.
2738815 to
eead8ce
Compare
wise-king-sullyman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me, though I'm still not positive on how to test that these new package files are actually having the impact that we want them to.
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
Generates package.json for each components to support federated modules.
Each component will have it's own name and package json file:
e.g. (@patternfly/react-core-tile, @patternfly/react-core-dropdown-next, @patternfy/react-core-dropdown-deprecated)
resolves issue #8357
Single component imports AKA federated mini module support for tree shaking has been added to the following:
TODO:
NOTE: Module federation webpack plugin will be created in the following repo https://github.com/patternfly/module-federation-tree-shaking-plugin