Skip to content

feat(pluginReactLynx): support using in rslib#2114

Merged
colinaaa merged 9 commits intomainfrom
feat/support-rslib
Jan 19, 2026
Merged

feat(pluginReactLynx): support using in rslib#2114
colinaaa merged 9 commits intomainfrom
feat/support-rslib

Conversation

@upupming
Copy link
Collaborator

@upupming upupming commented Jan 15, 2026

Summary by CodeRabbit

  • Breaking Changes

    • Removed the public LAYERS export from the public API.
  • New Features

    • React‑Lynx plugin integrated into rslib-aware external build flows with automatic NODE_ENV propagation.
    • Added multiple React runtime externals (JSX/runtime and Lepus variants).
    • Example builds now run a multi-step build sequence.
  • Documentation

    • Simplified example configs and updated README usage for external bundles.
  • Tests

    • Expanded test coverage and added test setup for plugin scenarios.
  • Chores

    • Updated dev dependencies, linter ignores, and CODEOWNERS.

✏️ 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).

@upupming upupming requested a review from colinaaa as a code owner January 15, 2026 13:26
@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

🦋 Changeset detected

Latest commit: 0b2aa0b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@lynx-js/lynx-bundle-rslib-config Minor
@lynx-js/react-rsbuild-plugin Patch
@lynx-js/react-alias-rsbuild-plugin Patch

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 15, 2026

📝 Walkthrough

Walkthrough

This PR removes the exported LAYERS constant and instead reads LAYERS via DSL exposure (Symbol.for('LAYERS')); integrates pluginReactLynx across examples and tests; refactors rspeedy/react plugins (isRspeedy/isRslib branching, NODE_ENV wiring, SWC parser scoping); updates deps, vitest setup, fixtures, and CODEOWNERS/biome ignores.

Changes

Cohort / File(s) Summary
Changesets
​.changeset/bitter-waves-sleep.md, ​.changeset/calm-spies-judge.md
Added two changeset entries documenting patch/minor releases and noting pluginReactLynx usage.
Ownership & Linting
CODEOWNERS, biome.jsonc
Added luhc228 to two CODEOWNERS entries; added Biome ignore for packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/**.
Example configs & exports
examples/react-externals/rslib-comp-lib.config.ts, examples/react-externals/rslib-reactlynx.config.ts, examples/react-externals/package.json, examples/react-externals/external-bundle/ReactLynx.ts, examples/react-externals/lynx.config.js, examples/react-externals/README.md
Replaced LAYERS/toolchain and rspack tooling with pluginReactLynx(); removed in-config defines; added React JSX runtime externals and re-exports; adjusted build scripts and devDependencies.
Public API / docs
packages/rspeedy/lynx-bundle-rslib-config/etc/lynx-bundle-rslib-config.api.md, packages/rspeedy/lynx-bundle-rslib-config/src/index.ts
Removed exported public LAYERS from API/docs and module re-exports.
rslib bundle plugin
packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts
Deleted exported LAYERS; plugin now obtains layer names via api.useExposed<ExposedLayers>(Symbol.for('LAYERS')) and validates presence.
React plugin core
packages/rspeedy/plugin-react/src/entry.ts, packages/rspeedy/plugin-react/src/pluginReactLynx.ts
Restored rspeedy-specific entry orchestration under an isRspeedy branch; added isRslib gating for CSS/NodeEnv behavior; adjusted logging and per-entry/template runtime wiring.
Plugin utilities
packages/rspeedy/plugin-react/src/nodeEnv.ts, packages/rspeedy/plugin-react/src/swc.ts
Added applyNodeEnv to propagate NODE_ENV; moved SWC parser options under tools.swc.jsc.parser and added env-sanitization hook.
Deps & test config
packages/rspeedy/lynx-bundle-rslib-config/package.json, packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
Added devDependencies (@lynx-js/react, @lynx-js/react-rsbuild-plugin, @lynx-js/vitest-setup) and a Vitest setupFiles entry.
Tests & fixtures
packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts, packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
Tests updated to inject pluginReactLynx, use exposed LAYERS, pass cwd, expand assertions and debug artifacts; fixture imports @lynx-js/react, changes abc typing, and adds runtime diagnostic logs.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • colinaaa
  • luhc228

Poem

🐇
I found a symbol, soft and bright,
Layers hidden, now in sight.
NODE_ENV tucked in my sleeve,
SWC parses what I weave.
Hops and builds — the rabbit grins. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding support for using pluginReactLynx in rslib, which is the primary objective reflected throughout the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.

@upupming upupming requested a review from luhc228 January 15, 2026 13:29
@upupming upupming changed the base branch from feat/external-bundle-entry-layers to main January 15, 2026 13:30
luhc228
luhc228 previously approved these changes Jan 16, 2026
colinaaa
colinaaa previously approved these changes Jan 16, 2026
Copy link
Collaborator

@colinaaa colinaaa left a comment

Choose a reason for hiding this comment

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

LGTM! I verified the changes locally:

  1. Tests Passed:

    • @lynx-js/lynx-bundle-rslib-config tests passed, confirming the new pluginReactLynx integration works in Rslib.
    • @lynx-js/react-rsbuild-plugin tests passed, confirming no regressions for standard Rspeedy usage.
  2. Logic:

    • The branching logic using api.context.callerName === 'rspeedy' effectively separates Rspeedy-specific entry handling from the core plugin logic.
    • The SWC config adjustment for Rslib compatibility makes sense.

Great work on unifying the plugin usage!

@upupming upupming dismissed stale reviews from colinaaa and luhc228 via 846ac1f January 16, 2026 05:12
@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 91.45729% with 17 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/rspeedy/plugin-react/src/nodeEnv.ts 11.11% 8 Missing ⚠️
...ndle-rslib-config/src/externalBundleRslibConfig.ts 60.00% 4 Missing ⚠️
packages/rspeedy/plugin-react/src/entry.ts 97.97% 3 Missing ⚠️
...ckages/rspeedy/plugin-react/src/pluginReactLynx.ts 81.81% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts (1)

108-140: Update the JSDoc examples to the new LAYERS source.

The examples still import LAYERS from this package, but that export has been removed. Please update the snippets to the new recommended pattern (e.g., the DSL/plugin-provided layer constants or their string equivalents).

🤖 Fix all issues with AI agents
In @.changeset/bitter-waves-sleep.md:
- Around line 1-3: The changeset currently uses a patch bump for
"@lynx-js/lynx-bundle-rslib-config" but the removal of the LAYERS export is a
breaking API change; update the changeset header to use a minor bump (replace
"patch" with "minor") so the release follows the repo's pre-1.0
minor-as-breaking rule and ensure the changeset message references the LAYERS
export removal for clarity.

In `@packages/rspeedy/plugin-react/src/entry.ts`:
- Around line 84-86: The bug is in getChunks: the Array.isArray branch
mistakenly does imports.push(...imports) which drops the array's entry files;
fix it so array items are added to imports (e.g., iterate the array or spread
the array into imports) so multi-file entries like entry: { foo: ['./a','./b'] }
are preserved; update the Array.isArray branch inside getChunks to push the
actual array elements into the imports array rather than spreading imports into
itself.
🧹 Nitpick comments (1)
packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts (1)

221-250: Consider adding cleanup for vi.stubEnv.

The vi.stubEnv('DEBUG', 'rspeedy') on line 227 is invoked at describe-level during test collection without a corresponding cleanup. This could leak the stubbed environment variable to subsequent test files.

Consider wrapping the stub and build in a beforeAll/afterAll pattern or adding vi.unstubAllEnvs() in an afterAll hook:

♻️ Suggested approach using beforeAll/afterAll
 describe('pluginReactLynx', async () => {
   const fixtureDir = path.join(__dirname, './fixtures/utils-lib')
   const distRoot = path.join(fixtureDir, 'dist')
 
   const bundleId = 'utils-reactlynx'
 
-  vi.stubEnv('DEBUG', 'rspeedy')
+  let rslib: Awaited<ReturnType<typeof createRslib>>
+  let decodedResult: Awaited<ReturnType<typeof decodeTemplate>>
 
   const rslibConfig = defineExternalBundleRslibConfig({
     source: {
       entry: {
         utils: path.join(__dirname, './fixtures/utils-lib/index.ts'),
       },
     },
     id: bundleId,
     output: {
       distPath: {
         root: distRoot,
       },
     },
     plugins: [pluginReactLynx()],
   })
-  const rslib = await createRslib({
-    config: rslibConfig,
-    cwd: __dirname,
+
+  beforeAll(async () => {
+    vi.stubEnv('DEBUG', 'rspeedy')
+    rslib = await createRslib({
+      config: rslibConfig,
+      cwd: __dirname,
+    })
+    await rslib.build()
+    decodedResult = await decodeTemplate(
+      path.join(fixtureDir, 'dist/utils-reactlynx.lynx.bundle'),
+    )
   })
-  await rslib.build()
-  const decodedResult = await decodeTemplate(
-    path.join(fixtureDir, 'dist/utils-reactlynx.lynx.bundle'),
-  )
+
+  afterAll(() => {
+    vi.unstubAllEnvs()
+  })
📜 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 a7a2ad7 and 846ac1f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • .changeset/bitter-waves-sleep.md
  • .changeset/calm-spies-judge.md
  • CODEOWNERS
  • biome.jsonc
  • examples/react-externals/rslib-comp-lib.config.ts
  • examples/react-externals/rslib-reactlynx.config.ts
  • packages/rspeedy/lynx-bundle-rslib-config/etc/lynx-bundle-rslib-config.api.md
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts
  • packages/rspeedy/lynx-bundle-rslib-config/src/index.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/plugin-react/src/entry.ts
  • packages/rspeedy/plugin-react/src/nodeEnv.ts
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • packages/rspeedy/plugin-react/src/swc.ts
💤 Files with no reviewable changes (2)
  • packages/rspeedy/lynx-bundle-rslib-config/etc/lynx-bundle-rslib-config.api.md
  • packages/rspeedy/lynx-bundle-rslib-config/src/index.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use async/await patterns with proper error handling in JavaScript/TypeScript code
Follow linting rules defined in eslint.config.js including React-specific and TypeScript-specific rules
Additional code quality checks must pass according to biome.jsonc configuration

Files:

  • packages/rspeedy/plugin-react/src/nodeEnv.ts
  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • packages/rspeedy/plugin-react/src/swc.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • packages/rspeedy/plugin-react/src/entry.ts
  • examples/react-externals/rslib-reactlynx.config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript with strictest mode configuration as defined in tsconfig.json

Files:

  • packages/rspeedy/plugin-react/src/nodeEnv.ts
  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • packages/rspeedy/plugin-react/src/swc.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • packages/rspeedy/plugin-react/src/entry.ts
  • examples/react-externals/rslib-reactlynx.config.ts
**/*.{js,ts,jsx,tsx,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Code must conform to formatting rules defined in .dprint.jsonc configuration

Files:

  • packages/rspeedy/plugin-react/src/nodeEnv.ts
  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • packages/rspeedy/plugin-react/src/swc.ts
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • packages/rspeedy/plugin-react/src/entry.ts
  • examples/react-externals/rslib-reactlynx.config.ts
**/*.{test,spec}.{ts,tsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

Write tests using vitest framework with proper setup as defined in vitest.config.ts

Files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
🧠 Learnings (39)
📓 Common learnings
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.
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.
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{test,spec}.{ts,tsx,js} : For ReactLynx component testing, use testing-library utilities from `packages/react/testing-library/`
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{tsx,jsx} : JSX in ReactLynx uses custom Rust-based compiler for transforms rather than standard JSX handling
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).
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1523
File: vitest.config.ts:52-72
Timestamp: 2025-08-13T11:36:12.075Z
Learning: The lynx-stack project requires Node.js >=22 as specified in package.json engines, so Node.js compatibility fallbacks for features introduced before v22 are unnecessary.
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1612
File: packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/tsconfig.json:3-13
Timestamp: 2025-08-27T08:10:09.932Z
Learning: In the lynx-family/lynx-stack repository, Rspeedy templates use `lynx-js/rspeedy/client` types via `rspeedy-env.d.ts` instead of `vite/client` types. Rspeedy provides its own client-side environment type definitions and doesn't require direct Vite type references.
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: colinaaa
Repo: lynx-family/lynx-stack PR: 1523
File: vitest.config.ts:5-6
Timestamp: 2025-08-13T11:46:43.737Z
Learning: In the lynx-stack codebase, default imports are consistently used for Node.js built-in modules (e.g., `import os from 'node:os'`, `import fs from 'node:fs'`). The TypeScript configuration supports esModuleInterop and allowSyntheticDefaultImports, making default imports the preferred pattern over namespace imports for Node.js built-ins.
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1453
File: vitest.config.ts:49-61
Timestamp: 2025-08-06T13:28:57.182Z
Learning: In the lynx-family/lynx-stack repository, the file `packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/vitest.config.js` is a template file for scaffolding new Rspeedy projects, not a test configuration that should be included in the main vitest projects array.
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/src/**/*.css : Use custom CSS properties to control linear layout behavior: `--lynx-display: linear`, `--lynx-linear-orientation`, `--lynx-linear-weight`, `--lynx-linear-weight-sum`, and `--lynx-linear-weight-basis`
📚 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:

  • .changeset/calm-spies-judge.md
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • biome.jsonc
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • .changeset/bitter-waves-sleep.md
  • packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • packages/rspeedy/plugin-react/src/entry.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 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:

  • .changeset/calm-spies-judge.md
  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • biome.jsonc
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • .changeset/bitter-waves-sleep.md
📚 Learning: 2025-07-22T09:23:07.797Z
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.

Applied to files:

  • .changeset/calm-spies-judge.md
  • .changeset/bitter-waves-sleep.md
📚 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:

  • .changeset/calm-spies-judge.md
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • .changeset/bitter-waves-sleep.md
  • examples/react-externals/rslib-reactlynx.config.ts
📚 Learning: 2025-07-22T09:26:16.722Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 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/calm-spies-judge.md
  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • biome.jsonc
  • .changeset/bitter-waves-sleep.md
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 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/calm-spies-judge.md
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • .changeset/bitter-waves-sleep.md
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{tsx,jsx} : JSX in ReactLynx uses custom Rust-based compiler for transforms rather than standard JSX handling

Applied to files:

  • .changeset/calm-spies-judge.md
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • CODEOWNERS
  • examples/react-externals/rslib-comp-lib.config.ts
  • biome.jsonc
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 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:

  • .changeset/calm-spies-judge.md
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{test,spec}.{ts,tsx,js} : For ReactLynx component testing, use testing-library utilities from `packages/react/testing-library/`

Applied to files:

  • .changeset/calm-spies-judge.md
  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • CODEOWNERS
  • examples/react-externals/rslib-comp-lib.config.ts
  • biome.jsonc
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 Learning: 2025-08-27T08:10:09.932Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1612
File: packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/tsconfig.json:3-13
Timestamp: 2025-08-27T08:10:09.932Z
Learning: In the lynx-family/lynx-stack repository, Rspeedy templates use `lynx-js/rspeedy/client` types via `rspeedy-env.d.ts` instead of `vite/client` types. Rspeedy provides its own client-side environment type definitions and doesn't require direct Vite type references.

Applied to files:

  • .changeset/calm-spies-judge.md
  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • packages/rspeedy/plugin-react/src/entry.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 Learning: 2025-08-12T16:09:32.413Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1497
File: packages/react/transform/tests/__swc_snapshots__/src/swc_plugin_snapshot/mod.rs/basic_full_static.js:9-10
Timestamp: 2025-08-12T16:09:32.413Z
Learning: In the Lynx stack, functions prefixed with `__` that are called in transformed code may be injected globally by the Lynx Engine at runtime rather than exported from the React runtime package. For example, `__CreateFrame` is injected globally by the Lynx Engine, not exported from lynx-js/react.

Applied to files:

  • .changeset/calm-spies-judge.md
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 Learning: 2025-08-06T13:28:57.182Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1453
File: vitest.config.ts:49-61
Timestamp: 2025-08-06T13:28:57.182Z
Learning: In the lynx-family/lynx-stack repository, the file `packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/vitest.config.js` is a template file for scaffolding new Rspeedy projects, not a test configuration that should be included in the main vitest projects array.

Applied to files:

  • .changeset/calm-spies-judge.md
  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • biome.jsonc
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • packages/rspeedy/plugin-react/src/entry.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 Learning: 2025-08-11T05:57:18.212Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1305
File: packages/testing-library/testing-environment/src/index.ts:255-258
Timestamp: 2025-08-11T05:57:18.212Z
Learning: In the ReactLynx testing environment (`packages/testing-library/testing-environment/src/index.ts`), the dual assignment pattern `target.console.method = console.method = () => {}` is required for rstest compatibility. This is because rstest provides `console` in an IIFE (Immediately Invoked Function Expression), and both the target and global console need to have these methods defined for proper test execution.

Applied to files:

  • .changeset/calm-spies-judge.md
  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js} : Write tests using vitest framework with proper setup as defined in `vitest.config.ts`

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-06T13:28:57.182Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1453
File: vitest.config.ts:49-61
Timestamp: 2025-08-06T13:28:57.182Z
Learning: In the lynx-family/lynx-stack repository, the file `packages/react/testing-library/src/vitest.config.js` is source code for the testing library that gets exported for users, not a test configuration that should be included in the main vitest projects array.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • biome.jsonc
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 Learning: 2025-08-11T05:59:28.530Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1305
File: packages/react/testing-library/src/plugins/vitest.ts:4-6
Timestamp: 2025-08-11T05:59:28.530Z
Learning: In the lynx-family/lynx-stack repository, the `packages/react/testing-library` package does not have `vite` as a direct dependency. It relies on `vitest` being available from the monorepo root and accesses Vite types through re-exports from `vitest/node`. Direct imports from `vite` should not be suggested for this package.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • biome.jsonc
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/tests/**/*.spec.ts : Create a separate spec file for new components (e.g., `tests/x-webview.spec.ts`) instead of adding to the monolithic `web-elements.spec.ts`

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/src/elements/all.ts : Export new components in `src/elements/all.ts` and add export configuration to `package.json` under `exports` for both types and default

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • CODEOWNERS
  • examples/react-externals/rslib-comp-lib.config.ts
  • packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript with strictest mode configuration as defined in `tsconfig.json`

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • packages/rspeedy/plugin-react/src/swc.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/web-platform/**/*.{test,spec}.{ts,tsx} : Web platform E2E tests must use Playwright as configured in test suite

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts
  • CODEOWNERS
  • biome.jsonc
