Framework: Decrease build size by fixing import statements#3531
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.
This should probably move to "Internal dependencies"
| @@ -1,4 +1,4 @@ | |||
| import { viewPort } from '../utils'; | |||
There was a problem hiding this comment.
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
blockschunk to be also bundled together witheditorchunk doubling the size of the chunk.editorchunk 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
blockschunk were executed twice including all block registrations!Before
After
How Has This Been Tested?
Manually.
Checklist: