-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Webpack - extract separate vendors chunk for better caching #13235
Webpack - extract separate vendors chunk for better caching #13235
Conversation
@aimane-chnaif @bondydaa One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
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.
I don't see any reason to block this, I def agree trying to reduce file sizes and the number of times we try to force users to download them. We'll have to look into disabling the default cloudflare cache as well but that doesn't seem too hard.
Let me confirm and fill reviewer checklist |
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 to me. Tests passed.
Reviewer Checklist
Screenshots/VideosDesktopdesktop.mov |
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.
Re-running checklist
@roryabraham did you want to take a look here or good with me merging? |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by @chiragsalian in version: 1.2.38-6 🚀
|
// After App update end users would download just the main source and resolve the rest from cache | ||
// When dependencies do change cache is invalidated and users download everything - same as before | ||
vendor: { | ||
test: /[\\/]node_modules[\\/]/, |
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 is really awesome because the build is so much faster now, but one downside I found it was a pain for developing locally with react-native-onyx
and that I have to clear the webpack cache anytime I wanted to test a new change. What about adding an exclusion just for react-native-onyx
?
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.
I don't think the part of the config here (vendor chunk) would make a difference about that
Does it work if we revert this vendors chunk change?
If it does we can keep it for prod but remove it from the dev config
But I think the problem is from file system cache config - webpack assumes node modules does not change while running and just uses cached values. Perhaps there's a way to tell it certain modules might change
Details
Extract 3rd party dependencies (~75% of App) to separate js file for more efficient caching
3rd party deps don't change as often as main source
After App update (web) end users would download just the main source and resolve the rest from cache
When dependencies do change cache is invalidated and users download everything - same as before
Fixed Issues
$ #12235
PROPOSAL: N/A
Tests
npm run web
npm run desktop
npm run build-staging
npx serve -s dist
npm run build
npx serve -s dist
npm run desktop-build-staging
./desktop-build
foldernpm run desktop-build
./desktop-build
folderOffline tests
N/A - same offline behavior as before
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android