📚 Learning: 2026-01-12T11:23:23.265Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/rspeedy/create-rspeedy/template-common/AGENTS.md:0-0
Timestamp: 2026-01-12T11:23:23.265Z
Learning: Applies to packages/rspeedy/create-rspeedy/template-common/**/*.{js,jsx,ts,tsx} : Write maintainable, performant, and accessible JavaScript code

Applied to files:

  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • CODEOWNERS
  • biome.jsonc
  • packages/rspeedy/plugin-react/src/entry.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Follow linting rules defined in `eslint.config.js` including React-specific and TypeScript-specific rules

Applied to files:

  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • CODEOWNERS
  • biome.jsonc
📚 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/rspeedy/plugin-react/src/pluginReactLynx.ts
  • packages/rspeedy/plugin-react/src/swc.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-27T12:42:01.095Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1616
File: packages/webpack/cache-events-webpack-plugin/test/cases/not-cache-events/lazy-bundle/index.js:3-3
Timestamp: 2025-08-27T12:42:01.095Z
Learning: In webpack, properties like __webpack_require__.lynx_ce are injected during compilation/build time when webpack processes modules and generates bundles, not at runtime when dynamic imports execute. Tests for such properties don't need to wait for dynamic imports to complete.

Applied to files:

  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • packages/rspeedy/plugin-react/src/entry.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 Learning: 2025-08-21T08:46:54.494Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1370
File: packages/webpack/cache-events-webpack-plugin/src/LynxCacheEventsRuntimeModule.ts:23-27
Timestamp: 2025-08-21T08:46:54.494Z
Learning: In Lynx webpack runtime modules, the team prioritizes performance and simplicity over defensive runtime error handling. They prefer relying on compile-time type safety (TypeScript) rather than adding runtime checks like try-catch blocks or type validation, especially for performance-critical code like cache event setup/cleanup functions.

Applied to files:

  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • packages/rspeedy/plugin-react/src/entry.ts
📚 Learning: 2025-08-13T11:46:43.737Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1523
File: vitest.config.ts:5-6
Timestamp: 2025-08-13T11:46:43.737Z
Learning: In the lynx-stack codebase, default imports are consistently used for Node.js built-in modules (e.g., `import os from 'node:os'`, `import fs from 'node:fs'`). The TypeScript configuration supports esModuleInterop and allowSyntheticDefaultImports, making default imports the preferred pattern over namespace imports for Node.js built-ins.

Applied to files:

  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • examples/react-externals/rslib-comp-lib.config.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
  • packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts
  • examples/react-externals/rslib-reactlynx.config.ts
