fix: lazy bundle HMR set correct entryName#2134
Conversation
🦋 Changeset detectedLatest commit: 8b25961 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughAdds a DEV_ONLY_SetSnapshotEntryName snapshot operation and apply logic to patch lazy-bundle entry names for HMR, introduces a lazy-loaded example component with CSS, and adds test coverage and a changeset documenting the fix. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging this PR will degrade performance by 11.06%Comparing Summary
Performance Changes
Footnotes
|
Web Explorer#7346 Bundle Size — 384.14KiB (0%).8b25961(current) vs 0efda9d main#7342(baseline) Bundle metrics
|
| Current #7346 |
Baseline #7342 |
|
|---|---|---|
154.12KiB |
154.12KiB |
|
35.05KiB |
35.05KiB |
|
0% |
0% |
|
8 |
8 |
|
8 |
8 |
|
238 |
238 |
|
16 |
16 |
|
2.99% |
2.99% |
|
4 |
4 |
|
0 |
0 |
Bundle size by type no changes
| Current #7346 |
Baseline #7342 |
|
|---|---|---|
252.07KiB |
252.07KiB |
|
97.02KiB |
97.02KiB |
|
35.05KiB |
35.05KiB |
Bundle analysis report Branch feat/DEV_ONLY_SetSnapshotEntryNa... Project dashboard
Generated by RelativeCI Documentation Report issue
6901479 to
8b25961
Compare
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @lynx-js/react@0.116.1 ### Patch Changes - Fix the issue that lazy bundle HMR will lost CSS. ([#2134](#2134)) ## @lynx-js/rspeedy@0.13.2 ### Patch Changes - Bump Rsbuild 1.7.2 with Rspack 1.7.1. ([#2136](#2136)) ## @lynx-js/lynx-bundle-rslib-config@0.2.1 ### Patch Changes - Add [`globalObject`](https://webpack.js.org/configuration/output/#outputglobalobject) config for external bundle loading, user can configure it to `globalThis` for BTS external bundle sharing. ([#2123](#2123)) ## @lynx-js/external-bundle-rsbuild-plugin@0.0.2 ### Patch Changes - Add [`globalObject`](https://webpack.js.org/configuration/output/#outputglobalobject) config for external bundle loading, user can configure it to `globalThis` for BTS external bundle sharing. ([#2123](#2123)) - Updated dependencies \[[`959360c`](959360c)]: - @lynx-js/externals-loading-webpack-plugin@0.0.3 ## @lynx-js/externals-loading-webpack-plugin@0.0.3 ### Patch Changes - Add [`globalObject`](https://webpack.js.org/configuration/output/#outputglobalobject) config for external bundle loading, user can configure it to `globalThis` for BTS external bundle sharing. ([#2123](#2123)) ## create-rspeedy@0.13.2 ## upgrade-rspeedy@0.13.2 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This fix follows #2048 but for non standalone lazy bundles. We now will pass the snapshotCreator function from BTS to MTS but miss the correct
globDynamicComponentEntryfield. It will fail to execute__SetCSSIdfor lazy bundle.Summary by CodeRabbit
New Features
Bug Fixes
Style
Tests
✏️ Tip: You can customize this high-level summary in your review settings.
Checklist