Skip to content

chore(deps): simplify swc_core features in Cargo.toml#2086

Merged
gaoachao merged 1 commit intolynx-family:mainfrom
colinaaa:chore/simplify-swc-core-features
Jan 4, 2026
Merged

chore(deps): simplify swc_core features in Cargo.toml#2086
gaoachao merged 1 commit intolynx-family:mainfrom
colinaaa:chore/simplify-swc-core-features

Conversation

@colinaaa
Copy link
Copy Markdown
Collaborator

@colinaaa colinaaa commented Jan 4, 2026

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

  • Chores
    • Updated dependency configurations in the React transform toolchain to streamline enabled features across multiple packages, reducing feature complexity while preserving core transformation capabilities.

✏️ Tip: You can customize this high-level summary in your review settings.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

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.
@colinaaa colinaaa requested a review from gaoachao as a code owner January 4, 2026 09:18
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 4, 2026

⚠️ No Changeset found

Latest commit: 468672e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 4, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
React Transform Main Package
packages/react/transform/Cargo.toml
Reduced swc_core features from 16 to 9: removed ecma_minifier, ecma_utils, css_*, __visit, __testing_transform; added ecma_visit; standardized to testing_transform
Plugin Crates — Minimal Features
packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml, packages/react/transform/crates/swc_plugin_directive_dce/Cargo.toml, packages/react/transform/crates/swc_plugin_shake/Cargo.toml
Stripped to bare essentials: ecma_parser, ecma_visit, testing_transform; removed all CSS, transform, and codegen features
Plugin Crates — Parser & Utils
packages/react/transform/crates/swc_plugin_compat/Cargo.toml, packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml, packages/react/transform/crates/swc_plugin_inject/Cargo.toml, packages/react/transform/crates/swc_plugin_worklet/Cargo.toml
Reduced to: ecma_parser, ecma_utils, ecma_quote, ecma_visit, testing_transform; removed codegen, minifier, CSS, and transform features
Plugin Crates — Specialized Features
packages/react/transform/crates/swc_plugin_list/Cargo.toml, packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
Tailored subsets: removed ecma_minifier, ecma_codegen, CSS features; retained parser, utils, quote, visit, testing
Plugin Text
packages/react/transform/crates/swc_plugin_text/Cargo.toml
Simplified from base + 3 features to: ecma_parser, ecma_visit, testing_transform
Shared Utilities
packages/react/transform/crates/swc_plugins_shared/Cargo.toml
Streamlined to only: ecma_ast, ecma_utils, swc_atoms; removed all parsing, codegen, and transform features
Reactlynx Plugins
packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml, packages/react/transform/swc-plugin-reactlynx/Cargo.toml
Reduced to essential subset: ecma_visit, ecma_plugin_transform; removed parsing, utils, quote, CSS, and codegen features

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

framework:React

Suggested reviewers

  • gaoachao
  • upupming

Poem

🐰 Hopping through the swc deps with glee,

Trimming the fat from features three by three,

CSS and minifiers? Begone, we say!

