fix(webpack/react): lazy bundle does not return#380
Merged
colinaaa merged 2 commits intolynx-family:mainfrom Mar 28, 2025
Merged
fix(webpack/react): lazy bundle does not return#380colinaaa merged 2 commits intolynx-family:mainfrom
colinaaa merged 2 commits intolynx-family:mainfrom
Conversation
🦋 Changeset detectedLatest commit: eab7efc The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging #380 will not alter performanceComparing Summary
|
Yradex
approved these changes
Mar 28, 2025
colinaaa
pushed a commit
that referenced
this pull request
Mar 31, 2025
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/web-constants@0.10.0 ### Minor Changes - feat: rewrite the main thread Element PAPIs ([#343](#343)) In this commit we've rewritten the main thread apis. The most highlighted change is that - Before this commit we send events directly to bts - After this change, we send events to mts then send them to bts with some data combined. ### Patch Changes - feat: The onNapiModulesCall function of lynx-view provides the fourth parameter: `lynxView`, which is the actual lynx-view DOM. ([#350](#350)) - fix: publicComponentEvent args order ([#401](#401)) - Updated dependencies \[[`a521759`](a521759)]: - @lynx-js/web-worker-rpc@0.10.0 ## @lynx-js/web-core@0.10.0 ### Minor Changes - feat: rewrite the main thread Element PAPIs ([#343](#343)) In this commit we've rewritten the main thread apis. The most highlighted change is that - Before this commit we send events directly to bts - After this change, we send events to mts then send them to bts with some data combined. ### Patch Changes - refactor: timing system ([#378](#378)) Now we moved the timing system to the background thread. - feat: support `defaultOverflowVisible` config ([#406](#406)) - fix(web): rsbuild will bundle 2 exactly same chunk for two same `new Worker` stmt ([#372](#372)) the bundle size will be optimized about 28.2KB - fix: inline style will be removed for value number `0` ([#368](#368)) the inline style value could be incorrectly removed for number value `0`; For example, `flex-shrink:0` may be ignored. - feat: The onNapiModulesCall function of lynx-view provides the fourth parameter: `lynxView`, which is the actual lynx-view DOM. ([#350](#350)) - fix: publicComponentEvent args order ([#401](#401)) - Updated dependencies \[[`3a8dabd`](3a8dabd), [`a521759`](a521759), [`890c6c5`](890c6c5)]: - @lynx-js/web-worker-runtime@0.10.0 - @lynx-js/web-constants@0.10.0 - @lynx-js/web-worker-rpc@0.10.0 ## @lynx-js/web-mainthread-apis@0.10.0 ### Minor Changes - feat: rewrite the main thread Element PAPIs ([#343](#343)) In this commit we've rewritten the main thread apis. The most highlighted change is that - Before this commit we send events directly to bts - After this change, we send events to mts then send them to bts with some data combined. ### Patch Changes - feat(web): use pure DOM API to implement Element PAPIs ([#334](#334)) 1. rewrite all element PAPIs impl. Now we use DOM. 2. use our new package `@lynx-js/offscreen-document` to support the new Element PAPI implementation in a worker - fix: inline style will be removed for value number `0` ([#368](#368)) the inline style value could be incorrectly removed for number value `0`; For example, `flex-shrink:0` may be ignored. - fix: publicComponentEvent args order ([#401](#401)) - Updated dependencies \[[`3a8dabd`](3a8dabd), [`a521759`](a521759), [`890c6c5`](890c6c5)]: - @lynx-js/web-constants@0.10.0 ## @lynx-js/web-worker-runtime@0.10.0 ### Minor Changes - feat: rewrite the main thread Element PAPIs ([#343](#343)) In this commit we've rewritten the main thread apis. The most highlighted change is that - Before this commit we send events directly to bts - After this change, we send events to mts then send them to bts with some data combined. ### Patch Changes - Updated dependencies \[[`2a8ddf3`](2a8ddf3), [`3a8dabd`](3a8dabd), [`878050a`](878050a), [`a521759`](a521759), [`890c6c5`](890c6c5)]: - @lynx-js/web-mainthread-apis@0.10.0 - @lynx-js/web-constants@0.10.0 - @lynx-js/web-worker-rpc@0.10.0 ## @lynx-js/react@0.106.2 ### Patch Changes - fix: prevent multiple firstScreen events when reloading before `jsReady` ([#377](#377)) - Optimize the bundle size by eliminating unnecessary code when the lazy bundle is not utilized. ([#284](#284)) ## @lynx-js/rspeedy@0.8.7 ### Patch Changes - Support using `-debugids` in `output.sourceMap.js`. ([#342](#342)) See [Source Map Debug ID Proposal](https://github.com/tc39/ecma426/blob/main/proposals/debug-id.md) for more details. - Use `chunkLoading: 'import-scripts'` for Web platform ([#352](#352)) - Support `output.distPath.*`. ([#366](#366)) See [Rsbuild - distPath](https://rsbuild.dev/config/output/dist-path) for all available options. - Support `performance.printFileSize` ([#336](#336)) Whether to print the file sizes after production build. ## @lynx-js/react-rsbuild-plugin@0.9.4 ### Patch Changes - feat: add extractStr option to pluginReactLynx ([#391](#391)) - Convert background-only files from js to ts ([#346](#346)) - Updated dependencies \[[`f849117`](f849117), [`d730101`](d730101), [`42217c2`](42217c2), [`f03bd4a`](f03bd4a)]: - @lynx-js/react-webpack-plugin@0.6.10 - @lynx-js/template-webpack-plugin@0.6.7 - @lynx-js/react-alias-rsbuild-plugin@0.9.4 - @lynx-js/react-refresh-webpack-plugin@0.3.2 - @lynx-js/css-extract-webpack-plugin@0.5.2 - @lynx-js/web-webpack-plugin@0.6.3 ## @lynx-js/web-elements@0.5.2 ### Patch Changes - fix: When list with list-type: flow, scrolltoupper, scrolltolower were specified, there was a blank block. ([#379](#379)) - fix: do not show scroll bar ([#406](#406)) ## @lynx-js/web-worker-rpc@0.10.0 ### Patch Changes - feat: The onNapiModulesCall function of lynx-view provides the fourth parameter: `lynxView`, which is the actual lynx-view DOM. ([#350](#350)) ## @lynx-js/react-webpack-plugin@0.6.10 ### Patch Changes - feat: add extractStr option to pluginReactLynx ([#391](#391)) - Fix issue with lazy loading of bundles when source maps are enabled. ([#380](#380)) - Fix issue where loading a lazy bundle fails if it does not return a webpack chunk. ([#365](#365)) ## @lynx-js/template-webpack-plugin@0.6.7 ### Patch Changes - fix: merge different chunk groups for same output filename ([#371](#371)) ## create-rspeedy@0.8.7 ## @lynx-js/react-alias-rsbuild-plugin@0.9.4 ## upgrade-rspeedy@0.8.7 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the source-map is enabled (excluding
hidden), themain-thread.jsfile in lazy-loaded bundles is incorrectly formatted.We didn't add a new line before
return exports, causing it to merge with the comment.lynx-stack/packages/webpack/react-webpack-plugin/src/ReactWebpackPlugin.ts
Lines 285 to 287 in 3ff8829
This would cause the lazy bundle returns nothing and cause the
Cannot read property 'update' of undefinederror.We now add an empty line before
return:Checklist