-
Notifications
You must be signed in to change notification settings - Fork 121
feat: add @lynx-js/preact-devtools
to create-rspeedy
#1593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add @lynx-js/preact-devtools
to create-rspeedy
#1593
Conversation
🦋 Changeset detectedLatest commit: 30e52c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughAdds Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
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 unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 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 inindex.tsx
The
index.tsx
file currently importsApp
from./App.jsx
, but onlyApp.tsx
exists inexamples/react/src
. This import will fail unless you haveallowJs
enabled and anApp.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
extensionThe TS template’s
index.tsx
currently imports./App.js
, but there is noApp.js
file—onlyApp.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 entrypointsWe 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 debugMirror 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.
⛔ 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 registryConfirmed 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-safeMove 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/
orout/
).
• Please confirm that after a production build there are no references to@lynx-js/preact-devtools
in your output.
React Example#4521 Bundle Size — 237.06KiB (0%).30e52c0(current) vs 52db511 main#4491(baseline) Bundle metrics
|
Current #4521 |
Baseline #4491 |
|
---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
38.51% |
|
0 |
0 |
|
4 |
4 |
|
158 |
158 |
|
64 |
64 |
|
45.83% |
45.83% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
Current #4521 |
Baseline #4491 |
|
---|---|---|
145.76KiB |
145.76KiB |
|
91.3KiB |
91.3KiB |
Bundle analysis report Branch upupming:feat/preact-devtools-ex... Project dashboard
Generated by RelativeCI Documentation Report issue
Web Explorer#4514 Bundle Size — 366.68KiB (0%).30e52c0(current) vs 52db511 main#4484(baseline) Bundle metrics
|
Current #4514 |
Baseline #4484 |
|
---|---|---|
143.49KiB |
143.49KiB |
|
31.84KiB |
31.84KiB |
|
0% |
0% |
|
7 |
7 |
|
7 |
7 |
|
212 |
212 |
|
17 |
17 |
|
3.89% |
3.89% |
|
4 |
4 |
|
0 |
0 |
Bundle size by type no changes
Current #4514 |
Baseline #4484 |
|
---|---|---|
234.68KiB |
234.68KiB |
|
100.16KiB |
100.16KiB |
|
31.84KiB |
31.84KiB |
Bundle analysis report Branch upupming:feat/preact-devtools-ex... Project dashboard
Generated by RelativeCI Documentation Report issue
CodSpeed Performance ReportMerging #1593 will not alter performanceComparing Summary
|
e6c9c2b
to
a7778b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 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.
⛔ 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-devtoolsnpm 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 version5.0.1-6664329
is published to the public npm registry (verified vianpm view
)—no further action required.
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/package.json
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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,
},
},
}
a7778b4
to
30e52c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.changeset/orange-swans-brake.md (1)
5-5
: Clarify wording and fix grammar in the changeset entryCurrent 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.
⛔ 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: ...evtoolsto
false` 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 MatchesThe verification script has confirmed that the
@lynx-js/react-alias-rsbuild-plugin
entry in.changeset/orange-swans-brake.md
exactly matches thename
field inpackages/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 aliasAliasing '@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 foundI’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.
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>
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Checklist