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

Declared package side effects free #385

Merged
merged 1 commit into from
Dec 31, 2019
Merged

Conversation

maclockard
Copy link
Contributor

@maclockard maclockard commented Nov 21, 2019

This sets the package.json field sideEffects to false. This allows for better tree shaking by downstream consumers, see https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free for more information.

I skimmed over all included files and I did not see anything that would count following webpack's definition of tree shaking during a production build.

There is one side effect, but I believe its only used in development builds, so it would be okay to tree shake:

For more details on how this field works and why it matter see the discussions here:

This sets the package.json field sideEffects to false. This allows for better tree shaking by downstream consumers, see https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free for more information.

I skimmed over all included files and I did not see anything that would count following webpack's definition of tree shaking during a production build.

There is one side effect, but I believe its only used in development builds, so it would be okay to tree shake:
https://github.com/bvaughn/react-window/blob/master/src/createListComponent.js#L127-L136

For more details on how this field works and why it matter see the discussion here: react-dnd/react-dnd#1577
@bvaughn bvaughn merged commit ffc99e5 into bvaughn:master Dec 31, 2019
@bvaughn
Copy link
Owner

bvaughn commented Dec 31, 2019

Seems legit. Thanks.

@maclockard
Copy link
Contributor Author

@bvaughn thanks for merging! would it be possible to cut a release so this is available in prod?

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

Successfully merging this pull request may close these issues.

2 participants