-
Notifications
You must be signed in to change notification settings - Fork 14
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
chore!: reduce bundle size #346
Conversation
b9fb625
to
dcc8043
Compare
dcc8043
to
f7938ab
Compare
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.
@matthieuh I think we can also get rid of the |
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.
15d9fac
to
00d9ee4
Compare
🎉 This PR is included in version 4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Done in this PR:
=> usage of
@rollup/plugin-babel
to use@babel/plugin-transform-react-pure-annotations
(cf. Implementplugin-transform-react-pure-annotations
and add topreset-react
babel/babel#11428). Without this usage ofReact.forwardRef
orReact.memo
is breaking tree-shaking.=> avoid 1 file bundle and build the lib in separate files (
preserveModules: true
)Dependency changes
Breaking changes
How to test?
Next.js
project addconfig.resolve.alias.react = path.resolve(__dirname, 'node_modules/react')
in the custom webpack config. Use some components from Faency both in_app.ts
and in some nextjs page (and be sure there are some you are not using).Faency
repo runnpm run build
Faency
repo runyarn link
Next.js
repo runyarn link @traefiklabs/faency
Next.js
repo runyarn build
.next
folder and see if faency components that you are not using are not present.@next/bundle-analyzer
can be a good way to analyze it.Good PR checkboxes
Good Review checkboxes
ℹ️ Copy the snippet and paste in the review field to fill it