chore(deps): simplify swc_core features in Cargo.toml#2086
chore(deps): simplify swc_core features in Cargo.toml#2086gaoachao merged 1 commit intolynx-family:mainfrom
Conversation
Refactored swc_core feature flags across all transform-related crates to remove unnecessary modules, improving build efficiency and keeping only required features for building and testing.
|
📝 WalkthroughWalkthroughThis PR reduces swc_core feature flags across multiple Cargo.toml files in the React transform workspace, removing unused CSS, internal testing features, and unnecessary transforms while retaining only the minimal required capabilities per crate. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
📜 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 (14)
packages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_directive_dce/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugin_inject/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_shake/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugins_shared/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.toml
🧰 Additional context used
🧠 Learnings (22)
📓 Common learnings
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1782
File: packages/react/transform/crates/swc_plugin_inject/napi.rs:31-47
Timestamp: 2025-09-19T07:37:58.778Z
Learning: User gaoachao prefers to keep refactoring PRs minimal and focused, deferring non-essential improvements to separate PRs to maintain clear scope boundaries.
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1916
File: packages/react/transform/crates/swc_plugin_snapshot/lib.rs:9-9
Timestamp: 2025-11-05T03:26:52.546Z
Learning: In the lynx-stack repository's swc_core v47 upgrade (PR #1916), the import `use swc_core::atoms as swc_atoms;` is required in files that use the `quote!` macro (e.g., packages/react/transform/crates/swc_plugin_snapshot/lib.rs, swc_plugin_list/lib.rs, swc_plugin_worklet/gen_stmt.rs) even though swc_atoms may not appear explicitly in the source code. This is because the quote! macro generates code that internally references swc_atoms. Removing this import causes compiler error: "failed to resolve: use of unresolved module or unlinked crate `swc_atoms`".
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 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.
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 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.
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : When running tests, use `cargo test --all-features` to ensure all feature combinations are tested.
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T05:10:01.608Z
Learning: Applies to packages/react/transform/**/*.rs : Implement custom Rust-based JSX transforms in packages/react/transform/
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Minimize crossing the WASM/JS boundary. Batch operations where possible.
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : When adding new functionality, carefully consider which feature flag it belongs to (`client`, `encode`, or `server`).
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Minimize allocations in hot paths. Use `String::with_capacity()` when the size is known, reuse buffers where possible.
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Use `#[cfg(feature = "...")]` to conditionally compile code based on features (`client`, `encode`, `server`).
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T05:10:01.608Z
Learning: Applies to packages/react/components/**/*.{ts,tsx} : Optimize component library in packages/react/components/ using ReactLynx syntax
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Consider the impact on WASM binary size. Keep the LCP (Largest Contentful Paint) in mind.
📚 Learning: 2025-09-10T11:42:36.855Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 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:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_inject/Cargo.tomlpackages/react/transform/crates/swc_plugin_shake/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugins_shared/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_directive_dce/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-10-29T10:28:27.519Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1899
File: packages/react/transform/crates/swc_plugin_snapshot/tests/__swc_snapshots__/lib.rs/should_static_extract_dynamic_inline_style.js:20-24
Timestamp: 2025-10-29T10:28:27.519Z
Learning: Files inside packages/react/transform/crates/swc_plugin_snapshot/tests/__swc_snapshots__/ are auto-generated test snapshot files and should not be manually updated. Any issues with the generated code should be addressed in the code generator/transform logic, not in the snapshots themselves.
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_inject/Cargo.tomlpackages/react/transform/crates/swc_plugin_shake/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugins_shared/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_directive_dce/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-11-05T03:26:52.546Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1916
File: packages/react/transform/crates/swc_plugin_snapshot/lib.rs:9-9
Timestamp: 2025-11-05T03:26:52.546Z
Learning: In the lynx-stack repository's swc_core v47 upgrade (PR #1916), the import `use swc_core::atoms as swc_atoms;` is required in files that use the `quote!` macro (e.g., packages/react/transform/crates/swc_plugin_snapshot/lib.rs, swc_plugin_list/lib.rs, swc_plugin_worklet/gen_stmt.rs) even though swc_atoms may not appear explicitly in the source code. This is because the quote! macro generates code that internally references swc_atoms. Removing this import causes compiler error: "failed to resolve: use of unresolved module or unlinked crate `swc_atoms`".
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_inject/Cargo.tomlpackages/react/transform/crates/swc_plugin_shake/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugins_shared/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_directive_dce/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-12-26T05:10:01.608Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T05:10:01.608Z
Learning: Applies to packages/react/transform/**/*.rs : Implement custom Rust-based JSX transforms in packages/react/transform/
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_shake/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugins_shared/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_directive_dce/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-12-31T06:34:45.663Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Check if the comments in the code need to be updated to reflect your changes.
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-12-31T06:34:45.663Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : When running tests, use `cargo test --all-features` to ensure all feature combinations are tested.
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_inject/Cargo.tomlpackages/react/transform/crates/swc_plugin_shake/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugins_shared/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-12-31T06:34:45.663Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Consider the impact on WASM binary size. Keep the LCP (Largest Contentful Paint) in mind.
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
📚 Learning: 2025-12-31T06:34:45.663Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Minimize crossing the WASM/JS boundary. Batch operations where possible.
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
📚 Learning: 2025-12-31T06:34:45.663Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Use idiomatic Rust code.
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-09-18T04:43:54.426Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1771
File: packages/react/transform/tests/__swc_snapshots__/src/swc_plugin_snapshot/mod.rs/basic_component_with_static_sibling.js:2-2
Timestamp: 2025-09-18T04:43:54.426Z
Learning: In packages/react/transform/src/swc_plugin_compat/mod.rs, the `add_pure_comment` function at lines 478-482 is specifically for `wrapWithLynxComponent` calls, not `createSnapshot` calls. The PURE comment injection for `createSnapshot` is handled separately in swc_plugin_snapshot/mod.rs. These are two distinct code paths that should be treated differently.
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_inject/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_directive_dce/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-12-26T05:10:01.608Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T05:10:01.608Z
Learning: Applies to packages/**/*.rs : Include Rust compilation targets (wasm32-unknown-unknown) for packages requiring native bindings
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_inject/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-12-31T06:34:45.663Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Use `#[cfg(feature = "...")]` to conditionally compile code based on features (`client`, `encode`, `server`).
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_inject/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-12-31T06:34:45.663Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Run `cargo test --all-features` to execute unit tests. Tests are co-located with the source code using `#[cfg(test)]`.
Applied to files:
packages/react/transform/crates/swc_plugin_worklet/Cargo.tomlpackages/react/transform/crates/swc_plugin_inject/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_css_scope/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-12-26T05:10:01.608Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T05:10:01.608Z
Learning: Use pnpm workspaces and Turbo monorepo build orchestration as configured in turbo.json and pnpm-workspace.yaml
Applied to files:
packages/react/transform/crates/swc_plugin_shake/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugin_directive_dce/Cargo.toml
📚 Learning: 2025-09-18T04:43:54.426Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1771
File: packages/react/transform/tests/__swc_snapshots__/src/swc_plugin_snapshot/mod.rs/basic_component_with_static_sibling.js:2-2
Timestamp: 2025-09-18T04:43:54.426Z
Learning: In the lynx-family/lynx-stack repository, the `add_pure_comment` function in packages/react/transform/src/swc_plugin_compat/mod.rs (around lines 478-482) is specifically for `wrapWithLynxComponent` calls, not `createSnapshot` calls. The PURE comment injection for `createSnapshot` is handled separately in swc_plugin_snapshot/mod.rs.
Applied to files:
packages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 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:
packages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_snapshot/Cargo.tomlpackages/react/transform/Cargo.toml
📚 Learning: 2025-12-26T05:10:01.608Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T05:10:01.608Z
Learning: Applies to packages/react/components/**/*.{ts,tsx} : Optimize component library in packages/react/components/ using ReactLynx syntax
Applied to files:
packages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugins_shared/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/Cargo.toml
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 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:
packages/react/transform/swc-plugin-reactlynx-compat/Cargo.tomlpackages/react/transform/swc-plugin-reactlynx/Cargo.toml
📚 Learning: 2025-08-19T11:25:36.127Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 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:
packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
📚 Learning: 2025-12-31T06:34:45.663Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/AGENTS.md : Check if `AGENTS.md` needs to be updated to reflect your changes (e.g., new feature flags, structural changes, new dependencies).
Applied to files:
packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
📚 Learning: 2025-12-31T06:34:45.663Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2025-12-31T06:34:45.663Z
Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Use idiomatic Rust patterns. Prefer `Option::map`, `Result::and_then`, iterators, and pattern matching over imperative code where appropriate.
Applied to files:
packages/react/transform/swc-plugin-reactlynx/Cargo.tomlpackages/react/transform/crates/swc_plugin_list/Cargo.tomlpackages/react/transform/crates/swc_plugin_text/Cargo.tomlpackages/react/transform/crates/swc_plugin_compat/Cargo.toml
⏰ 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). (5)
- GitHub Check: build / Build (Ubuntu)
- GitHub Check: build / Build (Windows)
- GitHub Check: test-rust / Test (Ubuntu)
- GitHub Check: test-rust / clippy
- GitHub Check: test-rust / rustfmt
🔇 Additional comments (11)
packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml (1)
12-12: Feature reduction is correctly architected.The minimal feature set (
ecma_visit,ecma_plugin_transform) is appropriate for this cdylib plugin binary. The plugin properly delegates all transform logic toswc_plugin_compat, which declares the comprehensive feature set it needs (ecma_parser,ecma_utils,ecma_quote,testing_transform). The plugin code itself only uses the plugin interface—no direct usage of removed capabilities like parsing, codegen, or utilities.packages/react/transform/crates/swc_plugin_list/Cargo.toml (1)
10-10: Feature set is appropriately configured for quote! macro usage.The crate correctly includes the
ecma_quotefeature required by thequote!macro (used at lines 103, 109, and 115 in lib.rs). The feature set provides necessary support for AST manipulation (ecma_parser,ecma_utils,ecma_visit), code generation (ecma_quote), and testing (testing_transform), with the requireduse swc_core::atoms as swc_atoms;import present at line 1.packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml (1)
14-14: CSS feature removal is appropriate—this crate only transforms CSS import statements in JavaScript, not CSS parsing.The crate manipulates CSS imports within JavaScript/TypeScript code by detecting import paths with regex (line 143:
r"\.(scss|sass|css|less)$") and appending query parameters to the import source string (line 161). Since it operates on the JavaScript AST viaecma_parserandecma_visitand performs string-level transformations rather than CSS content analysis, the removed CSS features (css_parser,css_ast,css_visit,css_codegen) are genuinely unnecessary.packages/react/transform/crates/swc_plugin_text/Cargo.toml (1)
10-10: Feature migration is sound.The migration from private features (
__visit,__testing_transform) to their public counterparts (ecma_visit,testing_transform) is correct. All imports in the source code—includingcommon::DUMMY_SP, AST types fromecma::ast, visitor traits fromecma::visit, parser utilities fromecma::parser, and test macros fromecma::transforms::testing—are properly covered by the specified feature set. The removal of thebasefeature is appropriate; the codebase does not require it.packages/react/transform/crates/swc_plugin_worklet/Cargo.toml (1)
17-17: Add missingswc_atomsimport toextract_ident.rs.The file uses the
quote!macro (lines 51, 53, 163) but lacks the requireduse swc_core::atoms as swc_atoms;import. Per the swc_core v47 migration, thequote!macro internally referencesswc_atoms, and omitting this import causes a compiler error. Add the import at the top of the file, matching the pattern already present ingen_stmt.rs(line 7).⛔ Skipped due to learnings
Learnt from: colinaaa Repo: lynx-family/lynx-stack PR: 1916 File: packages/react/transform/crates/swc_plugin_snapshot/lib.rs:9-9 Timestamp: 2025-11-05T03:26:52.546Z Learning: In the lynx-stack repository's swc_core v47 upgrade (PR #1916), the import `use swc_core::atoms as swc_atoms;` is required in files that use the `quote!` macro (e.g., packages/react/transform/crates/swc_plugin_snapshot/lib.rs, swc_plugin_list/lib.rs, swc_plugin_worklet/gen_stmt.rs) even though swc_atoms may not appear explicitly in the source code. This is because the quote! macro generates code that internally references swc_atoms. Removing this import causes compiler error: "failed to resolve: use of unresolved module or unlinked crate `swc_atoms`".Learnt from: CR Repo: lynx-family/lynx-stack PR: 0 File: packages/web-platform/web-core-wasm/AGENTS.md:0-0 Timestamp: 2025-12-31T06:34:45.663Z Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Verify that the implementation matches the comments and the intended behavior. Prioritize code quality - 'Better to have nothing than garbage'.Learnt from: CR Repo: lynx-family/lynx-stack PR: 0 File: packages/web-platform/web-core-wasm/AGENTS.md:0-0 Timestamp: 2025-12-31T06:34:45.663Z Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Use idiomatic Rust code.Learnt from: gaoachao Repo: lynx-family/lynx-stack PR: 1771 File: packages/react/transform/tests/__swc_snapshots__/src/swc_plugin_snapshot/mod.rs/basic_component_with_static_sibling.js:2-2 Timestamp: 2025-09-18T04:43:54.426Z Learning: In packages/react/transform/src/swc_plugin_compat/mod.rs, the `add_pure_comment` function at lines 478-482 is specifically for `wrapWithLynxComponent` calls, not `createSnapshot` calls. The PURE comment injection for `createSnapshot` is handled separately in swc_plugin_snapshot/mod.rs. These are two distinct code paths that should be treated differently.Learnt from: gaoachao Repo: lynx-family/lynx-stack PR: 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.Learnt from: CR Repo: lynx-family/lynx-stack PR: 0 File: packages/web-platform/web-core-wasm/AGENTS.md:0-0 Timestamp: 2025-12-31T06:34:45.663Z Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Check if the comments in the code need to be updated to reflect your changes.Learnt from: CR Repo: lynx-family/lynx-stack PR: 0 File: packages/web-platform/web-core-wasm/AGENTS.md:0-0 Timestamp: 2025-12-31T06:34:45.663Z Learning: Applies to packages/web-platform/web-core-wasm/**/*.rs : Ensure that all public structs, enums, and functions have clear documentation comments (`///`). Comments must accurately reflect the logic.packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml (1)
19-19: Feature set looks appropriate for swc_plugin_snapshot.The included features
["ecma_parser", "ecma_utils", "ecma_quote", "ecma_visit", "testing_transform", "ecma_transforms_react"]align well with this crate's needs. Theecma_quotefeature enables thequote!macro, andswc_atoms(required by the macro per learnings) is provided transitively through the swc_plugins_shared dependency.packages/react/transform/crates/swc_plugin_shake/Cargo.toml (1)
13-13: [rewritten review comment]
[classification tag]packages/react/transform/crates/swc_plugin_directive_dce/Cargo.toml (1)
13-13: The concern about missingecma_utilsis unfounded.This crate does not use any utilities from
swc_core::ecma::utils. The code relies only on AST types fromecma::ast, theVisitMuttrait, and theHANDLERfromcommon::errors—all of which are provided by the configured features (ecma_parser,ecma_visit,testing_transform). The feature set is appropriate for the crate's actual implementation.Likely an incorrect or invalid review comment.
packages/react/transform/crates/swc_plugins_shared/Cargo.toml (1)
21-21: Verify that dependent crates compile with the current swc_core features.The swc_plugins_shared crate exports
jsx_helperswhich provides functions returningAtomtype (e.g.,jsx_attr_name,jsx_text_to_str). Whileswc_plugins_sharedenables theswc_atomsfeature, dependent crates likeswc_plugin_textcan successfully use these functions without theswc_atomsfeature, confirming thatAtomis available throughecma_astandecma_utils. The current feature set["ecma_ast", "ecma_utils", "swc_atoms"]appears appropriate, but compilation should be verified across all 11 dependent crates to ensure no feature-related issues occur.packages/react/transform/Cargo.toml (1)
22-22: Feature set reduction is appropriate for the main transform package.Verification confirms that removed features (
css_parser,css_ast,css_visit,css_codegen,ecma_minifier,ecma_utils,__visit,__testing_transform) are not used in the main package:
- No CSS processing code in main transform
- Minify calls reference option flags only, not minification logic
- ecma_utils is unused directly (sub-crates that need it maintain their own dependencies)
- No __visit or __testing_transform usage
The architecture is sound: the main package retains core parsing/codegen/transform features while sub-crates declare their own feature requirements independently.
packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml (1)
14-14: Feature reduction is safe—removed features are not used in this crate.The crate only imports and uses the declared features:
ecma_parser(tests),ecma_utils(helper functions),ecma_visit(visitor implementation), andtesting_transform(test macro). No usage ofecma_codegen,ecma_quote, or CSS-related features was found.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging #2086 will not alter performanceComparing Summary
Footnotes
|
Web Explorer#7008 Bundle Size — 379.18KiB (0%).468672e(current) vs 5eacb8a main#7006(baseline) Bundle metrics
|
| Current #7008 |
Baseline #7006 |
|
|---|---|---|
152.57KiB |
152.57KiB |
|
32.53KiB |
32.53KiB |
|
0% |
0% |
|
8 |
8 |
|
8 |
8 |
|
236 |
236 |
|
16 |
16 |
|
3.03% |
3.03% |
|
4 |
4 |
|
0 |
0 |
Bundle size by type no changes
| Current #7008 |
Baseline #7006 |
|
|---|---|---|
249.67KiB |
249.67KiB |
|
96.98KiB |
96.98KiB |
|
32.53KiB |
32.53KiB |
Bundle analysis report Branch colinaaa:chore/simplify-swc-core... Project dashboard
Generated by RelativeCI Documentation Report issue
React Example#6848 Bundle Size — 237.01KiB (0%).468672e(current) vs 5eacb8a main#6846(baseline) Bundle metrics
|
| Current #6848 |
Baseline #6846 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
165 |
165 |
|
65 |
65 |
|
46.48% |
46.48% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #6848 |
Baseline #6846 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
91.25KiB |
91.25KiB |
Bundle analysis report Branch colinaaa:chore/simplify-swc-core... Project dashboard
Generated by RelativeCI Documentation Report issue
Refactored swc_core feature flags across all transform-related crates to remove
unnecessary modules, improving build efficiency and keeping only required features
for building and testing.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
Checklist