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

Add the Webpack 4 'sideEffects' flag #3870

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

jsnajdr
Copy link
Contributor

@jsnajdr jsnajdr commented Feb 25, 2018

This adds the Webpack v4 sideEffects optimization. See a similar PR for Lodash: lodash/lodash#3533

What does it do? If I import just one export from the library:

import { reducer } from 'redux-form'

then sideEffects: false ensures that only the reducer code and the code it depends on will be imported, and not all the reexports in es/index.js.

If the sideEffects flag were not set to false, Webpack must assume that the reexported modules can have side-effects (e.g., setting a property on window) and imports them all.

Very useful for code splitting where the main chunk typically imports only the reducer and the other chunks import UI components, selectors etc.

@codecov-io
Copy link

codecov-io commented Feb 25, 2018

Codecov Report

Merging #3870 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3870   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          70      70           
  Lines        1601    1601           
======================================
  Hits         1601    1601

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25ab6d9...1bc19e5. Read the comment docs.

@erikras erikras merged commit f80d0b0 into redux-form:master Mar 2, 2018
@jsnajdr jsnajdr deleted the side-effects branch March 2, 2018 09:16
@erikras
Copy link
Member

erikras commented Mar 2, 2018

Published in v7.3.0.

@lock
Copy link

lock bot commented Jun 1, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants