-
Notifications
You must be signed in to change notification settings - Fork 111
chore(deps): bump swc_core to v39.0.3 #1721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: c0c4e9d 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 changeset for a patch release, bumps workspace Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Poem
✨ Finishing touches
🧪 Generate unit tests
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 |
Signed-off-by: BitterGourd <[email protected]>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packages/react/transform/src/lib.rs (1)
224-225: Expose and accept “commonjs” consistentlyYou added
IsModule::CommonJSinToNapiValue, butFromNapiValueand the TS type still don’t accept it. Either remove the arm for now or complete the API so JS callers can pass"commonjs".Apply this to accept and type it:
- #[napi(ts_type = "boolean | 'unknown'")] + #[napi(ts_type = "boolean | 'unknown' | 'commonjs'")] pub is_module: Option<IsModuleConfig>,- let str_val = <&str>::from_napi_value(env, napi_val); - if str_val.is_ok() && str_val.unwrap() == "unknown" { - return Ok(IsModuleConfig(IsModule::Unknown)); - } + if let Ok(s) = <&str>::from_napi_value(env, napi_val) { + return Ok(IsModuleConfig(match s { + "unknown" => IsModule::Unknown, + "commonjs" => IsModule::CommonJS, + _ => return Err(napi::bindgen_prelude::error!( + napi::bindgen_prelude::Status::InvalidArg, + "value `{}` does not match any variant of enum `{}`", + s, "IsModuleConfig" + )), + })); + }Confirmed that
IsModule::CommonJSexists in swc_core v39. (rustdoc.swc.rs)
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
.changeset/mighty-numbers-talk.md(1 hunks)Cargo.toml(1 hunks)packages/react/transform/Cargo.toml(1 hunks)packages/react/transform/scripts/build_wasm.js(1 hunks)packages/react/transform/src/bundle.rs(1 hunks)packages/react/transform/src/lib.rs(3 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/mighty-numbers-talk.md
🧠 Learnings (4)
📚 Learning: 2025-09-10T11:42:36.855Z
Learnt from: gaoachao
PR: lynx-family/lynx-stack#1714
File: packages/react/transform/Cargo.toml:19-19
Timestamp: 2025-09-10T11:42:36.855Z
Learning: In packages/react/transform/Cargo.toml, the crate uses serde derive macros (#[derive(Serialize, Deserialize)]) in multiple files including src/esbuild.rs and src/swc_plugin_extract_str/mod.rs, so the "derive" feature is required when migrating to workspace dependencies.
Applied to files:
Cargo.tomlpackages/react/transform/Cargo.toml
📚 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/mighty-numbers-talk.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/mighty-numbers-talk.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/mighty-numbers-talk.md
🧬 Code graph analysis (1)
packages/react/transform/src/lib.rs (3)
packages/react/transform/src/swc_plugin_css_scope/mod.rs (1)
to_napi_value(62-71)packages/react/transform/src/swc_plugin_inject/mod.rs (1)
to_napi_value(60-77)packages/react/transform/src/target.rs (1)
to_napi_value(37-47)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: build / Build (Ubuntu)
- GitHub Check: build / Build (Windows)
- GitHub Check: test-rust / Test (Ubuntu)
🔇 Additional comments (5)
Cargo.toml (1)
23-23: Workspace bump to swc_core v39.0.3 looks goodNo issues spotted here. Downstream updates to PrintArgs in consumers are present in this PR.
.changeset/mighty-numbers-talk.md (1)
1-6: Changeset present and scoped appropriatelyPatch entry is fine for this chore. Nothing else needed.
packages/react/transform/Cargo.toml (1)
26-26: Migrated getrandom to 0.3.x for wasm targetVersion bump is correct; feature flag removal aligns with 0.3’s cfg-based backend selection. Ensure the codebase provides the required custom backend entrypoint when building with
getrandom_backend="custom". See comments in src/lib.rs and build script. (docs.rs)packages/react/transform/src/bundle.rs (1)
154-178: Added source_map_ignore_list: None to PrintArgs — correct for swc_core v39Field exists on PrintArgs in current swc toolchain; using None maintains previous behavior. (docs.rs)
packages/react/transform/src/lib.rs (1)
633-641: PrintArgs: source_map_ignore_list: None — aligned with swc changesField name and type match current API; keeping it None preserves prior sourcemap behavior. (docs.rs)
Web Explorer#5120 Bundle Size — 362.79KiB (0%).c0c4e9d(current) vs dc28178 main#5118(baseline) Bundle metrics
Bundle size by type
|
| Current #5120 |
Baseline #5118 |
|
|---|---|---|
236.88KiB |
236.88KiB |
|
94.02KiB |
94.02KiB |
|
31.89KiB |
31.89KiB |
Bundle analysis report Branch chore/bump-swc-core-39.0.3 Project dashboard
Generated by RelativeCI Documentation Report issue
React Example#5127 Bundle Size — 238.9KiB (0%).c0c4e9d(current) vs dc28178 main#5125(baseline) Bundle metrics
|
| Current #5127 |
Baseline #5125 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
163 |
163 |
|
67 |
67 |
|
46.79% |
46.79% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #5127 |
Baseline #5125 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
93.14KiB |
93.14KiB |
Bundle analysis report Branch chore/bump-swc-core-39.0.3 Project dashboard
Generated by RelativeCI Documentation Report issue
CodSpeed Performance ReportMerging #1721 will improve performances by ×8Comparing Summary
Benchmarks breakdown
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/react/transform/__test__/fixture.spec.js (1)
698-712: Relax TSX error snapshot to assert only the essentialsSame rationale: pinning exact column/length and full text is brittle across parser versions.
Apply this diff:
- expect(result.errors).toMatchInlineSnapshot(` - [ - { - "location": { - "column": 31, - "file": "", - "length": 0, - "line": 1, - "lineText": "const p = <any>Promise.all([]);", - }, - "pluginName": "", - "text": "Expected '</', got '<eof>'", - }, - ] - `); + expect(result.errors).toHaveLength(1); + expect(result.errors[0]).toMatchObject({ + text: expect.stringContaining("Expected '</'"), + location: expect.objectContaining({ + line: 1, + file: '', + lineText: 'const p = <any>Promise.all([]);', + }), + });
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/react/transform/__test__/fixture.spec.js(2 hunks)
🔇 Additional comments (1)
packages/react/transform/__test__/fixture.spec.js (1)
222-240: Make error assertions less brittle — relax inline snapshotSnapshot pins EOF-based JSX parse details (column/length/text) that shift across swc_core; assert only stable fields.
File: packages/react/transform/test/fixture.spec.js (lines 222-240)
- expect(result).toMatchInlineSnapshot(` - { - "code": "", - "errors": [ - { - "location": { - "column": 7, - "file": "", - "length": 0, - "line": 1, - "lineText": "<view>;", - }, - "pluginName": "", - "text": "Expected '</', got '<eof>'", - }, - ], - "warnings": [], - } - `); + expect(result.code).toBe(''); + expect(result.warnings).toEqual([]); + expect(result.errors).toHaveLength(1); + expect(result.errors[0]).toMatchObject({ + text: expect.stringContaining("Expected '</'"), + location: expect.objectContaining({ + line: 1, + file: '', + lineText: '<view>;', + }), + });Run this locally to find other fragile snapshots:
#!/bin/bash set -euo pipefail # Look for error snapshots pinning exact "Expected '</'" messages or column/length pairs. rg -nP --glob '!node_modules/**' "(Expected '</', got.*|\"column\":\s*\d+,\s*\n\s*\"length\":\s*\d+)"
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/[email protected] ### Minor Changes - fix: Delay execution of `runOnMainThread()` during initial render ([#1667](#1667)) When called during the initial render, `runOnMainThread()` would execute before the `main-thread:ref` was hydrated, causing it to be incorrectly set to null. This change delays the function's execution to ensure the ref is available and correctly assigned. ### Patch Changes - Fix "TypeError: cannot read property '0' of undefined" in deferred list-item scenarios. ([#1692](#1692)) Deferred `componentAtIndex` causes nodes that quickly appear/disappear to be enqueued without `__elements`. Update `signMap` before `__FlushElementTree` to resolve the issue. - Keep the same `<page/>` element when calling `rerender` in testing library. ([#1656](#1656)) - Bump `swc_core` to `39.0.3`. ([#1721](#1721)) ## @lynx-js/[email protected] ### Minor Changes - Added `group-*`, `peer-*`, and `parent-*` modifiers (ancestor, sibling, and direct-parent scopes) for `uiVariants` plugin. ([#1741](#1741)) Fixed prefix handling in prefixed projects — `ui-*` state markers are not prefixed, while scope markers (`.group`/`.peer`) honor `config('prefix')`. **BREAKING**: Removed slash-based naming modifiers on self (non-standard); slash modifiers remain supported for scoped markers (e.g. `group/menu`, `peer/tab`). Bumped peer dependency to `tailwindcss@^3.4.0` (required for use of internal features). ## @lynx-js/[email protected] ### Minor Changes - Remove `@lynx-js/react` from peerDependencies. ([#1711](#1711)) - Add a new required option `workletRuntimePath`. ([#1711](#1711)) ## @lynx-js/[email protected] ### Patch Changes - Support `server.proxy`. ([#1745](#1745)) - Support `command` and `env` parameters in the function exported by `lynx.config.js`. ([#1669](#1669)) ```js import { defineConfig } from "@lynx-js/rspeedy"; export default defineConfig(({ command, env }) => { const isBuild = command === "build"; const isTest = env === "test"; return { output: { minify: !isTest, }, performance: { buildCache: isBuild, }, }; }); ``` - Support `resolve.dedupe`. ([#1671](#1671)) This is useful when having multiple duplicated packages in the bundle: ```js import { defineConfig } from "@lynx-js/rspeedy"; export default defineConfig({ resolve: { dedupe: ["tslib"], }, }); ``` - Support `resolve.aliasStrategy` for controlling priority between `tsconfig.json` paths and `resolve.alias` ([#1722](#1722)) ```js import { defineConfig } from "@lynx-js/rspeedy"; export default defineConfig({ resolve: { alias: { "@": "./src", }, // 'prefer-tsconfig' (default): tsconfig.json paths take priority // 'prefer-alias': resolve.alias takes priority aliasStrategy: "prefer-alias", }, }); ``` - Bump Rsbuild v1.5.4 with Rspack v1.5.2. ([#1644](#1644)) - Updated dependencies \[[`d7c5da3`](d7c5da3)]: - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - Fix using wrong version of `@lynx-js/react/worklet-runtime`. ([#1711](#1711)) - Be compat with `@lynx-js/react` v0.113.0 ([#1667](#1667)) - Disable `builtin:lightningcss-loader` for `environments.web`. ([#1732](#1732)) - Updated dependencies \[[`5ad38e6`](5ad38e6), [`69b3ae0`](69b3ae0), [`69b3ae0`](69b3ae0), [`c2f90bd`](c2f90bd)]: - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - Allow customization of the react$ alias. ([#1653](#1653)) ```js import { defineConfig } from "@lynx-js/rspeedy"; export default defineConfig({ resolve: { alias: { react$: "@lynx-js/react/compat", }, }, }); ``` ## @lynx-js/[email protected] ### Patch Changes - feat: supports lazy bundle. (This feature requires `@lynx-js/lynx-core >= 0.1.3`) ([#1235](#1235)) - Updated dependencies \[]: - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - refactor: improve chunk loading ([#1703](#1703)) - feat: supports lazy bundle. (This feature requires `@lynx-js/lynx-core >= 0.1.3`) ([#1235](#1235)) - Updated dependencies \[[`608f375`](608f375)]: - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - refactor: improve chunk loading ([#1703](#1703)) - feat: supports lazy bundle. (This feature requires `@lynx-js/lynx-core >= 0.1.3`) ([#1235](#1235)) ## @lynx-js/[email protected] ### Patch Changes - fix: 1. svg use image tag to render, to differentiate background-image styles ([#1668](#1668)) 1. use blob instead of raw data-uri > Not using data-uri(data:image/svg+xml;utf8,${props.content}) > since it has follow limitations: > > < and > must be encoded to %3C and %3E. > Double quotes must be converted to single quotes. > Colors must use a non-hex format because # will not work inside data-uri. > See: <https://codepen.io/zvuc/pen/BWNLJL> > Instead, we use modern Blob API to create SVG URL that have the same support - Updated dependencies \[[`d618304`](d618304), [`1d97fce`](1d97fce)]: - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - x-overlay-ng prevent page scroll when visible ([#1499](#1499)) - fix: 1. svg use image tag to render, to differentiate background-image styles ([#1668](#1668)) 1. use blob instead of raw data-uri > Not using data-uri(data:image/svg+xml;utf8,${props.content}) > since it has follow limitations: > > < and > must be encoded to %3C and %3E. > Double quotes must be converted to single quotes. > Colors must use a non-hex format because # will not work inside data-uri. > See: <https://codepen.io/zvuc/pen/BWNLJL> > Instead, we use modern Blob API to create SVG URL that have the same support ## @lynx-js/[email protected] ### Patch Changes - feat: supports lazy bundle. (This feature requires `@lynx-js/lynx-core >= 0.1.3`) ([#1235](#1235)) - Updated dependencies \[[`608f375`](608f375)]: - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - feat: supports lazy bundle. (This feature requires `@lynx-js/lynx-core >= 0.1.3`) ([#1235](#1235)) - Updated dependencies \[[`608f375`](608f375)]: - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - Fix unmet peer dependency "@rspack/core@'^1.3.10". ([#1660](#1660)) ## @lynx-js/[email protected] ### Patch Changes - fix: add appType field for lazy bundle for web ([#1738](#1738)) ## [email protected] ## [email protected] ## @lynx-js/[email protected] ## @lynx-js/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Chores
Build
Tests
Checklist