fix: change the generation conditions of the css.hot-update.json#1811
fix: change the generation conditions of the css.hot-update.json#1811colinaaa merged 4 commits intolynx-family:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 4ca4295 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 |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughReplaced mode/ENV-based HMR detection with an explicit Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.changeset/eleven-lizards-grin.md (1)
1-6: Changeset exists and targets the correct package — good.Consider making the note more explicit: mention that generation now keys off devServer.hot, not env/mode, to aid consumers scanning release notes.
Suggested wording:
- “Generate css.hot-update.json only when devServer.hot is enabled (instead of env/mode checks).”
packages/webpack/css-extract-webpack-plugin/src/CssExtractRspackPlugin.ts (1)
202-205: Use suffix replacement for “.css” to avoid accidental mid-string replacements.Safer and clearer to replace only a terminal “.css”.
- filename.replace( - '.css', + filename.replace( + /\.css$/, `${this.hash ? `.${this.hash}` : ''}.css.hot-update.json`, ),- cssHotUpdatePath!.replace( - '.css', + cssHotUpdatePath!.replace( + /\.css$/, `${this.hash ? `.${this.hash}` : ''}.css.hot-update.json`, ),Also applies to: 261-264
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.changeset/eleven-lizards-grin.md(1 hunks)packages/webpack/css-extract-webpack-plugin/src/CssExtractRspackPlugin.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md
📄 CodeRabbit inference engine (AGENTS.md)
For contributions, always generate a changeset and commit the resulting markdown file(s)
Files:
.changeset/eleven-lizards-grin.md
🧠 Learnings (7)
📓 Common learnings
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
PR: lynx-family/lynx-stack#1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, empty changeset files (containing only `---\n\n---`) are used for internal changes that modify src/** files but don't require meaningful release notes, such as private package changes or testing-only modifications. This satisfies CI requirements without generating user-facing release notes.
Applied to files:
.changeset/eleven-lizards-grin.md
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
PR: lynx-family/lynx-stack#1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, private packages (marked with "private": true in package.json) like lynx-js/react-transform don't require meaningful changeset entries even when their public APIs change, since they are not published externally and only affect internal development.
Applied to files:
.changeset/eleven-lizards-grin.md
📚 Learning: 2025-07-22T09:23:07.797Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.
Applied to files:
.changeset/eleven-lizards-grin.md
📚 Learning: 2025-07-22T09:26:16.722Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:26:16.722Z
Learning: In the lynx-family/lynx-stack repository, CI checks require changesets when files matching the pattern "src/**" are modified (as configured in .changeset/config.json). For internal changes that don't need meaningful changesets, an empty changeset file is used to satisfy the CI requirement while not generating any release notes.
Applied to files:
.changeset/eleven-lizards-grin.md
📚 Learning: 2025-08-19T11:25:36.127Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1558
File: .changeset/solid-squids-fall.md:2-2
Timestamp: 2025-08-19T11:25:36.127Z
Learning: In the lynx-family/lynx-stack repository, changesets should use the exact package name from package.json#name, not generic or unscoped names. Each package has its own specific scoped name (e.g., "lynx-js/react-transform" for packages/react/transform).
Applied to files:
.changeset/eleven-lizards-grin.md
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.
Applied to files:
.changeset/eleven-lizards-grin.md
🧬 Code graph analysis (1)
packages/webpack/css-extract-webpack-plugin/src/CssExtractRspackPlugin.ts (1)
packages/webpack/chunk-loading-webpack-plugin/test/cases/chunk-loading/runtime-globals/rspack.config.js (1)
compiler(20-20)
🔇 Additional comments (1)
packages/webpack/css-extract-webpack-plugin/src/CssExtractRspackPlugin.ts (1)
197-210: No change required — hot-update assets should use the previous compilation hash.Verified: webpack/rspack HMR emits .hot-update.{json,js} named with the previous compilation's hash, so emitting filenames with this.hash set after emit is correct.
Applies to: 197–210, 223–224, 230–236, 267–273
packages/webpack/css-extract-webpack-plugin/src/CssExtractRspackPlugin.ts
Outdated
Show resolved
Hide resolved
packages/webpack/css-extract-webpack-plugin/src/CssExtractRspackPlugin.ts
Outdated
Show resolved
Hide resolved
6b78592 to
70ab6f3
Compare
packages/webpack/css-extract-webpack-plugin/src/CssExtractRspackPlugin.ts
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
70ab6f3 to
0bd5311
Compare
Co-authored-by: Yiming Li <yimingli.cs@gmail.com> Signed-off-by: Nirvana <1357711537@qq.com>
CodSpeed Performance ReportMerging #1811 will degrade performances by 5.9%Comparing Summary
Benchmarks breakdown
Footnotes
|
React Example#5573 Bundle Size — 237.56KiB (0%).5ce30b6(current) vs 316da85 main#5557(baseline) Bundle metrics
|
| Current #5573 |
Baseline #5557 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
166 |
166 |
|
68 |
68 |
|
46.81% |
46.81% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #5573 |
Baseline #5557 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
91.8KiB |
91.8KiB |
Bundle analysis report Branch Nirvana-Jie:fix/css-hot-update Project dashboard
Generated by RelativeCI Documentation Report issue
Web Explorer#5570 Bundle Size — 365.44KiB (0%).5ce30b6(current) vs 316da85 main#5554(baseline) Bundle metrics
Bundle size by type
|
| Current #5570 |
Baseline #5554 |
|
|---|---|---|
239.42KiB |
239.42KiB |
|
94.02KiB |
94.02KiB |
|
32KiB |
32KiB |
Bundle analysis report Branch Nirvana-Jie:fix/css-hot-update Project dashboard
Generated by RelativeCI Documentation Report issue
Signed-off-by: Qingyu Wang <40660121+colinaaa@users.noreply.github.com>
4ca4295
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.114.1 ### Patch Changes - Add `event.stopPropagation` and `event.stopImmediatePropagation` in MTS, to help with event propagation control ([#1835](#1835)) ```tsx function App() { function handleInnerTap(event: MainThread.TouchEvent) { "main thread"; event.stopPropagation(); // Or stop immediate propagation with // event.stopImmediatePropagation(); } // OuterTap will not be triggered return ( <view main-thread:bindtap={handleOuterTap}> <view main-thread:bindtap={handleInnerTap}> <text>Hello, world</text> </view> </view> ); } ``` Note, if this feature is used in [Lazy Loading Standalone Project](https://lynxjs.org/react/code-splitting.html#lazy-loading-standalone-project), both the Producer and the Consumer should update to latest version of `@lynx-js/react` to make sure the feature is available. - Fix the "ReferenceError: Node is not defined" error. ([#1850](#1850)) This error would happen when upgrading to `@testing-library/jest-dom` [v6.9.0](https://github.com/testing-library/jest-dom/releases/tag/v6.9.0). - fix: optimize main thread event error message ([#1838](#1838)) ## @lynx-js/rspeedy@0.11.5 ### Patch Changes - Bump Rsbuild v1.5.13 with Rspack v1.5.8. ([#1849](#1849)) ## @lynx-js/react-rsbuild-plugin@0.11.1 ### Patch Changes - Updated dependencies \[[`19f823a`](19f823a)]: - @lynx-js/css-extract-webpack-plugin@0.6.4 - @lynx-js/react-alias-rsbuild-plugin@0.11.1 - @lynx-js/use-sync-external-store@1.5.0 - @lynx-js/react-refresh-webpack-plugin@0.3.4 - @lynx-js/react-webpack-plugin@0.7.1 ## @lynx-js/testing-environment@0.1.8 ### Patch Changes - Fix the "ReferenceError: Node is not defined" error. ([#1850](#1850)) This error would happen when upgrading to `@testing-library/jest-dom` [v6.9.0](https://github.com/testing-library/jest-dom/releases/tag/v6.9.0). ## @lynx-js/web-constants@0.17.2 ### Patch Changes - feat: support load bts chunk from remote address ([#1834](#1834)) - re-support chunk splitting - support lynx.requireModule with a json file - support lynx.requireModule, lynx.requireModuleAsync with a remote url - support to add a breakpoint in chrome after reloading the web page - Updated dependencies \[]: - @lynx-js/web-worker-rpc@0.17.2 ## @lynx-js/web-core@0.17.2 ### Patch Changes - feat: support load bts chunk from remote address ([#1834](#1834)) - re-support chunk splitting - support lynx.requireModule with a json file - support lynx.requireModule, lynx.requireModuleAsync with a remote url - support to add a breakpoint in chrome after reloading the web page - Updated dependencies \[[`a35a245`](a35a245)]: - @lynx-js/web-worker-runtime@0.17.2 - @lynx-js/web-constants@0.17.2 - @lynx-js/web-mainthread-apis@0.17.2 - @lynx-js/web-worker-rpc@0.17.2 ## @lynx-js/web-mainthread-apis@0.17.2 ### Patch Changes - Updated dependencies \[[`a35a245`](a35a245)]: - @lynx-js/web-constants@0.17.2 - @lynx-js/web-style-transformer@0.17.2 ## @lynx-js/web-worker-runtime@0.17.2 ### Patch Changes - feat: support load bts chunk from remote address ([#1834](#1834)) - re-support chunk splitting - support lynx.requireModule with a json file - support lynx.requireModule, lynx.requireModuleAsync with a remote url - support to add a breakpoint in chrome after reloading the web page - Updated dependencies \[[`a35a245`](a35a245)]: - @lynx-js/web-constants@0.17.2 - @lynx-js/web-mainthread-apis@0.17.2 - @lynx-js/web-worker-rpc@0.17.2 ## @lynx-js/css-extract-webpack-plugin@0.6.4 ### Patch Changes - Avoid generating `.css.hot-update.json` when HMR is disabled. ([#1811](#1811)) ## create-rspeedy@0.11.5 ## @lynx-js/react-alias-rsbuild-plugin@0.11.1 ## upgrade-rspeedy@0.11.5 ## @lynx-js/web-core-server@0.17.2 ## @lynx-js/web-rsbuild-server-middleware@0.17.2 ## @lynx-js/web-style-transformer@0.17.2 ## @lynx-js/web-worker-rpc@0.17.2 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
css-hot-update.json should not be generated when
hmrconfiguration is actively turned offSummary by CodeRabbit
Bug Fixes
Chores
Checklist