📚 Learning: 2025-11-06T01:19:23.670Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1917
File: packages/mcp-servers/devtool-mcp-server/tsconfig.json:8-8
Timestamp: 2025-11-06T01:19:23.670Z
Learning: The lynx-js/devtool-mcp-server package in lynx-family/lynx-stack targets Node.js >=18.19 (specified in its package.json engines), which is different from the root project's requirement of Node.js ^22 || ^24. The package uses "lib": ["ES2024.Promise"] in its tsconfig.json because it manually includes polyfills for Promise.withResolvers while maintaining compatibility with Node.js v18.

Applied to files:

  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • packages/rspeedy/lynx-bundle-rslib-config/package.json
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-13T11:36:12.075Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1523
File: vitest.config.ts:52-72
Timestamp: 2025-08-13T11:36:12.075Z
Learning: The lynx-stack project requires Node.js >=22 as specified in package.json engines, so Node.js compatibility fallbacks for features introduced before v22 are unnecessary.

Applied to files:

  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/src/elements/**/*.ts : When creating new elements, inherit from `Element` via `Component` decorator and use reactive utilities provided by `element-reactive`

Applied to files:

  • CODEOWNERS
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/web-platform/web-core-wasm/**/* : When working with web-core-wasm package, follow specific instructions in `packages/web-platform/web-core-wasm/AGENTS.md`

Applied to files:

  • CODEOWNERS
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/src/**/*.css : Respect existing polyfills in `src/compat` and check browser support before using bleeding-edge CSS features

Applied to files:

  • CODEOWNERS
📚 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/rspeedy/plugin-react/src/swc.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Additional code quality checks must pass according to `biome.jsonc` configuration

