feat: move cssChunksToMap implementation to @lynx-js/css-serializer#2269
feat: move cssChunksToMap implementation to @lynx-js/css-serializer#2269
cssChunksToMap implementation to @lynx-js/css-serializer#2269Conversation
🦋 Changeset detectedLatest commit: 7075e4a The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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 |
📝 WalkthroughWalkthroughRelocates the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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! |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/webpack/template-webpack-plugin/src/index.ts (1)
11-12: Consolidate the two imports from@lynx-js/css-serializerinto one.
Pluginsis already available asCSS.Pluginsfrom the namespace import, making the separate named import redundant.♻️ Proposed refactor
-import { Plugins } from '@lynx-js/css-serializer'; import * as CSS from '@lynx-js/css-serializer';Then update the usage below:
export const CSSPlugins: { - parserPlugins: typeof Plugins; + parserPlugins: typeof CSS.Plugins; } = { - parserPlugins: Plugins, + parserPlugins: CSS.Plugins, };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/webpack/template-webpack-plugin/src/index.ts` around lines 11 - 12, Remove the redundant named import and use the namespace import only: replace the two imports with a single namespace import (keep import * as CSS from '@lynx-js/css-serializer') and update any references to the named symbol Plugins to use CSS.Plugins (search for usages of Plugins in this module and prefix them with CSS.). Ensure no other named imports from '@lynx-js/css-serializer' remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/webpack/template-webpack-plugin/src/index.ts`:
- Around line 23-27: The exported constant CSSPlugins is missing a JSDoc release
tag which triggers API Extractor; add a JSDoc block immediately above the
CSSPlugins declaration (referencing CSSPlugins and Plugins) that includes a
short description and the `@public` release tag so the symbol is explicitly public
in the API surface.
---
Nitpick comments:
In `@packages/webpack/template-webpack-plugin/src/index.ts`:
- Around line 11-12: Remove the redundant named import and use the namespace
import only: replace the two imports with a single namespace import (keep import
* as CSS from '@lynx-js/css-serializer') and update any references to the named
symbol Plugins to use CSS.Plugins (search for usages of Plugins in this module
and prefix them with CSS.). Ensure no other named imports from
'@lynx-js/css-serializer' remain.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (14)
.changeset/wet-rockets-taste.mdpackages/tools/css-serializer/src/css/ast.tspackages/tools/css-serializer/src/css/cssChunksToMap.tspackages/tools/css-serializer/src/css/debundle.tspackages/tools/css-serializer/src/css/index.tspackages/tools/css-serializer/src/index.tspackages/tools/css-serializer/test/css.test.tspackages/tools/css-serializer/vitest.config.tspackages/webpack/template-webpack-plugin/etc/template-webpack-plugin.api.mdpackages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.tspackages/webpack/template-webpack-plugin/src/WebEncodePlugin.tspackages/webpack/template-webpack-plugin/src/css/index.tspackages/webpack/template-webpack-plugin/src/index.tspackages/webpack/template-webpack-plugin/src/web/genStyleInfo.ts
💤 Files with no reviewable changes (1)
- packages/webpack/template-webpack-plugin/src/css/index.ts
Merging this PR will not alter performance
Comparing Footnotes
|
Web Explorer#7777 Bundle Size — 383.74KiB (0%).7075e4a(current) vs 98b2504 main#7766(baseline) Bundle metrics
|
| Current #7777 |
Baseline #7766 |
|
|---|---|---|
154.88KiB |
154.88KiB |
|
35.06KiB |
35.06KiB |
|
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 #7777 |
Baseline #7766 |
|
|---|---|---|
252.83KiB |
252.83KiB |
|
95.85KiB |
95.85KiB |
|
35.06KiB |
35.06KiB |
Bundle analysis report Branch feat/cssChunksToMap Project dashboard
Generated by RelativeCI Documentation Report issue
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.4 ### Patch Changes - Support `ReactLynx::hooks::setState` trace for function components. ([#2198](#2198)) - fix: properly cleanup `__DestroyLifetime` listeners and listCallbacks in `snapshotDestroyList`. ([#2224](#2224)) ## @lynx-js/qrcode-rsbuild-plugin@0.4.6 ### Patch Changes - Print all entries with all schema URLs in non-TTY environments instead of only showing the first entry's QR code. ([#2227](#2227)) ## @lynx-js/react-rsbuild-plugin@0.12.9 ### Patch Changes - Add alias for `use-sync-external-store/with-selector.js` and `use-sync-external-store/shim/with-selector.js` pointing to @lynx-js/use-sync-external-store. ([#2200](#2200)) - Updated dependencies \[[`9033e2d`](9033e2d)]: - @lynx-js/template-webpack-plugin@0.10.4 - @lynx-js/react-alias-rsbuild-plugin@0.12.9 - @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.4 - @lynx-js/css-extract-webpack-plugin@0.7.0 ## @lynx-js/css-serializer@0.1.4 ### Patch Changes - Move `cssChunksToMap` implementation from `@lynx-js/template-webpack-plugin` to `@lynx-js/css-serializer` for future reuse. ([#2269](#2269)) ## @lynx-js/web-core-wasm@0.0.4 ### Patch Changes - Refactor web element templates and server-side rendering logic ([#2205](#2205)) - Updated dependencies \[[`94e5779`](94e5779), [`9033e2d`](9033e2d)]: - @lynx-js/web-elements@0.11.3 - @lynx-js/css-serializer@0.1.4 ## @lynx-js/web-elements@0.11.3 ### Patch Changes - fix: firefox 147+ layout issue ([#2205](#2205)) ## @lynx-js/template-webpack-plugin@0.10.4 ### Patch Changes - Move `cssChunksToMap` implementation from `@lynx-js/template-webpack-plugin` to `@lynx-js/css-serializer` for future reuse. ([#2269](#2269)) - Updated dependencies \[[`9033e2d`](9033e2d)]: - @lynx-js/css-serializer@0.1.4 ## @lynx-js/react-alias-rsbuild-plugin@0.12.9 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary by CodeRabbit
Release Notes
Bug Fixes
New Features
Chores
In #2143, we need to use
cssChunksToMapin@lynx-js/lynx-bundle-rslib-configpackage.To avoid repeating ourselves, we extract the
cssChunksToMapAPI from@lynx-js/template-webpack-pluginto@lynx-js/css-serializer.Checklist