-
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
Framework: Decrease build size by fixing import statements #3531
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3531 +/- ##
=========================================
+ Coverage 34.85% 35% +0.15%
=========================================
Files 261 261
Lines 6717 6733 +16
Branches 1225 1229 +4
=========================================
+ Hits 2341 2357 +16
Misses 3691 3691
Partials 685 685
Continue to review full report at Codecov.
|
Actually, those changes are straightforward and block my work. I will merge it without review. |
Good one. Should we lint against this? Looks like one of those things that's easy to slip by, even more so when refactoring. |
Awesome finding 👍 It is good that you merged it, so you could advance I also did a set of smoke tests, and some grepping to find other cases and no problem found / other cases appeared. |
I'm sure that it can be handled on the Webpack level. However, it would require some explorations how to avoid scanning sibling folders. I have a feeling that I saw once an article how to achieve it. Eslint might be more challenging to maintain if we ever add a new folder. I guess it wouldn't be hard to update but the trick is how to keep it in sync. |
@@ -7,7 +7,7 @@ import { connect } from 'react-redux'; | |||
* WordPress dependencies | |||
*/ | |||
import { getBlocks } from '../../selectors'; |
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.
This should probably move to "Internal dependencies"
@@ -1,4 +1,4 @@ | |||
import { viewPort } from '../utils'; |
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.
Missing WordPress dependencies comment :)
@youknowriad did you open PR? I can fix it in a bit since I started it :) |
No I did not :) |
Opened #3561 to address that. |
Description
This PR updates import statements that were using legacy format. It turned out this caused
blocks
chunk to be also bundled together witheditor
chunk doubling the size of the chunk.editor
chunk has decreased size from 1.02 MB to 551 kB for production build. This is before compression.It's worth mention that side-effects from
blocks
chunk were executed twice including all block registrations!Before
After
How Has This Been Tested?
Manually.
Checklist: