-
Notifications
You must be signed in to change notification settings - Fork 1.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
[PM-18503] Webpack caching, minimize only on prod for Web #13508
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13508 +/- ##
==========================================
- Coverage 35.60% 35.60% -0.01%
==========================================
Files 3140 3141 +1
Lines 93042 93079 +37
Branches 16918 16925 +7
==========================================
+ Hits 33132 33142 +10
- Misses 57371 57400 +29
+ Partials 2539 2537 -2 ☔ View full report in Codecov by Sentry. |
Great job, no security vulnerabilities found in this Pull Request |
You're not seeing an effect in CI because it's not persisted between runs. Caching to filesystem in webpack is potentially dangerous, see https://github.com/webpack/changelog-v5/blob/master/guides/persistent-caching.md#opt-in. Some things I've observed with the existing memory cache is linked packages such as the SDK not being updated without restarting the devserver. This might now propagate into needing the user to manually delete the cache. TLDR: Be careful as this might break assumptions people have around how builds works, and advanced workflows like |
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.
Initial clean build took ~90 seconds on my M2 Mac. Subsequent cached builds took ~30 seconds.
Thanks for the very welcome speed-up!
@Hinton i was afraid something might mess up with GH Actions, so i have not added this cache to any workflows, too risky. I will check how this behaves with:
|
I have adjusted the webpack caching configuration to pick up changes in:
I have tested above scenarios, including re-compiling sdk-internal with changes and it seems to be working now! |
|
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-18503
📔 Objective
Speeds up Web build for development.
Script:
build:bit:dev:watch
/usr/bin/time -l npm run build:bit:watch
Conclusion: Any subsequent (cached) run is up to 45 seconds (65%) faster and requires up to 1.5GB less memory.
Did not observe any difference in our GH Actions pipeline.
📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes