[No QA] fix(rsbuild): lazy-import Sentry plugin to silence webpack deprecation warnings - #96021
Conversation
Avoid loading @sentry/webpack-plugin during local web dev so Bun does not trigger webpack 5.108 deprecation warnings from the plugin's namespace import of webpack. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@tylerkaraszewski Please 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] |
|
🚧 chuckdries has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/chuckdries in version: 9.4.34-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
@sentry/webpack-pluginwas statically imported inrsbuild.common.ts, so it loaded during localnpm run webeven though the Sentry plugin is only used for production/staging builds. Under Bun, that plugin'simport * as webpack from "webpack"touches webpack 5.108's deprecated compat exports and prints fourDEP_WEBPACK_*warnings on every dev server start. These are harmless but noisyThis change dynamically imports
@sentry/webpack-pluginonly for non-development builds and makesgetCommonConfigurationasync so the import stays ESM.Fixed Issues
$
Tests
npm run webfrom the App repo root.DEP_WEBPACK_JAVASCRIPT_MODULES_PLUGIN,DEP_WEBPACK_LIBRARY_TEMPLATE_PLUGIN,DEP_WEBPACK_SINGLE_ENTRY_PLUGIN, orDEP_WEBPACK_OPTIONS_DEFAULTERwarnings.https://dev.new.expensify.com:8082/.Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A
Android: mWeb Chrome
N/A
iOS: Native
N/A
iOS: mWeb Safari
N/A
MacOS: Chrome / Safari
N/A