Leaner builds hop faster every day! 🌱✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: simplifying swc_core features across multiple Cargo.toml files to remove unnecessary dependencies.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5eacb8a and 468672e.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_compat/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/react/transform/crates/swc_plugin_directive_dce/Cargo.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/crates/swc_plugin_inject/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_shake/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/crates/swc_plugin_worklet/Cargo.toml
  • packages/react/transform/crates/swc_plugins_shared/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_inject/Cargo.toml
  • packages/react/transform/crates/swc_plugin_shake/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/crates/swc_plugins_shared/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_directive_dce/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_inject/Cargo.toml
  • packages/react/transform/crates/swc_plugin_shake/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/crates/swc_plugins_shared/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_directive_dce/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_inject/Cargo.toml
  • packages/react/transform/crates/swc_plugin_shake/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/crates/swc_plugins_shared/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_directive_dce/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_shake/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/crates/swc_plugins_shared/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_directive_dce/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_inject/Cargo.toml
  • packages/react/transform/crates/swc_plugin_shake/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/crates/swc_plugins_shared/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/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.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_inject/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_directive_dce/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_inject/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_inject/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_inject/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx-compat/Cargo.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/react/transform/crates/swc_plugin_css_scope/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/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.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/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.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/react/transform/crates/swc_plugin_snapshot/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_dynamic_import/Cargo.toml
  • packages/react/transform/crates/swc_plugins_shared/Cargo.toml
  • packages/react/transform/swc-plugin-reactlynx/Cargo.toml
  • packages/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.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/react/transform/Cargo.toml
  • packages/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.toml
  • packages/react/transform/crates/swc_plugin_list/Cargo.toml
  • packages/react/transform/crates/swc_plugin_text/Cargo.toml
  • packages/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 to swc_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_quote feature required by the quote! 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 required use 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 via ecma_parser and ecma_visit and 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—including common::DUMMY_SP, AST types from ecma::ast, visitor traits from ecma::visit, parser utilities from ecma::parser, and test macros from ecma::transforms::testing—are properly covered by the specified feature set. The removal of the base feature is appropriate; the codebase does not require it.

packages/react/transform/crates/swc_plugin_worklet/Cargo.toml (1)

17-17: Add missing swc_atoms import to extract_ident.rs.

The file uses the quote! macro (lines 51, 53, 163) but lacks the required use swc_core::atoms as swc_atoms; import. Per the swc_core v47 migration, the quote! macro internally references swc_atoms, and omitting this import causes a compiler error. Add the import at the top of the file, matching the pattern already present in gen_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. The ecma_quote feature enables the quote! macro, and swc_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 missing ecma_utils is unfounded.

This crate does not use any utilities from swc_core::ecma::utils. The code relies only on AST types from ecma::ast, the VisitMut trait, and the HANDLER from common::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_helpers which provides functions returning Atom type (e.g., jsx_attr_name, jsx_text_to_str). While swc_plugins_shared enables the swc_atoms feature, dependent crates like swc_plugin_text can successfully use these functions without the swc_atoms feature, confirming that Atom is available through ecma_ast and ecma_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), and testing_transform (test macro). No usage of ecma_codegen, ecma_quote, or CSS-related features was found.

Comment thread packages/react/transform/crates/swc_plugin_compat/Cargo.toml
Comment thread packages/react/transform/crates/swc_plugin_inject/Cargo.toml
Comment thread packages/react/transform/swc-plugin-reactlynx/Cargo.toml
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jan 4, 2026

CodSpeed Performance Report

Merging #2086 will not alter performance

Comparing colinaaa:chore/simplify-swc-core-features (468672e) with main (5eacb8a)

Summary

✅ 63 untouched
⏩ 3 skipped1

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Jan 4, 2026

Web Explorer

#7008 Bundle Size — 379.18KiB (0%).

468672e(current) vs 5eacb8a main#7006(baseline)

Bundle metrics  no changes
                 Current
#7008
     Baseline
#7006
No change  Initial JS 152.57KiB 152.57KiB
No change  Initial CSS 32.53KiB 32.53KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
No change  Modules 236 236
No change  Duplicate Modules 16 16
No change  Duplicate Code 3.03% 3.03%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7008
     Baseline
#7006
No change  JS 249.67KiB 249.67KiB
No change  Other 96.98KiB 96.98KiB
No change  CSS 32.53KiB 32.53KiB

Bundle analysis reportBranch colinaaa:chore/simplify-swc-core...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Jan 4, 2026

React Example

#6848 Bundle Size — 237.01KiB (0%).

468672e(current) vs 5eacb8a main#6846(baseline)

Bundle metrics  no changes
                 Current
#6848
     Baseline
#6846
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 165 165
No change  Duplicate Modules 65 65
No change  Duplicate Code 46.48% 46.48%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#6848
     Baseline
#6846
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.25KiB 91.25KiB

Bundle analysis reportBranch colinaaa:chore/simplify-swc-core...Project dashboard


Generated by RelativeCIDocumentationReport issue

@gaoachao gaoachao merged commit 7b040c5 into lynx-family:main Jan 4, 2026
48 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jan 29, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants