Skip to content

Conversation

upupming
Copy link
Collaborator

@upupming upupming commented Aug 25, 2025

Summary by CodeRabbit

  • New Features

    • Preact DevTools enabled by default across React templates (JS, TS, Vitest/RTL variants) and the React example app.
    • DevTools auto-initialize in development for easier component inspection and debugging out of the box.
  • Bug Fixes

    • Prevents Preact DevTools from being resolved in production builds to avoid bundling issues.
  • Chores

    • Added changeset entries for patch releases.

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 August 25, 2025 02:59
Copy link

changeset-bot bot commented Aug 25, 2025

🦋 Changeset detected

Latest commit: 30e52c0

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

This PR includes changesets to release 5 packages
Name Type
create-rspeedy Patch
@lynx-js/react-alias-rsbuild-plugin Patch
@lynx-js/react-rsbuild-plugin Patch
upgrade-rspeedy Patch
@lynx-js/rspeedy 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

Copy link
Contributor

coderabbitai bot commented Aug 25, 2025

📝 Walkthrough

Walkthrough

Adds @lynx-js/preact-devtools by default to React example and several create-rspeedy templates (devDependencies and top-level side-effect imports), adds changesets, and disables resolution of @lynx-js/preact-devtools in production via the react-alias plugin.

Changes

Cohort / File(s) Summary of changes
Changeset metadata
.changeset/dull-needles-read.md, .changeset/orange-swans-brake.md
Adds a patch changeset for create-rspeedy documenting default inclusion of @lynx-js/preact-devtools; adds a changeset describing aliasing @lynx-js/preact-devtools to false for production.
Example app: enable devtools
examples/react/package.json, examples/react/src/index.tsx
Adds devDependency @lynx-js/preact-devtools and inserts a top-level side-effect import import '@lynx-js/preact-devtools'; in the example entrypoint.
Templates: add devtools dep
packages/rspeedy/create-rspeedy/template-react-js/package.json, .../template-react-ts/package.json, .../template-react-vitest-rltl-js/package.json, .../template-react-vitest-rltl-ts/package.json
Adds devDependency @lynx-js/preact-devtools (^5.0.1-6664329) to multiple template package.json files.
Templates: add devtools import
packages/rspeedy/create-rspeedy/template-react-js/src/index.jsx, .../template-react-ts/src/index.tsx, .../template-react-vitest-rltl-js/src/index.jsx, .../template-react-vitest-rltl-ts/src/index.tsx
Inserts top-level side-effect import import '@lynx-js/preact-devtools'; into template entrypoints.
Plugin: production alias disable
packages/rspeedy/plugin-react-alias/src/index.ts
In production aliasing, adds a disable alias for @lynx-js/preact-devtools$ to prevent resolution in production builds (alongside existing debug alias disables).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • colinaaa
  • gaoachao

Poem

A hop and a squeak, I load a small trick,
Devtools stitched in with one tidy flick.
I plant tiny imports, nibble package lines,
Debug lights glow in my burrow of pines.
Hooray for bright widgets — hop, inspect, and fix! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Aug 25, 2025

Codecov Report

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

📢 Thoughts on this report? Let us know!

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

Caution

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

⚠️ Outside diff range comments (3)
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx (1)

5-5: Probable extension mismatch: TS template importing JSX file.

index.tsx importing ./App.jsx will break type-checking and may fail module resolution. It should point to the TSX file.

-import { App } from './App.jsx'
+import { App } from './App.tsx'
examples/react/src/index.tsx (1)

5-5: Update import extension for App in index.tsx

The index.tsx file currently imports App from ./App.jsx, but only App.tsx exists in examples/react/src. This import will fail unless you have allowJs enabled and an App.jsx file present.

• File: examples/react/src/index.tsx, line 5
• Change the import to match the actual file:

-import { App } from './App.jsx';
+import { App } from './App.tsx';
packages/rspeedy/create-rspeedy/template-react-ts/src/index.tsx (1)

5-5: Update App import to use the correct .tsx extension

The TS template’s index.tsx currently imports ./App.js, but there is no App.js file—only App.tsx. This will break the generated project. Please update the import.

• File: packages/rspeedy/create-rspeedy/template-react-ts/src/index.tsx
Line 5

- import { App } from './App.js'
+ import { App } from './App.tsx'
🧹 Nitpick comments (5)
.changeset/dull-needles-read.md (1)

1-6: Changeset looks correct; minor wording improvement for clarity.

Patch bump for "create-rspeedy" is appropriate and the package name matches package.json. Consider clarifying that this adds the devtools to new project templates (and is intended for development only), e.g., “Add '@lynx-js/preact-devtools' to React templates by default (development only).”

packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx (1)

1-1: Guard devtools so it’s excluded from production bundles.

Unconditional side‑effect imports risk shipping devtools code in prod unless the package or bundler guarantees a no‑op/treeshake. Prefer a gated dynamic import to keep production builds lean.

Apply this diff:

-import '@lynx-js/preact-devtools'
+if (process.env.NODE_ENV !== 'production') {
+  // Side-effect import for development only
+  import('@lynx-js/preact-devtools')
+}
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/index.jsx (1)

1-1: Gate devtools import to avoid shipping it in production.

Same rationale as the TS template: prefer a dev-only dynamic import.

-import '@lynx-js/preact-devtools'
+if (process.env.NODE_ENV !== 'production') {
+  import('@lynx-js/preact-devtools')
+}
packages/rspeedy/create-rspeedy/template-react-js/src/index.jsx (1)

1-3: Gate devtools to dev-only and keep it SSR-safe across all React entrypoints

We still have unconditional side-effect imports of @lynx-js/preact-devtools in each template’s entrypoint, which will ship in production bundles and may throw during SSR. Let’s update all React templates to dynamically load devtools only on the client in development, and load it after the debug import so ordering remains clear:

Affected files:

  • packages/rspeedy/create-rspeedy/template-react-js/src/index.jsx
  • packages/rspeedy/create-rspeedy/template-react-ts/src/index.tsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/index.jsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx

Replace at the top of each:

-import '@lynx-js/preact-devtools'
-import '@lynx-js/react/debug'
+import '@lynx-js/react/debug'
+if (process.env.NODE_ENV !== 'production' && typeof window !== 'undefined') {
+  import('@lynx-js/preact-devtools')
+}
 import { root } from '@lynx-js/react'

This ensures:

  • Devtools only load on the client in development (SSR-safe).
  • Production bundles exclude preact-devtools via dead-code elimination.
  • @lynx-js/react/debug initializes before devtools.

After applying, verify:

  • No remaining unconditional imports:
    rg -nP "^\s*import\s+['\"]@lynx-js/preact-devtools['\"]" packages/rspeedy/create-rspeedy/template-*
  • Devtools still connect when running in development.
packages/rspeedy/create-rspeedy/template-react-ts/src/index.tsx (1)

1-3: Devtools should not be bundled in production; gate and order after debug

Mirror the dev-only, SSR-safe pattern here as well.

-import '@lynx-js/preact-devtools'
-import '@lynx-js/react/debug'
+import '@lynx-js/react/debug'
+if (process.env.NODE_ENV !== 'production' && typeof window !== 'undefined') {
+  import('@lynx-js/preact-devtools')
+}
 import { root } from '@lynx-js/react'

Please also ensure scaffolding keeps this consistent across all templates.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 52db511 and e6c9c2b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • .changeset/dull-needles-read.md (1 hunks)
  • examples/react/package.json (1 hunks)
  • examples/react/src/index.tsx (1 hunks)
  • packages/rspeedy/create-rspeedy/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-js/src/index.jsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-ts/src/index.tsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/index.jsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.
📚 Learning: 2025-08-13T11:46:43.737Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#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:

  • examples/react/src/index.tsx
📚 Learning: 2025-08-12T16:09:32.413Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#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:

  • examples/react/src/index.tsx
  • packages/rspeedy/create-rspeedy/template-react-ts/src/index.tsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/index.jsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx
  • packages/rspeedy/create-rspeedy/template-react-js/src/index.jsx
📚 Learning: 2025-07-22T09:23:07.797Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.

Applied to files:

  • .changeset/dull-needles-read.md
📚 Learning: 2025-08-06T13:28:57.182Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#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/create-rspeedy/template-react-vitest-rltl-js/src/index.jsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx
📚 Learning: 2025-08-11T05:59:28.530Z
Learnt from: upupming
PR: lynx-family/lynx-stack#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/create-rspeedy/template-react-vitest-rltl-js/src/index.jsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.

Applied to files:

  • packages/rspeedy/create-rspeedy/package.json
  • examples/react/package.json
📚 Learning: 2025-08-19T11:25:36.127Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#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:

  • examples/react/package.json
📚 Learning: 2025-08-06T13:28:57.182Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#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/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx
⏰ 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: CodeQL Analyze (javascript-typescript)
  • GitHub Check: CodeQL Analyze (actions)
🔇 Additional comments (3)
packages/rspeedy/create-rspeedy/package.json (1)

41-41: Version 5.0.1-6664329 is published in the registry

Confirmed via the npm registry that the @lynx-js/[email protected] release exists and is installable, so no further changes are needed here.

examples/react/package.json (1)

15-15: LGTM: example app includes devtools as a devDependency.

This aligns the example with the templates. Once the version availability is confirmed, this is good to go.

examples/react/src/index.tsx (1)

1-3: Ensure devtools import is dev-only & SSR-safe

Move the debug import above and wrap the devtools entry in a runtime guard so it’s only loaded in client-side development. Then verify with a full build before grepping for “preact-devtools.”

--- examples/react/src/index.tsx
+++ examples/react/src/index.tsx
@@
-import '@lynx-js/preact-devtools';
-import '@lynx-js/react/debug';
+import '@lynx-js/react/debug';
+if (process.env.NODE_ENV !== 'production' && typeof window !== 'undefined') {
+  import('@lynx-js/preact-devtools');
+}
 import { root } from '@lynx-js/react';

Quick verification (run from examples/react):

# install + build
npm install
npm run build   # invokes `rspeedy build`

# confirm devtools isn’t bundled
rg -n "preact-devtools" dist || echo "OK: no devtools found in prod output"

• Adjust the rg target if your build outputs to a different directory (e.g. build/ or out/).
• Please confirm that after a production build there are no references to @lynx-js/preact-devtools in your output.

Copy link

relativeci bot commented Aug 25, 2025

React Example

#4521 Bundle Size — 237.06KiB (0%).

30e52c0(current) vs 52db511 main#4491(baseline)

Bundle metrics  no changes
                 Current
#4521
     Baseline
#4491
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 38.51%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 158 158
No change  Duplicate Modules 64 64
No change  Duplicate Code 45.83% 45.83%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#4521
     Baseline
#4491
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.3KiB 91.3KiB

Bundle analysis reportBranch upupming:feat/preact-devtools-ex...Project dashboard


Generated by RelativeCIDocumentationReport issue

Copy link

relativeci bot commented Aug 25, 2025

Web Explorer

#4514 Bundle Size — 366.68KiB (0%).

30e52c0(current) vs 52db511 main#4484(baseline)

Bundle metrics  no changes
                 Current
#4514
     Baseline
#4484
No change  Initial JS 143.49KiB 143.49KiB
No change  Initial CSS 31.84KiB 31.84KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 7 7
No change  Assets 7 7
No change  Modules 212 212
No change  Duplicate Modules 17 17
No change  Duplicate Code 3.89% 3.89%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#4514
     Baseline
#4484
No change  JS 234.68KiB 234.68KiB
No change  Other 100.16KiB 100.16KiB
No change  CSS 31.84KiB 31.84KiB

Bundle analysis reportBranch upupming:feat/preact-devtools-ex...Project dashboard


Generated by RelativeCIDocumentationReport issue

Copy link

codspeed-hq bot commented Aug 25, 2025

CodSpeed Performance Report

Merging #1593 will not alter performance

Comparing upupming:feat/preact-devtools-example (30e52c0) with main (52db511)

Summary

✅ 10 untouched benchmarks

@upupming upupming force-pushed the feat/preact-devtools-example branch from e6c9c2b to a7778b4 Compare August 25, 2025 05:16
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

🧹 Nitpick comments (4)
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/package.json (2)

15-15: Consider pinning the pre-release exactly to reduce scaffold flakiness.

Using a caret with a pre-release tag (e.g., ^5.0.1-6664329) can drift to newer pre-releases, potentially breaking freshly scaffolded apps. For templates, prefer an exact pin to ensure reproducible installs. Apply similarly across all updated templates/examples.

Here’s the minimal change:

-    "@lynx-js/preact-devtools": "^5.0.1-6664329",
+    "@lynx-js/preact-devtools": "5.0.1-6664329",

15-15: Gate the devtools import behind a dev-only check to avoid accidental prod bloat.

Per the PR notes, corresponding index files add a top-level side-effect import. If the package doesn’t fully tree-shake in production builds, wrap it with a dev guard (apply in the template entrypoints shown in the PR):

Example to apply in src/index.(j|t)sx files:

if (import.meta.env?.DEV) {
  import('@lynx-js/preact-devtools');
}
packages/rspeedy/create-rspeedy/template-react-ts/package.json (1)

14-14: Prefer exact pin for pre-release to keep scaffolds deterministic.

Same rationale as in the JS-vitest template. Consider pinning the version exactly across all updated templates for reproducibility.

-    "@lynx-js/preact-devtools": "^5.0.1-6664329",
+    "@lynx-js/preact-devtools": "5.0.1-6664329",
packages/rspeedy/create-rspeedy/template-react-js/package.json (1)

14-14: Template stability: pin pre-release exactly (optional).

Recommend exact pin here as well for deterministic scaffolds.

-    "@lynx-js/preact-devtools": "^5.0.1-6664329",
+    "@lynx-js/preact-devtools": "5.0.1-6664329",
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e6c9c2b and a7778b4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • .changeset/dull-needles-read.md (1 hunks)
  • examples/react/package.json (1 hunks)
  • examples/react/src/index.tsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-js/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-js/src/index.jsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-ts/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-ts/src/index.tsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/index.jsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/package.json
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • examples/react/package.json
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/index.jsx
  • .changeset/dull-needles-read.md
  • packages/rspeedy/create-rspeedy/template-react-ts/src/index.tsx
  • packages/rspeedy/create-rspeedy/template-react-js/src/index.jsx
  • examples/react/src/index.tsx
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: colinaaa
PR: lynx-family/lynx-stack#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.
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.

Applied to files:

  • packages/rspeedy/create-rspeedy/template-react-js/package.json
📚 Learning: 2025-08-06T13:28:57.182Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#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/create-rspeedy/template-react-js/package.json
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/package.json
📚 Learning: 2025-08-19T11:25:36.127Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#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/create-rspeedy/template-react-js/package.json
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/package.json
  • packages/rspeedy/create-rspeedy/template-react-ts/package.json
📚 Learning: 2025-08-11T05:59:28.530Z
Learnt from: upupming
PR: lynx-family/lynx-stack#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/create-rspeedy/template-react-vitest-rltl-js/package.json
⏰ 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). (4)
  • GitHub Check: build / Build (Windows)
  • GitHub Check: build / Build (Ubuntu)
  • GitHub Check: test-rust / Test (Ubuntu)
  • GitHub Check: CodeQL Analyze (javascript-typescript)
🔇 Additional comments (4)
packages/rspeedy/create-rspeedy/template-react-ts/package.json (2)

14-14: Devtools correctly scoped to devDependencies.

Change aligns with intent and mirrors other templates. No functional risk in production builds if the import is gated or tree-shakes.


14-14: Manual Verification Required: Confirm Peer Dependencies for @lynx-js/preact-devtools

npm view returned no peerDependencies for @lynx-js/preact-devtools@^5.0.1-6664329, which could mean either:

  • The package declares no peerDependencies.
  • The specified prerelease version isn’t published, so metadata couldn’t be fetched.

To ensure downstream apps don’t emit peer‐dependency warnings, please manually verify that the template’s React/Preact versions satisfy any expectations from this package. For example, you might:

  • Inspect the published package.json (e.g., via npm pack @lynx-js/preact-devtools@^5.0.1-6664329 && tar -xOzf *.tgz package/package.json | jq '.peerDependencies').
  • Review the source repository for any peerDependencies in its package.json.

File needing attention:

  • packages/rspeedy/create-rspeedy/template-react-ts/package.json (line 14)
packages/rspeedy/create-rspeedy/template-react-js/package.json (2)

14-14: Consistent addition; matches the other templates.

Devtools placed in devDependencies is correct. Engines and existing deps remain unchanged—good.


14-14: Confirmed public availability of @lynx-js/preact-devtools
The version 5.0.1-6664329 is published to the public npm registry (verified via npm view)—no further action required.

colinaaa
colinaaa previously approved these changes Aug 25, 2025
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.

It seems like the bundle size has been increased.

var __webpack_modules__ = ({
899: (function () {

// Skip setup in test environment because `require` does not work
// in vitest esm env, and `lynx.getDevtool` is not mocked yet
if (false) // dynamic import will generate a new lazy bundle
// which is not what we needed
{}


}),

});

// EXTERNAL MODULE: ../../node_modules/.pnpm/@lynx[email protected]/node_modules/@lynx-js/preact-devtools/lib/react-lynx/index.js
var react_lynx = __webpack_require__(899);

We may add an alias to @lynx-js/preact-devtools to avoid this:

export default {
  resolve: {
    alias: {
      '@lynx-js/preact-devtools': false,
    },
  },
}

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: 0

🧹 Nitpick comments (1)
.changeset/orange-swans-brake.md (1)

5-5: Clarify wording and fix grammar in the changeset entry

Current phrasing is awkward. Recommend tightening and explicitly calling out “production builds”.

Apply this diff:

-Alias `@lynx-js/preact-devtools` to `false` to reduce an import of empty webpack module.
+Alias `@lynx-js/preact-devtools` to `false` in production builds to avoid bundling an empty webpack module.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a7778b4 and 30e52c0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • .changeset/dull-needles-read.md (1 hunks)
  • .changeset/orange-swans-brake.md (1 hunks)
  • examples/react/package.json (1 hunks)
  • examples/react/src/index.tsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-js/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-js/src/index.jsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-ts/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-ts/src/index.tsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/index.jsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx (1 hunks)
  • packages/rspeedy/plugin-react-alias/src/index.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/dull-needles-read.md
🚧 Files skipped from review as they are similar to previous changes (10)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/index.tsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/index.jsx
  • examples/react/package.json
  • packages/rspeedy/create-rspeedy/template-react-js/package.json
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/package.json
  • packages/rspeedy/create-rspeedy/template-react-ts/package.json
  • packages/rspeedy/create-rspeedy/template-react-js/src/index.jsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/package.json
  • examples/react/src/index.tsx
  • packages/rspeedy/create-rspeedy/template-react-ts/src/index.tsx
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: colinaaa
PR: lynx-family/lynx-stack#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.
📚 Learning: 2025-07-22T09:26:16.722Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:26:16.722Z
Learning: In the lynx-family/lynx-stack repository, CI checks require changesets when files matching the pattern "src/**" are modified (as configured in .changeset/config.json). For internal changes that don't need meaningful changesets, an empty changeset file is used to satisfy the CI requirement while not generating any release notes.

Applied to files:

  • .changeset/orange-swans-brake.md
📚 Learning: 2025-07-22T09:23:07.797Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.

Applied to files:

  • .changeset/orange-swans-brake.md
📚 Learning: 2025-08-19T11:25:36.127Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#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/orange-swans-brake.md
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.

Applied to files:

  • .changeset/orange-swans-brake.md
🪛 LanguageTool
.changeset/orange-swans-brake.md

[grammar] ~5-~5: There might be a mistake here.
Context: ...evtoolstofalse` to reduce an import of empty webpack module.

(QB_NEW_EN)


[grammar] ~5-~5: There might be a mistake here.
Context: ...educe an import of empty webpack module.

(QB_NEW_EN)

⏰ 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). (6)
  • GitHub Check: build / Build (Windows)
  • GitHub Check: build / Build (Ubuntu)
  • GitHub Check: test-rust / Test (Ubuntu)
  • GitHub Check: code-style-check
  • GitHub Check: CodeQL Analyze (javascript-typescript)
  • GitHub Check: CodeQL Analyze (actions)
🔇 Additional comments (3)
.changeset/orange-swans-brake.md (1)

2-2: No Action Required: Changeset Package Name Matches

The verification script has confirmed that the @lynx-js/react-alias-rsbuild-plugin entry in .changeset/orange-swans-brake.md exactly matches the name field in packages/rspeedy/plugin-react-alias/package.json. No updates are needed.

packages/rspeedy/plugin-react-alias/src/index.ts (2)

149-152: Good call: disable preact devtools in production with an exact-match alias

Aliasing '@lynx-js/preact-devtools$' to false behind isProd mirrors the existing debug disable, uses an exact-match anchor, and ensures the side-effect import added to templates is dropped from prod bundles.


151-151: Alias covers all usages—no subpath imports found

I’ve scanned every TypeScript/JavaScript file for any imports of @lynx-js/preact-devtools (including potential subpaths) and found only bare‐specifier imports. The exact‐match alias ('@lynx-js/preact-devtools$') therefore correctly catches all usages, and no changes are needed.

@colinaaa colinaaa merged commit e4d116b into lynx-family:main Aug 25, 2025
94 of 98 checks passed
colinaaa pushed a commit that referenced this pull request Aug 26, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @lynx-js/[email protected]

### Patch Changes

- fix `withInitDataInState` got wrong state in 2nd or more times
`defaultDataProcessor`, now it will keep its own state.
([#1478](#1478))

- change `__CreateElement('raw-text')` to `__CreateRawText('')` to avoid
`setNativeProps` not working
([#1570](#1570))

- Fix wrong render result when using expression as `key`.
([#1541](#1541))

See
[#1371](#1371)
for more details.

- fix: `Cannot read properties of undefined` error when using `Suspense`
([#1569](#1569))

- Add `animate` API in Main Thread Script(MTS), so you can now control a
CSS animation imperatively
([#1534](#1534))

    ```ts
    import type { MainThread } from "@lynx-js/types";

    function startAnimation(ele: MainThread.Element) {
      "main thread";
      const animation = ele.animate([{ opacity: 0 }, { opacity: 1 }], {
        duration: 3000,
      });

      // Can also be paused
      // animation.pause()
    }
    ```

## @lynx-js/[email protected]

### Patch Changes

- Support caching Lynx native events when chunk splitting is enabled.
([#1370](#1370))

When `performance.chunkSplit.strategy` is not `all-in-one`, Lynx native
events are cached until the BTS chunk is fully loaded and are replayed
when that chunk is ready. The `firstScreenSyncTiming` flag will no
longer change to `jsReady` anymore.

- Support exporting `Promise` and function in `lynx.config.ts`.
([#1590](#1590))

- Fix missing `publicPath` using when `rspeedy dev --mode production`.
([#1310](#1310))

- Updated dependencies
\[[`aaca8f9`](aaca8f9)]:
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]

## [email protected]

### Patch Changes

- Add `@lynx-js/preact-devtools` by default.
([#1593](#1593))

## @lynx-js/[email protected]

### Patch Changes

- Bump @clack/prompts to v1.0.0-alpha.4
([#1559](#1559))

## @lynx-js/[email protected]

### Patch Changes

- Support using multiple times in different environments.
([#1498](#1498))

- Support caching Lynx native events when chunk splitting is enabled.
([#1370](#1370))

When `performance.chunkSplit.strategy` is not `all-in-one`, Lynx native
events are cached until the BTS chunk is fully loaded and are replayed
when that chunk is ready. The `firstScreenSyncTiming` flag will no
longer change to `jsReady` anymore.

- Updated dependencies
\[[`f0d483c`](f0d483c),
[`e4d116b`](e4d116b),
[`d33c1d2`](d33c1d2)]:
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- Support using multiple times in different environments.
([#1498](#1498))

- Alias `@lynx-js/preact-devtools` to `false` to reduce an import of
empty webpack module.
([#1593](#1593))

## @lynx-js/[email protected]

### Patch Changes

- Support `lynx.createSelectorQuery().select()` and `setNativeProps` API
([#1570](#1570))

## @lynx-js/[email protected]

### Patch Changes

- fix: globalThis is never accessible in MTS
([#1531](#1531))

-   Updated dependencies \[]:
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- fix: fake uidisappear event
([#1539](#1539))

- Updated dependencies
\[[`70863fb`](70863fb)]:
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- fix: globalThis is never accessible in MTS
([#1531](#1531))

- Updated dependencies
\[[`70863fb`](70863fb)]:
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- fix: globalThis is never accessible in MTS
([#1531](#1531))

- Updated dependencies
\[[`70863fb`](70863fb)]:
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- Add new `LynxCacheEventsPlugin`, which will cache Lynx native events
until the BTS chunk is fully loaded, and replay them when the BTS chunk
is ready. ([#1370](#1370))

- Updated dependencies
\[[`aaca8f9`](aaca8f9)]:
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- Updated dependencies
\[[`aaca8f9`](aaca8f9)]:
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- Updated dependencies
\[[`aaca8f9`](aaca8f9)]:
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- Updated dependencies
\[[`aaca8f9`](aaca8f9)]:
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- Always inline the background script that contains rspack runtime
module. ([#1582](#1582))

- Updated dependencies
\[[`aaca8f9`](aaca8f9)]:
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- Add `lynxCacheEventsSetupList` and `lynxCacheEvents` to
RuntimeGlobals. It will be used to cache Lynx native events until the
BTS chunk is fully loaded, and replay them when the BTS chunk is ready.
([#1370](#1370))

## [email protected]



## @lynx-js/[email protected]



## @lynx-js/[email protected]



## @lynx-js/[email protected]

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.

2 participants