Applied to files:

  • biome.jsonc
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to **/*.{js,ts,jsx,tsx,json,md} : Code must conform to formatting rules defined in `.dprint.jsonc` configuration

Applied to files:

  • biome.jsonc
📚 Learning: 2025-08-11T06:00:04.376Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1305
File: packages/react/testing-library/src/plugins/vitest.ts:59-61
Timestamp: 2025-08-11T06:00:04.376Z
Learning: In the lynx-family/lynx-stack repository, the `testingLibraryPlugin` in `packages/react/testing-library/src/plugins/vitest.ts` intentionally uses `process.exit` when jsdom installation fails, maintaining consistency with the previous implementation from `packages/react/testing-library/src/vitest.config.js`. This behavior should not be changed to use `this.error` despite being a Vite plugin best practice.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-14T12:54:51.143Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1370
File: .changeset/brave-melons-add.md:1-7
Timestamp: 2025-08-14T12:54:51.143Z
Learning: In the lynx-family/lynx-stack repository, packages use 0.x.x versioning where minor version bumps indicate breaking changes (not major bumps), following pre-1.0 semantic versioning conventions.

Applied to files:

  • .changeset/bitter-waves-sleep.md
📚 Learning: 2025-09-18T08:12:56.802Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1770
File: packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts:316-318
Timestamp: 2025-09-18T08:12:56.802Z
Learning: In packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts, the current implementation uses cardStyleElement.textContent += for lazy component styles. While this could theoretically invalidate rule indices by reparsing the stylesheet, Sherry-hue indicated that UIDs don't repeat for the same element, making this approach acceptable for now. A future optimization to use separate style elements per entry was discussed but deferred to a separate PR to keep the current lazy bundle PR focused.

Applied to files:

  • packages/rspeedy/plugin-react/src/entry.ts
📚 Learning: 2025-09-23T08:53:56.927Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1670
File: packages/webpack/css-extract-webpack-plugin/src/loader.ts:244-251
Timestamp: 2025-09-23T08:53:56.927Z
Learning: In webpack CSS extraction plugins, when storing per-module dependencies in a compiler-scoped map like cssModuleId2Deps, the map should not be reset at compilation start because in incremental compilation (watch mode/HMR), only changed files pass through the loader. Unchanged modules need their dependency information to persist between compilations so the plugin can access all modules' dependencies when generating CSS output.

Applied to files:

  • packages/rspeedy/plugin-react/src/entry.ts
🧬 Code graph analysis (3)
packages/rspeedy/plugin-react/src/nodeEnv.ts (1)
packages/rspeedy/core/src/index.ts (1)
  • RsbuildPluginAPI (67-67)
packages/rspeedy/plugin-react/src/pluginReactLynx.ts (2)
packages/rspeedy/plugin-react/src/css.ts (1)
  • applyCSS (18-194)
packages/rspeedy/plugin-react/src/nodeEnv.ts (1)
  • applyNodeEnv (6-18)
examples/react-externals/rslib-reactlynx.config.ts (2)
packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts (1)
  • defineExternalBundleRslibConfig (167-190)
packages/rspeedy/plugin-react/src/pluginReactLynx.ts (1)
  • pluginReactLynx (284-416)
⏰ 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: code-style-check
🔇 Additional comments (27)
biome.jsonc (1)

56-58: Fixture-only ignore looks appropriate.

Narrowly scoped to test fixtures; consistent with existing ignore patterns.

CODEOWNERS (1)

2-3: LGTM! Code ownership expansion looks appropriate.

Adding @luhc228 as an additional maintainer for webpack and rspeedy packages is a straightforward organizational change with correct CODEOWNERS syntax.

packages/rspeedy/lynx-bundle-rslib-config/package.json (1)

43-45: LGTM — devDependencies update looks consistent.

packages/rspeedy/lynx-bundle-rslib-config/test/fixtures/utils-lib/index.ts (3)

1-1: LGTM — runtime side‑effect import is fine for the fixture.


9-22: LGTM — fixture diagnostics are clear.


6-7: Remove the now-unused @ts-expect-error directive.

With the explicit : any type annotation, TypeScript does not produce an error on this line, making the @ts-expect-error directive unused. Remove it.

Remove unused directive
-// `@ts-expect-error`
-export const abc: any = globalThis?.abc || 0
+export const abc: any = globalThis?.abc || 0
examples/react-externals/rslib-comp-lib.config.ts (1)

1-12: LGTM — pluginReactLynx integration is clean.

packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts (2)

304-316: LGTM — ExternalBundleWebpackPlugin options remain consistent.


192-211: The Symbol key match is confirmed. Both pluginReactLynx (provider at line 393) and externalBundleEntryRsbuildPlugin (consumer at line 204) use the identical Symbol.for('LAYERS') key. The plugin enforcement order is correct with enforce: 'post', ensuring the external bundle plugin runs after the React plugin exposes the LAYERS symbol. The hard error for missing LAYERS is an appropriate safeguard.

.changeset/calm-spies-judge.md (1)

1-5: LGTM!

The changeset correctly documents the patch release for @lynx-js/react-rsbuild-plugin with a clear description of the new Rslib support feature.

packages/rspeedy/lynx-bundle-rslib-config/vitest.config.ts (1)

7-7: LGTM!

The addition of the @lynx-js/vitest-setup/setup.ts setup file properly configures the test environment for the new pluginReactLynx integration tests.

packages/rspeedy/plugin-react/src/nodeEnv.ts (1)

6-18: LGTM!

The applyNodeEnv function correctly propagates the NODE_ENV environment variable to rspack's optimization settings for rslib builds. The fallback to false when NODE_ENV is undefined is appropriate as it disables automatic NODE_ENV replacement in that case.

packages/rspeedy/plugin-react/src/pluginReactLynx.ts (3)

32-32: LGTM!

The import for applyNodeEnv is correctly placed with other local module imports.


331-332: LGTM!

The isRslib detection via api.context.callerName and the conditional application of CSS handling (skipped for rslib) and NodeEnv configuration (applied for rslib) are well-structured. This appropriately tailors the plugin behavior based on the build context.

Also applies to: 346-348, 357-359


407-412: LGTM!

The refactored logging using api.logger?.debug is more idiomatic and portable across different build contexts (rspeedy and rslib).

packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts (4)

13-16: LGTM!

The imports are properly structured, bringing in LAYERS and pluginReactLynx from @lynx-js/react-rsbuild-plugin to support the new test scenarios.


21-27: LGTM!

Adding cwd: __dirname to createRslib ensures proper path resolution for the test fixtures.


69-70: LGTM!

Adding pluginReactLynx() to the existing test configurations properly validates that external bundle builds work correctly with the plugin integration.

Also applies to: 99-100, 130-131, 158-159, 196-197


252-316: LGTM!

The test cases for alias resolution and macro handling are thorough. They validate that:

  1. pluginReactLynx correctly configures resolver aliases for React, Preact, and related packages
  2. The defineDCE macros properly differentiate between main-thread (isMainThread:!0) and background (isBackground:!0) contexts
  3. process.env.NODE_ENV is correctly replaced in both bundle sections
packages/rspeedy/plugin-react/src/swc.ts (2)

19-23: Verify TSX parsing is intentionally disabled.

If any .tsx/JSX reaches this SWC config, tsx: false will trigger parse errors. If JSX is always handled by the Rust transform then this is fine; otherwise consider enabling TSX (or making it conditional).

🔧 Possible adjustment if TSX should be supported
               parser: {
                 syntax: 'typescript',
-                tsx: false,
+                tsx: true,
                 decorators: true,
               },
Based on learnings, ReactLynx JSX is handled by the custom Rust compiler, so this may be safe if no TSX flows through SWC.

30-36: Ensure the env cleanup hook doesn’t clobber existing SWC config.

If mergeRsbuildConfig treats tools.swc as a replacement, this hook could override user-supplied SWC options. Please confirm composition behavior; if it overwrites, compose the prior config before deleting env.

♻️ Possible composition pattern
-    return mergeRsbuildConfig(
+    const userSwc = config.tools?.swc
+    return mergeRsbuildConfig(
       {
         tools: {
           swc: {
@@
       config,
       {
         tools: {
-          swc(config) {
+          swc(swcConfig) {
             // Avoid error: "`env` and `jsc.target` cannot be used together"
             // since rslib will set env by default, we need to clear it
-            delete config.env
-            return config
+            const next =
+              typeof userSwc === 'function'
+                ? userSwc(swcConfig)
+                : { ...swcConfig, ...(userSwc ?? {}) }
+            delete next.env
+            return next
           },
         },
       },
     )
packages/rspeedy/plugin-react/src/entry.ts (5)

66-81: Confirm rspeedy exposure is always present.

This branch assumes api.useExposed(Symbol.for('rspeedy.api')) is non-null. Please verify rspeedy always provides it; otherwise consider a clearer error path to avoid a runtime crash on misconfiguration.


124-131: Verify mainThreadChunks expects entry names, not output filenames.

mainThreadChunks is filled with mainThreadName (output path). If ReactWebpackPlugin matches by chunk/entry name, it likely needs mainThreadEntry instead; otherwise the chunk list won’t match. Please confirm plugin expectations.

🔎 If the plugin expects entry names
-        mainThreadChunks.push(mainThreadName)
+        mainThreadChunks.push(mainThreadEntry)

210-246: Re-check inlineScripts behavior in lazy-bundle mode.

When experimental_isLazyBundle is true, inlineScripts is forced to true with a TODO about support. Please confirm this is still intended and doesn’t override user config unexpectedly.


248-253: LGTM: web-only encoding hook.

Scoping WebEncodePlugin to web environments keeps non-web builds clean.


258-261: LGTM: logger fallback preserves warning visibility.

Using api.logger ?? console keeps the warning surfaced even when a logger isn’t wired.

examples/react-externals/rslib-reactlynx.config.ts (1)

1-12: LGTM: example now delegates to pluginReactLynx.

Nice simplification by leaning on defineExternalBundleRslibConfig plus pluginReactLynx defaults. Please verify the example build still succeeds with the new plugin wiring.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Yiming Li <yimingli.cs@gmail.com>
Copy link
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: 1

🤖 Fix all issues with AI agents
In `@packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts`:
- Around line 221-248: The describe callback for "pluginReactLynx" contains
asynchronous setup (creating rslibConfig, calling createRslib, awaiting
rslib.build and decodeTemplate) which Vitest does not await; move all async
setup into a beforeAll block and any teardown into afterAll so the describe
callback is synchronous; specifically, create rslibConfig, call createRslib(),
await rslib.build(), and await decodeTemplate() inside beforeAll, store results
on variables declared in the outer scope of the describe, and reference those
variables in tests, and perform cleanup in afterAll if needed (keep describe,
rslibConfig, createRslib, rslib.build, and decodeTemplate names to locate the
code).
📜 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 846ac1f and 873869d.

📒 Files selected for processing (1)
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use async/await patterns with proper error handling in JavaScript/TypeScript code
Follow linting rules defined in eslint.config.js including React-specific and TypeScript-specific rules
Additional code quality checks must pass according to biome.jsonc configuration

Files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript with strictest mode configuration as defined in tsconfig.json

Files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
**/*.{test,spec}.{ts,tsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

Write tests using vitest framework with proper setup as defined in vitest.config.ts

Files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
**/*.{js,ts,jsx,tsx,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Code must conform to formatting rules defined in .dprint.jsonc configuration

Files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
🧠 Learnings (19)
📓 Common learnings
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.
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.
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{test,spec}.{ts,tsx,js} : For ReactLynx component testing, use testing-library utilities from `packages/react/testing-library/`
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{tsx,jsx} : JSX in ReactLynx uses custom Rust-based compiler for transforms rather than standard JSX handling
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).
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1523
File: vitest.config.ts:52-72
Timestamp: 2025-08-13T11:36:12.075Z
Learning: The lynx-stack project requires Node.js >=22 as specified in package.json engines, so Node.js compatibility fallbacks for features introduced before v22 are unnecessary.
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1453
File: vitest.config.ts:49-61
Timestamp: 2025-08-06T13:28:57.182Z
Learning: In the lynx-family/lynx-stack repository, the file `packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/vitest.config.js` is a template file for scaffolding new Rspeedy projects, not a test configuration that should be included in the main vitest projects array.
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1612
File: packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/tsconfig.json:3-13
Timestamp: 2025-08-27T08:10:09.932Z
Learning: In the lynx-family/lynx-stack repository, Rspeedy templates use `lynx-js/rspeedy/client` types via `rspeedy-env.d.ts` instead of `vite/client` types. Rspeedy provides its own client-side environment type definitions and doesn't require direct Vite type references.
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1453
File: vitest.config.ts:49-61
Timestamp: 2025-08-06T13:28:57.182Z
Learning: In the lynx-family/lynx-stack repository, the file `packages/react/testing-library/src/vitest.config.js` is source code for the testing library that gets exported for users, not a test configuration that should be included in the main vitest projects array.
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{test,spec}.{ts,tsx,js} : For ReactLynx component testing, use testing-library utilities from `packages/react/testing-library/`

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-06T13:28:57.182Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1453
File: vitest.config.ts:49-61
Timestamp: 2025-08-06T13:28:57.182Z
Learning: In the lynx-family/lynx-stack repository, the file `packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/vitest.config.js` is a template file for scaffolding new Rspeedy projects, not a test configuration that should be included in the main vitest projects array.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 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/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-27T12:42:01.095Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1616
File: packages/webpack/cache-events-webpack-plugin/test/cases/not-cache-events/lazy-bundle/index.js:3-3
Timestamp: 2025-08-27T12:42:01.095Z
Learning: In webpack, properties like __webpack_require__.lynx_ce are injected during compilation/build time when webpack processes modules and generates bundles, not at runtime when dynamic imports execute. Tests for such properties don't need to wait for dynamic imports to complete.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-06T13:28:57.182Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1453
File: vitest.config.ts:49-61
Timestamp: 2025-08-06T13:28:57.182Z
Learning: In the lynx-family/lynx-stack repository, the file `packages/react/testing-library/src/vitest.config.js` is source code for the testing library that gets exported for users, not a test configuration that should be included in the main vitest projects array.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{tsx,jsx} : JSX in ReactLynx uses custom Rust-based compiler for transforms rather than standard JSX handling

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 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/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-11T05:59:28.530Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1305
File: packages/react/testing-library/src/plugins/vitest.ts:4-6
Timestamp: 2025-08-11T05:59:28.530Z
Learning: In the lynx-family/lynx-stack repository, the `packages/react/testing-library` package does not have `vite` as a direct dependency. It relies on `vitest` being available from the monorepo root and accesses Vite types through re-exports from `vitest/node`. Direct imports from `vite` should not be suggested for this package.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 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/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 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/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-27T08:10:09.932Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1612
File: packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/tsconfig.json:3-13
Timestamp: 2025-08-27T08:10:09.932Z
Learning: In the lynx-family/lynx-stack repository, Rspeedy templates use `lynx-js/rspeedy/client` types via `rspeedy-env.d.ts` instead of `vite/client` types. Rspeedy provides its own client-side environment type definitions and doesn't require direct Vite type references.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js} : Write tests using vitest framework with proper setup as defined in `vitest.config.ts`

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-11T06:00:04.376Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1305
File: packages/react/testing-library/src/plugins/vitest.ts:59-61
Timestamp: 2025-08-11T06:00:04.376Z
Learning: In the lynx-family/lynx-stack repository, the `testingLibraryPlugin` in `packages/react/testing-library/src/plugins/vitest.ts` intentionally uses `process.exit` when jsdom installation fails, maintaining consistency with the previous implementation from `packages/react/testing-library/src/vitest.config.js`. This behavior should not be changed to use `this.error` despite being a Vite plugin best practice.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-11T05:57:18.212Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1305
File: packages/testing-library/testing-environment/src/index.ts:255-258
Timestamp: 2025-08-11T05:57:18.212Z
Learning: In the ReactLynx testing environment (`packages/testing-library/testing-environment/src/index.ts`), the dual assignment pattern `target.console.method = console.method = () => {}` is required for rstest compatibility. This is because rstest provides `console` in an IIFE (Immediately Invoked Function Expression), and both the target and global console need to have these methods defined for proper test execution.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-11-06T01:19:23.670Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1917
File: packages/mcp-servers/devtool-mcp-server/tsconfig.json:8-8
Timestamp: 2025-11-06T01:19:23.670Z
Learning: The lynx-js/devtool-mcp-server package in lynx-family/lynx-stack targets Node.js >=18.19 (specified in its package.json engines), which is different from the root project's requirement of Node.js ^22 || ^24. The package uses "lib": ["ES2024.Promise"] in its tsconfig.json because it manually includes polyfills for Promise.withResolvers while maintaining compatibility with Node.js v18.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Additional code quality checks must pass according to `biome.jsonc` configuration

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 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/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-12T16:09:32.413Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1497
File: packages/react/transform/tests/__swc_snapshots__/src/swc_plugin_snapshot/mod.rs/basic_full_static.js:9-10
Timestamp: 2025-08-12T16:09:32.413Z
Learning: In the Lynx stack, functions prefixed with `__` that are called in transformed code may be injected globally by the Lynx Engine at runtime rather than exported from the React runtime package. For example, `__CreateFrame` is injected globally by the Lynx Engine, not exported from lynx-js/react.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
🧬 Code graph analysis (1)
packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts (4)
packages/rspeedy/plugin-react/src/pluginReactLynx.ts (1)
  • pluginReactLynx (284-416)
packages/rspeedy/lynx-bundle-rslib-config/src/index.ts (1)
  • defineExternalBundleRslibConfig (11-11)
packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts (1)
  • defineExternalBundleRslibConfig (167-190)
packages/rspeedy/lynx-bundle-rslib-config/test/utils.ts (1)
  • decodeTemplate (12-26)
⏰ 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). (1)
  • GitHub Check: build / Build (Windows)
🔇 Additional comments (3)
packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts (3)

13-16: Plugin imports aligned with new test coverage.


21-25: Setting cwd for createRslib stabilizes fixture-relative paths.


69-70: Consistent pluginReactLynx() injection across bundle scenarios.

Also applies to: 99-100, 130-131, 158-159, 196-197

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@relativeci
Copy link

relativeci bot commented Jan 16, 2026

Web Explorer

#7227 Bundle Size — 383.77KiB (0%).

0b2aa0b(current) vs 82b4052 main#7220(baseline)

Bundle metrics  no changes
                 Current
#7227
     Baseline
#7220
No change  Initial JS 154.03KiB 154.03KiB
No change  Initial CSS 35.05KiB 35.05KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
No change  Modules 238 238
No change  Duplicate Modules 16 16
No change  Duplicate Code 3% 3%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7227
     Baseline
#7220
No change  JS 251.74KiB 251.74KiB
No change  Other 96.98KiB 96.98KiB
No change  CSS 35.05KiB 35.05KiB

Bundle analysis reportBranch feat/support-rslibProject dashboard


Generated by RelativeCIDocumentationReport issue

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 16, 2026

CodSpeed Performance Report

Merging this PR will improve performance by 8.51%

Comparing feat/support-rslib (0b2aa0b) with main (82b4052)

Summary

⚡ 1 improved benchmark
✅ 62 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
basic-performance-small-css 8.2 ms 7.6 ms +8.51%

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.

Copy link
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: 1

🤖 Fix all issues with AI agents
In `@packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts`:
- Line 299: Rename the failing test title string in the unit test call to
correct the typo: change the 'it' spec description "should handle marcos" to
"should handle macros" in the test defined in external-bundle.test.ts (the 'it'
call at the noted location) so the test name reads correctly.
📜 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 9a40769 and 24e5d3a.

📒 Files selected for processing (1)
  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use async/await patterns with proper error handling in JavaScript/TypeScript code
Follow linting rules defined in eslint.config.js including React-specific and TypeScript-specific rules
Additional code quality checks must pass according to biome.jsonc configuration

Files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript with strictest mode configuration as defined in tsconfig.json

Files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
**/*.{test,spec}.{ts,tsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

Write tests using vitest framework with proper setup as defined in vitest.config.ts

Files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
**/*.{js,ts,jsx,tsx,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Code must conform to formatting rules defined in .dprint.jsonc configuration

Files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
🧠 Learnings (23)
📓 Common learnings
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.
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.
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{test,spec}.{ts,tsx,js} : For ReactLynx component testing, use testing-library utilities from `packages/react/testing-library/`
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{tsx,jsx} : JSX in ReactLynx uses custom Rust-based compiler for transforms rather than standard JSX handling
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{test,spec}.{ts,tsx,js} : For ReactLynx component testing, use testing-library utilities from `packages/react/testing-library/`

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-06T13:28:57.182Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1453
File: vitest.config.ts:49-61
Timestamp: 2025-08-06T13:28:57.182Z
Learning: In the lynx-family/lynx-stack repository, the file `packages/react/testing-library/src/vitest.config.js` is source code for the testing library that gets exported for users, not a test configuration that should be included in the main vitest projects array.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-06T13:28:57.182Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1453
File: vitest.config.ts:49-61
Timestamp: 2025-08-06T13:28:57.182Z
Learning: In the lynx-family/lynx-stack repository, the file `packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/vitest.config.js` is a template file for scaffolding new Rspeedy projects, not a test configuration that should be included in the main vitest projects array.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-27T12:42:01.095Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1616
File: packages/webpack/cache-events-webpack-plugin/test/cases/not-cache-events/lazy-bundle/index.js:3-3
Timestamp: 2025-08-27T12:42:01.095Z
Learning: In webpack, properties like __webpack_require__.lynx_ce are injected during compilation/build time when webpack processes modules and generates bundles, not at runtime when dynamic imports execute. Tests for such properties don't need to wait for dynamic imports to complete.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/src/elements/all.ts : Export new components in `src/elements/all.ts` and add export configuration to `package.json` under `exports` for both types and default

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 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/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 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/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/tests/**/*.spec.ts : Use Playwright for all E2E and functional tests with standard assertions like `expect(locator).toBeVisible()`, `expect(locator).toHaveCSS()`, and `diffScreenShot` for screenshot comparisons

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js} : Write tests using vitest framework with proper setup as defined in `vitest.config.ts`

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-11T05:57:18.212Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1305
File: packages/testing-library/testing-environment/src/index.ts:255-258
Timestamp: 2025-08-11T05:57:18.212Z
Learning: In the ReactLynx testing environment (`packages/testing-library/testing-environment/src/index.ts`), the dual assignment pattern `target.console.method = console.method = () => {}` is required for rstest compatibility. This is because rstest provides `console` in an IIFE (Immediately Invoked Function Expression), and both the target and global console need to have these methods defined for proper test execution.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-11T06:00:04.376Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1305
File: packages/react/testing-library/src/plugins/vitest.ts:59-61
Timestamp: 2025-08-11T06:00:04.376Z
Learning: In the lynx-family/lynx-stack repository, the `testingLibraryPlugin` in `packages/react/testing-library/src/plugins/vitest.ts` intentionally uses `process.exit` when jsdom installation fails, maintaining consistency with the previous implementation from `packages/react/testing-library/src/vitest.config.js`. This behavior should not be changed to use `this.error` despite being a Vite plugin best practice.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-11T05:59:28.530Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1305
File: packages/react/testing-library/src/plugins/vitest.ts:4-6
Timestamp: 2025-08-11T05:59:28.530Z
Learning: In the lynx-family/lynx-stack repository, the `packages/react/testing-library` package does not have `vite` as a direct dependency. It relies on `vitest` being available from the monorepo root and accesses Vite types through re-exports from `vitest/node`. Direct imports from `vite` should not be suggested for this package.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/tests/**/*.spec.ts : When a component makes external requests (e.g., via `iframe` or `fetch`), mock them using `page.route` in Playwright tests to ensure tests are hermetic and fast

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/web-platform/**/*.{test,spec}.{ts,tsx} : Web platform E2E tests must use Playwright as configured in test suite

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Use async/await patterns with proper error handling in JavaScript/TypeScript code

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-27T08:10:09.932Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1612
File: packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/tsconfig.json:3-13
Timestamp: 2025-08-27T08:10:09.932Z
Learning: In the lynx-family/lynx-stack repository, Rspeedy templates use `lynx-js/rspeedy/client` types via `rspeedy-env.d.ts` instead of `vite/client` types. Rspeedy provides its own client-side environment type definitions and doesn't require direct Vite type references.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to packages/react/**/*.{tsx,jsx} : JSX in ReactLynx uses custom Rust-based compiler for transforms rather than standard JSX handling

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-11-06T01:19:23.670Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1917
File: packages/mcp-servers/devtool-mcp-server/tsconfig.json:8-8
Timestamp: 2025-11-06T01:19:23.670Z
Learning: The lynx-js/devtool-mcp-server package in lynx-family/lynx-stack targets Node.js >=18.19 (specified in its package.json engines), which is different from the root project's requirement of Node.js ^22 || ^24. The package uses "lib": ["ES2024.Promise"] in its tsconfig.json because it manually includes polyfills for Promise.withResolvers while maintaining compatibility with Node.js v18.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2026-01-14T06:57:33.600Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-14T06:57:33.600Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Additional code quality checks must pass according to `biome.jsonc` configuration

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 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/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 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/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
📚 Learning: 2025-08-12T16:09:32.413Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1497
File: packages/react/transform/tests/__swc_snapshots__/src/swc_plugin_snapshot/mod.rs/basic_full_static.js:9-10
Timestamp: 2025-08-12T16:09:32.413Z
Learning: In the Lynx stack, functions prefixed with `__` that are called in transformed code may be injected globally by the Lynx Engine at runtime rather than exported from the React runtime package. For example, `__CreateFrame` is injected globally by the Lynx Engine, not exported from lynx-js/react.

Applied to files:

  • packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
🧬 Code graph analysis (1)
packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts (3)
packages/rspeedy/plugin-react/src/pluginReactLynx.ts (1)
  • pluginReactLynx (284-416)
packages/rspeedy/lynx-bundle-rslib-config/test/utils.ts (1)
  • decodeTemplate (12-26)
packages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.ts (1)
  • defineExternalBundleRslibConfig (167-190)
🔇 Additional comments (6)
packages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts (6)

11-27: LGTM!

The import additions (beforeAll, afterAll, LAYERS, pluginReactLynx) properly support the new test structure. Adding cwd: __dirname to the build helper ensures consistent working directory context across test runs.


56-81: LGTM!

Adding pluginReactLynx() to the test configurations and using .sort() on line 77 ensures deterministic assertions regardless of key ordering. The pattern is consistently applied across all external bundle tests.


183-198: LGTM!

The pluginReactLynx() integration in the debug mode artifact tests follows the same pattern as other tests, and the per-test environment stub/unstub approach correctly isolates test state.


221-259: LGTM!

The test suite correctly uses beforeAll/afterAll for async setup and cleanup, addressing the previous review feedback. The definite assignment assertions (let rslib!, let decodedResult!) are appropriate here since beforeAll guarantees initialization before any test runs.


261-297: LGTM!

The alias test properly validates the plugin's resolve alias configuration. The inline snapshot with <WORKSPACE> and <PNPM_INNER> placeholders ensures portability across different development environments.


300-325: LGTM!

The macro assertions comprehensively verify:

  • Thread-specific flags (isMainThread, isLepus, isBackground) are correctly set per bundle
  • Environment flags (isDev, isProfile) are consistent across both threads
  • process.env.NODE_ENV is properly replaced with "test"

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

….test.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Yiming Li <yimingli.cs@gmail.com>
@upupming upupming enabled auto-merge (squash) January 16, 2026 11:08
@upupming upupming requested review from colinaaa and luhc228 January 16, 2026 11:08
@upupming upupming force-pushed the feat/support-rslib branch 2 times, most recently from fbbb578 to 1b26ea6 Compare January 19, 2026 05:15
@colinaaa colinaaa disabled auto-merge January 19, 2026 07:06
@colinaaa colinaaa merged commit 51d6b26 into main Jan 19, 2026
45 of 47 checks passed
@colinaaa colinaaa deleted the feat/support-rslib branch January 19, 2026 07:06
colinaaa pushed a commit that referenced this pull request Jan 25, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @lynx-js/react@0.116.0

### Minor Changes

- **BREAKING CHANGE**: Bump Preact from
[10.24.0](preactjs/preact@1807173)
to
[10.28.0](preactjs/preact@f7693b7),
see diffs at [hzy/preact#6](hzy/preact#6).
([#2042](#2042))

### Patch Changes

- Add safety checks for compilation macros to prevent runtime errors
when they are undefined.
([#2110](#2110))

Replaces direct usage of `__PROFILE__`, `__MAIN_THREAD__`,
`__BACKGROUND__` with `typeof` checks.

This improves robustness by checking variable existence before access,
preventing runtime errors in environments where compilation macros are
not defined.

## @lynx-js/lynx-bundle-rslib-config@0.2.0

### Minor Changes

- Use `LAYERS` exposed by DSL plugins
([#2114](#2114))

## @lynx-js/gesture-runtime@2.1.2

### Patch Changes

- Fix an issue that `NativeGesture` does not get correct types in
callback ([#2130](#2130))

## @lynx-js/rspeedy@0.13.1

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-rsbuild-server-middleware@0.19.6

## @lynx-js/react-rsbuild-plugin@0.12.6

### Patch Changes

- Support using `pluginReactLynx` in Rslib.
([#2114](#2114))

- Updated dependencies
\[[`4cd7182`](4cd7182)]:
    -   @lynx-js/template-webpack-plugin@0.10.2
    -   @lynx-js/react-alias-rsbuild-plugin@0.12.6
    -   @lynx-js/use-sync-external-store@1.5.0
    -   @lynx-js/react-refresh-webpack-plugin@0.3.4
    -   @lynx-js/react-webpack-plugin@0.7.3
    -   @lynx-js/css-extract-webpack-plugin@0.7.0

## upgrade-rspeedy@0.13.1

### Patch Changes

- Fix the issue `rslib-runtime.js` was not published in dist folder.
([#2122](#2122))

## @lynx-js/testing-environment@0.1.10

### Patch Changes

- Fix the error "lynxTestingEnv is not defined"
([#2118](#2118))

## @lynx-js/web-constants@0.19.6

### Patch Changes

- feat: add main-thread API: \_\_QuerySelector
([#2115](#2115))

- fix: when a list-item is deleted from list, the deleted list-item is
still showed incorrectly.
([#1092](#1092))

This is because the `enqueueComponent` method does not delete the node
from the Element Tree. It is only to maintain the display node on RL,
and lynx web needs to delete the dom additionally.

- feat: support main thread invoke ui method
([#2104](#2104))

- feat: support lynx.reload()
([#2127](#2127))

- Updated dependencies
\[[`f7133c1`](f7133c1)]:
    -   @lynx-js/web-worker-rpc@0.19.6

## @lynx-js/web-core@0.19.6

### Patch Changes

- fix: avoid crash on CPUs that do not support SIMD
([#2133](#2133))

- feat: support lynx.reload()
([#2127](#2127))

- Updated dependencies
\[[`179f984`](179f984),
[`f7133c1`](f7133c1),
[`6c2b51a`](6c2b51a),
[`556fe9f`](556fe9f),
[`5b589ab`](5b589ab)]:
    -   @lynx-js/web-constants@0.19.6
    -   @lynx-js/web-mainthread-apis@0.19.6
    -   @lynx-js/web-worker-rpc@0.19.6
    -   @lynx-js/web-worker-runtime@0.19.6

## @lynx-js/web-core-wasm@0.0.1

### Patch Changes

- Updated dependencies
\[[`f7133c1`](f7133c1)]:
    -   @lynx-js/web-worker-rpc@0.19.6

## @lynx-js/web-mainthread-apis@0.19.6

### Patch Changes

- feat: add main-thread API: \_\_QuerySelector
([#2115](#2115))

- fix: when a list-item is deleted from list, the deleted list-item is
still showed incorrectly.
([#1092](#1092))

This is because the `enqueueComponent` method does not delete the node
from the Element Tree. It is only to maintain the display node on RL,
and lynx web needs to delete the dom additionally.

- feat: support main thread invoke ui method
([#2104](#2104))

- fix: mts && bts events can be binded both
([#2121](#2121))

- Updated dependencies
\[[`179f984`](179f984),
[`f7133c1`](f7133c1),
[`6c2b51a`](6c2b51a),
[`5b589ab`](5b589ab)]:
    -   @lynx-js/web-constants@0.19.6

## @lynx-js/web-worker-rpc@0.19.6

### Patch Changes

- fix: when a list-item is deleted from list, the deleted list-item is
still showed incorrectly.
([#1092](#1092))

This is because the `enqueueComponent` method does not delete the node
from the Element Tree. It is only to maintain the display node on RL,
and lynx web needs to delete the dom additionally.

## @lynx-js/web-worker-runtime@0.19.6

### Patch Changes

- feat: support lynx.reload()
([#2127](#2127))

- Updated dependencies
\[[`179f984`](179f984),
[`f7133c1`](f7133c1),
[`6c2b51a`](6c2b51a),
[`556fe9f`](556fe9f),
[`5b589ab`](5b589ab)]:
    -   @lynx-js/web-constants@0.19.6
    -   @lynx-js/web-mainthread-apis@0.19.6
    -   @lynx-js/web-worker-rpc@0.19.6

## @lynx-js/template-webpack-plugin@0.10.2

### Patch Changes

- Polyfill `lynx.requireModuleAsync` to allow cache same parallel
requests. ([#2108](#2108))

## create-rspeedy@0.13.1



## @lynx-js/react-alias-rsbuild-plugin@0.12.6



## @lynx-js/web-core-server@0.19.6



## @lynx-js/web-rsbuild-server-middleware@0.19.6

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants