-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add side effects property to components package.json #18911
Conversation
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.
Looks good. I wasn't able to spot any side effects in the package, so this makes sense 👍
gutenberg/packages/components/package.json Lines 54 to 57 in 9eea50b
@talldan, in the past you marked two files, do you remember why? |
gutenberg/packages/components/src/keyboard-shortcuts/index.js Lines 4 to 5 in a8c0ca9
I think this is what is concerning in this package. I'm not saying we should change anything, but we should definitely seek a way to avoid those magic imports to make reasoning easier. |
I think setting Yes, these two packages import something that has side-effects, but these don't need to happen unless the consumer of It would be a problem only if some other component relied implicitly on |
Description
This PR adds
sideEffects: false
to@wordpress/components
in order to enable tree-shaking for that library, having tree shaking reduces build sizes by a significant amount.before
sideEffects
after
sideEffects