refactor: move rust source files into web-mainthread-apis dir#1946
refactor: move rust source files into web-mainthread-apis dir#1946PupilTong merged 6 commits intolynx-family:mainfrom
Conversation
🦋 Changeset detectedLatest commit: b83c8cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 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 |
📝 WalkthroughWalkthroughConsolidates and removes the standalone web-style-transformer package, migrates its inline-style parsing and wasm build into web-mainthread-apis, updates workspace/Cargo/package manifests, refactors Rust module paths/visibility, and changes WASM initialization/import timing (dynamic import and top-level await). Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
22723ff to
3cba385
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.changeset/long-baths-prove.md (1)
1-7: Consider clarifying the changeset description.While the changeset correctly documents this as a patch-level change, the description "minor bundle output change" is vague. Consider being more specific about the impact, such as:
- "WASM initialization now happens automatically at module load time"
- "Changed WASM chunk loading from manual to automatic initialization"
This helps users understand if the change might affect their bundle size, load performance, or initialization behavior.
packages/web-platform/web-mainthread-apis/src/style/transformer/transform.rs (1)
1-2: Consider using explicit imports for better clarity.The wildcard imports (
::*) make it less clear where imported items originate. While acceptable for internal reorganization, explicit imports improve code maintainability.Example refactor for line 1:
-use super::super::inline_style_parser::{char_code_definitions::*, parse_inline_style::*}; +use super::super::inline_style_parser::char_code_definitions::{is_white_space}; +use super::super::inline_style_parser::parse_inline_style::{parse_inline_style, Transformer};(Adjust the explicit imports based on actual usage in the file)
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (35)
.changeset/config.json(0 hunks).changeset/long-baths-prove.md(1 hunks)Cargo.toml(2 hunks)packages/web-platform/inline-style-parser/Cargo.toml(0 hunks)packages/web-platform/web-core-server/rslib.config.ts(1 hunks)packages/web-platform/web-core-server/src/createLynxView.ts(1 hunks)packages/web-platform/web-mainthread-apis/Cargo.toml(1 hunks)packages/web-platform/web-mainthread-apis/package.json(1 hunks)packages/web-platform/web-mainthread-apis/scripts/build.js(1 hunks)packages/web-platform/web-mainthread-apis/scripts/wasm-bindgen(1 hunks)packages/web-platform/web-mainthread-apis/src/lib.rs(1 hunks)packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/mod.rs(11 hunks)packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/parse_inline_style.rs(1 hunks)packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/tokenize.rs(2 hunks)packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/utils.rs(1 hunks)packages/web-platform/web-mainthread-apis/src/style/mod.rs(1 hunks)packages/web-platform/web-mainthread-apis/src/style/transformer/rules.rs(1 hunks)packages/web-platform/web-mainthread-apis/src/style/transformer/transform.rs(3 hunks)packages/web-platform/web-mainthread-apis/ts/prepareMainThreadAPIs.ts(0 hunks)packages/web-platform/web-mainthread-apis/ts/utils/tokenizer.ts(1 hunks)packages/web-platform/web-mainthread-apis/turbo.json(1 hunks)packages/web-platform/web-mainthread-apis/wasm/index.js(1 hunks)packages/web-platform/web-mainthread-apis/wasm/legacy.js(1 hunks)packages/web-platform/web-mainthread-apis/wasm/standard.js(1 hunks)packages/web-platform/web-style-transformer/CHANGELOG.md(0 hunks)packages/web-platform/web-style-transformer/LICENSE.txt(0 hunks)packages/web-platform/web-style-transformer/Notice.txt(0 hunks)packages/web-platform/web-style-transformer/README.md(0 hunks)packages/web-platform/web-style-transformer/legacy.js(0 hunks)packages/web-platform/web-style-transformer/package.json(0 hunks)packages/web-platform/web-style-transformer/scripts/build.js(0 hunks)packages/web-platform/web-style-transformer/standard.js(0 hunks)packages/web-platform/web-style-transformer/turbo.json(0 hunks)packages/web-platform/web-tests/package.json(0 hunks)packages/web-platform/web-tests/shell-project/mainthread-test.ts(0 hunks)
💤 Files with no reviewable changes (14)
- packages/web-platform/web-tests/shell-project/mainthread-test.ts
- packages/web-platform/web-style-transformer/Notice.txt
- packages/web-platform/web-tests/package.json
- packages/web-platform/web-style-transformer/standard.js
- .changeset/config.json
- packages/web-platform/web-style-transformer/README.md
- packages/web-platform/web-style-transformer/CHANGELOG.md
- packages/web-platform/web-mainthread-apis/ts/prepareMainThreadAPIs.ts
- packages/web-platform/web-style-transformer/legacy.js
- packages/web-platform/web-style-transformer/scripts/build.js
- packages/web-platform/web-style-transformer/LICENSE.txt
- packages/web-platform/web-style-transformer/package.json
- packages/web-platform/inline-style-parser/Cargo.toml
- packages/web-platform/web-style-transformer/turbo.json
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md
📄 CodeRabbit inference engine (AGENTS.md)
For contributions, generate and commit a Changeset describing your changes
Files:
.changeset/long-baths-prove.md
🧠 Learnings (31)
📓 Common learnings
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.
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1837
File: packages/web-platform/web-mainthread-apis/src/prepareMainThreadAPIs.ts:266-266
Timestamp: 2025-10-10T08:22:12.051Z
Learning: In packages/web-platform/web-mainthread-apis, the handleUpdatedData function returned from prepareMainThreadAPIs is internal-only, used to serve web-core. It does not require public documentation, type exports, or SSR support.
📚 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/web-platform/web-mainthread-apis/src/style/mod.rspackages/web-platform/web-mainthread-apis/ts/utils/tokenizer.tspackages/web-platform/web-mainthread-apis/src/style/inline_style_parser/mod.rspackages/web-platform/web-mainthread-apis/src/style/inline_style_parser/utils.rspackages/web-platform/web-mainthread-apis/src/style/transformer/transform.rspackages/web-platform/web-mainthread-apis/src/lib.rspackages/web-platform/web-mainthread-apis/Cargo.toml
📚 Learning: 2025-10-10T08:22:12.051Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1837
File: packages/web-platform/web-mainthread-apis/src/prepareMainThreadAPIs.ts:266-266
Timestamp: 2025-10-10T08:22:12.051Z
Learning: In packages/web-platform/web-mainthread-apis, the handleUpdatedData function returned from prepareMainThreadAPIs is internal-only, used to serve web-core. It does not require public documentation, type exports, or SSR support.
Applied to files:
packages/web-platform/web-mainthread-apis/scripts/build.jspackages/web-platform/web-mainthread-apis/wasm/legacy.jspackages/web-platform/web-mainthread-apis/wasm/index.jspackages/web-platform/web-mainthread-apis/package.jsonpackages/web-platform/web-mainthread-apis/wasm/standard.jspackages/web-platform/web-core-server/src/createLynxView.tspackages/web-platform/web-mainthread-apis/Cargo.toml
📚 Learning: 2025-09-28T08:46:43.177Z
Learnt from: f0rdream
Repo: lynx-family/lynx-stack PR: 1835
File: packages/react/worklet-runtime/src/workletRuntime.ts:52-55
Timestamp: 2025-09-28T08:46:43.177Z
Learning: The legacy worklet path with `_lepusWorkletHash` in `packages/react/worklet-runtime/src/workletRuntime.ts` is preserved for compatibility with MTS (Mini-app Threading Service) that doesn't support Initial Frame Rendering. This path will not be touched in current implementations.
Applied to files:
packages/web-platform/web-mainthread-apis/wasm/legacy.js
📚 Learning: 2025-07-16T06:25:41.055Z
Learnt from: PupilTong
Repo: lynx-family/lynx-stack PR: 1029
File: packages/web-platform/web-mainthread-apis/src/createMainThreadGlobalThis.ts:214-217
Timestamp: 2025-07-16T06:25:41.055Z
Learning: In the lynx-stack codebase, CSS strings produced by `genCssContent` are considered trusted developer input, so additional sanitization/escaping is not required.
Applied to files:
packages/web-platform/web-mainthread-apis/ts/utils/tokenizer.ts
📚 Learning: 2025-09-29T06:43:40.182Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-29T06:43:40.182Z
Learning: Applies to packages/**/etc/*.api.md : Always commit API extractor output after running `pnpm turbo api-extractor -- --local` (commit updated API report files)
Applied to files:
packages/web-platform/web-mainthread-apis/turbo.json
📚 Learning: 2025-09-10T11:42:36.855Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1714
File: packages/react/transform/Cargo.toml:19-19
Timestamp: 2025-09-10T11:42:36.855Z
Learning: In packages/react/transform/Cargo.toml, the crate uses serde derive macros (#[derive(Serialize, Deserialize)]) in multiple files including src/esbuild.rs and src/swc_plugin_extract_str/mod.rs, so the "derive" feature is required when migrating to workspace dependencies.
Applied to files:
Cargo.tomlpackages/web-platform/web-mainthread-apis/src/style/inline_style_parser/tokenize.rspackages/web-platform/web-mainthread-apis/Cargo.toml
📚 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:
Cargo.tomlpackages/web-platform/web-mainthread-apis/package.json
📚 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:
Cargo.toml
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, private packages (marked with "private": true in package.json) like lynx-js/react-transform don't require meaningful changeset entries even when their public APIs change, since they are not published externally and only affect internal development.
Applied to files:
Cargo.toml.changeset/long-baths-prove.mdpackages/web-platform/web-mainthread-apis/package.jsonpackages/web-platform/web-core-server/src/createLynxView.ts
📚 Learning: 2025-08-06T08:25:15.392Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1447
File: pnpm-workspace.yaml:20-22
Timestamp: 2025-08-06T08:25:15.392Z
Learning: In pnpm, configDependencies in pnpm-workspace.yaml (used for plugins like pnpm/plugin-better-defaults and pnpm/plugin-trusted-deps) do not appear in or modify pnpm-lock.yaml. These plugins are managed separately by pnpm itself, not as part of the workspace's dependency tree. This is different from the internal configDependencies field that can appear within pnpm-lock.yaml for tracking configuration file dependencies.
Applied to files:
Cargo.toml
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, empty changeset files (containing only `---\n\n---`) are used for internal changes that modify src/** files but don't require meaningful release notes, such as private package changes or testing-only modifications. This satisfies CI requirements without generating user-facing release notes.
Applied to files:
.changeset/long-baths-prove.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/long-baths-prove.md
📚 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/long-baths-prove.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/long-baths-prove.md
📚 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:
.changeset/long-baths-prove.mdpackages/web-platform/web-mainthread-apis/package.json
📚 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:
.changeset/long-baths-prove.mdpackages/web-platform/web-mainthread-apis/package.jsonpackages/web-platform/web-core-server/src/createLynxView.ts
📚 Learning: 2025-11-05T03:26:52.546Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1916
File: packages/react/transform/crates/swc_plugin_snapshot/lib.rs:9-9
Timestamp: 2025-11-05T03:26:52.546Z
Learning: In the lynx-stack repository's swc_core v47 upgrade (PR #1916), the import `use swc_core::atoms as swc_atoms;` is required in files that use the `quote!` macro (e.g., packages/react/transform/crates/swc_plugin_snapshot/lib.rs, swc_plugin_list/lib.rs, swc_plugin_worklet/gen_stmt.rs) even though swc_atoms may not appear explicitly in the source code. This is because the quote! macro generates code that internally references swc_atoms. Removing this import causes compiler error: "failed to resolve: use of unresolved module or unlinked crate `swc_atoms`".
Applied to files:
packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/parse_inline_style.rspackages/web-platform/web-mainthread-apis/src/style/inline_style_parser/tokenize.rs
📚 Learning: 2025-08-27T11:36:36.415Z
Learnt from: PupilTong
Repo: lynx-family/lynx-stack PR: 1589
File: packages/web-platform/web-tests/resources/web-core.main-thread.json:4-4
Timestamp: 2025-08-27T11:36:36.415Z
Learning: User PupilTong indicated that packages/web-platform/web-tests/resources/web-core.main-thread.json is considered a binary file, despite it appearing as a JSON text file with readable JavaScript code strings in the content.
Applied to files:
packages/web-platform/web-mainthread-apis/package.json
📚 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/web-platform/web-mainthread-apis/package.json
📚 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/web-platform/web-mainthread-apis/package.json
📚 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/web-platform/web-mainthread-apis/package.json
📚 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/web-platform/web-mainthread-apis/package.json
📚 Learning: 2025-08-20T04:56:36.011Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1566
File: package.json:53-53
Timestamp: 2025-08-20T04:56:36.011Z
Learning: In lynx-stack, Node.js v24 is the preferred/default version for development (established in PR #1557), but Node.js v22 compatibility is maintained specifically for external CI systems like rspack-ecosystem-ci. The engines.node specification uses "^22 || ^24" to support both versions while keeping v24 as the primary target.
Applied to files:
packages/web-platform/web-mainthread-apis/package.json
📚 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/web-platform/web-mainthread-apis/package.json
📚 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/web-platform/web-mainthread-apis/wasm/standard.jspackages/web-platform/web-core-server/src/createLynxView.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/web-platform/web-core-server/src/createLynxView.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/web-platform/web-core-server/src/createLynxView.ts
📚 Learning: 2025-09-25T14:03:25.576Z
Learnt from: PupilTong
Repo: lynx-family/lynx-stack PR: 1834
File: packages/web-platform/web-worker-runtime/src/backgroundThread/background-apis/createChunkLoading.ts:162-171
Timestamp: 2025-09-25T14:03:25.576Z
Learning: In the lynx-stack codebase, for loadScriptAsync implementations in createChunkLoading.ts, unhandled promise rejections from readScriptAsync are intentionally not caught - the caller is expected to handle errors rather than the loadScriptAsync method itself invoking the callback with error messages.
Applied to files:
packages/web-platform/web-core-server/src/createLynxView.ts
📚 Learning: 2025-09-28T07:52:03.601Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1837
File: packages/web-platform/web-worker-runtime/src/backgroundThread/background-apis/createNativeApp.ts:151-154
Timestamp: 2025-09-28T07:52:03.601Z
Learning: There are two different registerUpdateDataHandler functions in the lynx-stack codebase:
1. Main thread version in packages/web-platform/web-worker-runtime/src/mainThread/crossThreadHandlers/registerUpdateDataHandler.ts takes (mainThreadRpc: Rpc, backgroundThreadRpc: Rpc, runtime: MainThreadGlobalThis)
2. Background thread version in packages/web-platform/web-worker-runtime/src/backgroundThread/background-apis/crossThreadHandlers/registerUpdateDataHandler.ts takes only (rpc: Rpc, tt: NativeTTObject)
Applied to files:
packages/web-platform/web-core-server/src/createLynxView.ts
📚 Learning: 2025-09-28T07:52:03.601Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1837
File: packages/web-platform/web-worker-runtime/src/backgroundThread/background-apis/createNativeApp.ts:151-154
Timestamp: 2025-09-28T07:52:03.601Z
Learning: There are two different registerUpdateDataHandler functions in the lynx-stack codebase:
1. Main thread version in packages/web-platform/web-worker-runtime/src/mainThread/crossThreadHandlers/registerUpdateDataHandler.ts takes (mainThreadRpc: Rpc, backgroundThreadRpc: Rpc, runtime: MainThreadGlobalThis)
2. Background thread version in packages/web-platform/web-worker-runtime/src/backgroundThread/background-apis/crossThreadHandlers/registerUpdateDataHandler.ts takes only (rpc: Rpc, tt: any)
Applied to files:
packages/web-platform/web-core-server/src/createLynxView.ts
🧬 Code graph analysis (2)
packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/mod.rs (1)
packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/tokenize.rs (1)
tokenize(253-538)
packages/web-platform/web-mainthread-apis/src/style/transformer/transform.rs (2)
packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/parse_inline_style.rs (1)
parse_inline_style(140-156)packages/web-platform/web-mainthread-apis/src/style/transformer/rules.rs (4)
get_rename_rule_value(221-223)get_replace_rule_value(226-235)get_replace_rule_value(261-265)get_replace_rule_value(278-282)
🪛 GitHub Check: test-typos
packages/web-platform/web-mainthread-apis/scripts/build.js
[warning] 65-65:
"typs" should be "typos".
⏰ 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). (3)
- GitHub Check: build / Build (Windows)
- GitHub Check: build / Build (Ubuntu)
- GitHub Check: test-rust / Test (Ubuntu)
🔇 Additional comments (25)
packages/web-platform/web-core-server/rslib.config.ts (1)
33-35: Confirm impact of enabling RspackfutureDefaultsTurning on
experiments.futureDefaultscan change a set of Rspack defaults at once (tree‑shaking, resolution, output semantics, etc.). For this shared server bundle config, please double‑check that:
- the current
@rslib/core/ Rspack versions fully support this flag,- it doesn’t affect wasm/chunk loading in unintended ways when combined with
output.wasmLoading = 'async-node', and- other packages don’t rely on the previous defaults (or that you’ve aligned configs where needed).
If you’ve already compared bundle output and run the relevant tests, just note that in the PR description for future readers.
packages/web-platform/web-core-server/src/createLynxView.ts (1)
166-168: Dynamic import correctly ensures WASM initialization before use.The change is correct and properly handles WASM initialization timing. The module
@lynx-js/web-mainthread-apishas a top-levelawait initWasm()(wasm/index.js line 23), which means the dynamic import will not resolve until WASM initialization completes. WhenprepareMainThreadAPIsbecomes available on line 169, WASM is guaranteed to be initialized and ready for use bystartMainThreadand functions likeappendStyleElement.This aligns with the PR objective to update WASM loading timing. The trade-off is that the first SSR render incurs the cost of module loading + WASM initialization, but Node.js caches the imported module, so subsequent calls reuse the cached version.
packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/utils.rs (1)
1-1: LGTM! Import path correctly updated for new module structure.The change from
crate::tosuper::aligns with the module restructuring whereinline_style_parseris now nested under thestylemodule.packages/web-platform/web-mainthread-apis/turbo.json (1)
16-17: LGTM! Build output configuration updated for WASM binaries.Adding
binary/**to outputs correctly tracks the new WASM binary artifacts produced by the build workflow.packages/web-platform/web-mainthread-apis/wasm/standard.js (1)
1-1: LGTM! Clean proxy pattern for WASM binary exports.The re-export provides a stable public interface separated from the binary artifact location.
packages/web-platform/web-mainthread-apis/wasm/legacy.js (1)
1-1: LGTM! Consistent pattern for legacy WASM variant.Mirrors the standard.js proxy pattern for browsers without reference types support.
packages/web-platform/web-mainthread-apis/ts/utils/tokenizer.ts (1)
1-1: Import consolidation aligns with package restructuring.The change from
@lynx-js/web-style-transformerto the local../../wasm/index.jscorrectly reflects the consolidation of functionality intoweb-mainthread-apis. Note that this module now indirectly depends on the automatic WASM initialization fromwasm/index.js(see review comment on that file regarding top-level await implications).packages/web-platform/web-mainthread-apis/scripts/wasm-bindgen (1)
6-6: wasm-bindgen version bumped to 0.2.105—minimal patch release, safe to merge.The 0.2.105 release (published 2025-10-27) contains a single noted change: "Fix release workflow dependents", which addresses release infrastructure rather than core functionality. This patch presents no compatibility risks with the existing Rust code.
packages/web-platform/web-mainthread-apis/wasm/index.js (1)
23-23: Add error handling around top-level WASM initialization and consider making it conditional for server environments.The top-level
await initWasm()at line 23 unconditionally initializes WASM for all consumers, which has several implications:
Initialization failures are unrecoverable: If
initWasm()throws, the entire module import fails with no fallback. Whileweb-core-serverwraps the import in try-catch, the source has no error handling.Unnecessary initialization in SSR: Server-side contexts like
web-core-server/src/createLynxView.tsimport this module but don't use WASM functionality (tokenizer/wasm utilities are client-only). The auto-initialization wastes resources on the server.Blocking import for all consumers: Every module that imports from
wasm/index.js(e.g.,tokenizer.ts) now blocks on async WASM initialization, changing the module loading strategy globally.Recommendations:
- Wrap the top-level await in try-catch to prevent silent failures.
- Consider using dynamic lazy initialization or environment detection to skip WASM setup in SSR/Node.js contexts, or export a separate server-safe entry point.
⛔ Skipped due to learnings
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.Learnt from: PupilTong Repo: lynx-family/lynx-stack PR: 1834 File: packages/web-platform/web-worker-runtime/src/backgroundThread/background-apis/createChunkLoading.ts:162-171 Timestamp: 2025-09-25T14:03:25.576Z Learning: In the lynx-stack codebase, for loadScriptAsync implementations in createChunkLoading.ts, unhandled promise rejections from readScriptAsync are intentionally not caught - the caller is expected to handle errors rather than the loadScriptAsync method itself invoking the callback with error messages.packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/tokenize.rs (1)
1-5: LGTM! Import path adjustments are correct.The changes from
crate::tosuper::imports correctly reflect the new module hierarchy whereinline_style_parseris now a submodule understyle.Also applies to: 542-542
Cargo.toml (2)
9-9: Workspace consolidation looks good.The addition of
web-mainthread-apisto workspace members aligns with the PR's objective of consolidating the Rust source files.
32-32: No compatibility concerns identified.Wasm-bindgen 0.2.105 does not introduce any breaking changes, containing only a fix to the release workflow. The version bump from 0.2.104 to 0.2.105 is safe and compatible.
packages/web-platform/web-mainthread-apis/scripts/build.js (1)
28-56: Well-structured WASM build function.The build configuration with conditional release/debug modes and feature flags is well-organized and maintainable.
packages/web-platform/web-mainthread-apis/package.json (3)
19-19: WASM artifact packaging is correctly configured.Adding "wasm" to files and excluding source maps ensures the WASM bindings are distributed correctly.
Also applies to: 21-21
28-30: Build script integration looks good.The build script reference aligns with the new build infrastructure added in scripts/build.js.
33-35: Dependency consolidation is consistent with PR objectives.Removing the
@lynx-js/web-style-transformerdependency and addingwasm-feature-detectaligns with the package consolidation and WASM functionality.packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/mod.rs (2)
13-13: Verify the removal of Debug trait is intentional.The
Debugderive was removed from theDeclarationstruct. This may impact debugging and logging. Confirm this change is intentional and thatDeclarationdoesn't need to be printed for debugging purposes.
505-505: Import path updates are correct.All test module imports have been consistently updated from
crate::tosuper::paths, correctly reflecting the new module structure.Also applies to: 588-588, 605-605, 710-710, 803-805, 859-860, 939-940, 1051-1052, 1100-1102, 1149-1151
packages/web-platform/web-mainthread-apis/src/style/transformer/rules.rs (1)
239-239: LGTM! Test import path correctly updated.The change from
crate::transformer::rules::tosuper::is consistent with the module reorganization.packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/parse_inline_style.rs (1)
1-6: Import path adjustments are correct.The transition from
crate::tosuper::imports properly reflects the new module hierarchy after moving files into thestyle/inline_style_parsersubmodule.packages/web-platform/web-mainthread-apis/src/style/mod.rs (1)
2-3: No issues found. The transformer module is appropriately private and poses no external dependency risk.The verification confirms that the
transformermodule is private and used only internally withinstyle/mod.rs. The two public functions (transform_raw_u16_inline_style_ptrandtransform_raw_u16_inline_style_ptr_parsed) remain accessible to external callers through their#[wasm_bindgen]exports, maintaining the public API while keeping internal implementation details encapsulated.packages/web-platform/web-mainthread-apis/Cargo.toml (1)
2-2: LGTM! Package consolidation aligns with PR objectives.The package rename from "web-style-transformer" to "web-mainthread-apis" correctly reflects the consolidation effort described in the PR.
packages/web-platform/web-mainthread-apis/src/lib.rs (1)
1-1: LGTM! Correct module inclusion.The style module is properly included as part of the crate restructuring.
packages/web-platform/web-mainthread-apis/src/style/transformer/transform.rs (2)
253-256: LGTM! Unconditional append logic is correct.The unconditional append of the remaining source (
&source[transformer.offset..]) correctly handles all cases:
- When
offset == 0(no transformations), the entire source is returned- When
offset > 0, only the untransformed tail is appended- When
offset == source.len(), an empty string is appended (no-op)
267-272: LGTM! Good test coverage for the no-transformation case.The new test verifies that declarations without transformation rules are correctly preserved, complementing the existing transformation tests.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging #1946 will degrade performances by 7.78%Comparing Summary
Benchmarks breakdown
Footnotes
|
Web Explorer#6267 Bundle Size — 377.49KiB (+2.87%).b83c8cd(current) vs 6933c50 main#6264(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch PupilTong:p/hw/rust-refactor-1 Project dashboard Generated by RelativeCI Documentation Report issue |
React Example#6185 Bundle Size — 234.35KiB (0%).2a26a9e(current) vs 0f2da6b main#6177(baseline) Bundle metrics
|
| Current #6185 |
Baseline #6177 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
164 |
164 |
|
66 |
66 |
|
46.71% |
46.71% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #6185 |
Baseline #6177 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
88.59KiB |
88.59KiB |
Bundle analysis report Branch PupilTong:p/hw/rust-refactor-1 Project dashboard
Generated by RelativeCI Documentation Report issue
acede56 to
b83c8cd
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/web-platform/web-mainthread-apis/src/style/transformer/transform.rs (1)
1-1: Consider using explicit imports instead of wildcards.While the wildcard imports work correctly, using explicit imports (e.g.,
use super::super::inline_style_parser::char_code_definitions::{is_white_space, ...}) can improve code clarity and make it easier to track symbol origins.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (34)
.changeset/config.json(0 hunks).changeset/long-baths-prove.md(1 hunks)Cargo.toml(1 hunks)packages/web-platform/inline-style-parser/Cargo.toml(0 hunks)packages/web-platform/web-core-server/rslib.config.ts(1 hunks)packages/web-platform/web-core-server/src/createLynxView.ts(1 hunks)packages/web-platform/web-mainthread-apis/Cargo.toml(1 hunks)packages/web-platform/web-mainthread-apis/package.json(1 hunks)packages/web-platform/web-mainthread-apis/scripts/build.js(1 hunks)packages/web-platform/web-mainthread-apis/src/lib.rs(1 hunks)packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/mod.rs(11 hunks)packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/parse_inline_style.rs(1 hunks)packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/tokenize.rs(2 hunks)packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/utils.rs(1 hunks)packages/web-platform/web-mainthread-apis/src/style/mod.rs(1 hunks)packages/web-platform/web-mainthread-apis/src/style/transformer/rules.rs(1 hunks)packages/web-platform/web-mainthread-apis/src/style/transformer/transform.rs(3 hunks)packages/web-platform/web-mainthread-apis/ts/prepareMainThreadAPIs.ts(0 hunks)packages/web-platform/web-mainthread-apis/ts/utils/tokenizer.ts(1 hunks)packages/web-platform/web-mainthread-apis/turbo.json(1 hunks)packages/web-platform/web-mainthread-apis/wasm/index.js(1 hunks)packages/web-platform/web-mainthread-apis/wasm/legacy.js(1 hunks)packages/web-platform/web-mainthread-apis/wasm/standard.js(1 hunks)packages/web-platform/web-style-transformer/CHANGELOG.md(0 hunks)packages/web-platform/web-style-transformer/LICENSE.txt(0 hunks)packages/web-platform/web-style-transformer/Notice.txt(0 hunks)packages/web-platform/web-style-transformer/README.md(0 hunks)packages/web-platform/web-style-transformer/legacy.js(0 hunks)packages/web-platform/web-style-transformer/package.json(0 hunks)packages/web-platform/web-style-transformer/scripts/build.js(0 hunks)packages/web-platform/web-style-transformer/standard.js(0 hunks)packages/web-platform/web-style-transformer/turbo.json(0 hunks)packages/web-platform/web-tests/package.json(0 hunks)packages/web-platform/web-tests/shell-project/mainthread-test.ts(0 hunks)
💤 Files with no reviewable changes (14)
- packages/web-platform/web-mainthread-apis/ts/prepareMainThreadAPIs.ts
- packages/web-platform/web-style-transformer/LICENSE.txt
- packages/web-platform/web-style-transformer/package.json
- packages/web-platform/web-tests/package.json
- packages/web-platform/web-style-transformer/README.md
- packages/web-platform/web-tests/shell-project/mainthread-test.ts
- packages/web-platform/inline-style-parser/Cargo.toml
- packages/web-platform/web-style-transformer/Notice.txt
- packages/web-platform/web-style-transformer/CHANGELOG.md
- packages/web-platform/web-style-transformer/turbo.json
- packages/web-platform/web-style-transformer/scripts/build.js
- packages/web-platform/web-style-transformer/standard.js
- packages/web-platform/web-style-transformer/legacy.js
- .changeset/config.json
🚧 Files skipped from review as they are similar to previous changes (12)
- packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/utils.rs
- packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/parse_inline_style.rs
- packages/web-platform/web-mainthread-apis/wasm/index.js
- packages/web-platform/web-core-server/rslib.config.ts
- packages/web-platform/web-mainthread-apis/scripts/build.js
- packages/web-platform/web-mainthread-apis/src/style/mod.rs
- packages/web-platform/web-mainthread-apis/wasm/standard.js
- packages/web-platform/web-mainthread-apis/src/lib.rs
- packages/web-platform/web-core-server/src/createLynxView.ts
- Cargo.toml
- packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/mod.rs
- packages/web-platform/web-mainthread-apis/src/style/transformer/rules.rs
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md
📄 CodeRabbit inference engine (AGENTS.md)
For contributions, generate and commit a Changeset describing your changes
Files:
.changeset/long-baths-prove.md
🧠 Learnings (22)
📓 Common learnings
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.
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1714
File: packages/react/transform/Cargo.toml:19-19
Timestamp: 2025-09-10T11:42:36.855Z
Learning: In packages/react/transform/Cargo.toml, the crate uses serde derive macros (#[derive(Serialize, Deserialize)]) in multiple files including src/esbuild.rs and src/swc_plugin_extract_str/mod.rs, so the "derive" feature is required when migrating to workspace dependencies.
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1837
File: packages/web-platform/web-mainthread-apis/src/prepareMainThreadAPIs.ts:266-266
Timestamp: 2025-10-10T08:22:12.051Z
Learning: In packages/web-platform/web-mainthread-apis, the handleUpdatedData function returned from prepareMainThreadAPIs is internal-only, used to serve web-core. It does not require public documentation, type exports, or SSR support.
📚 Learning: 2025-09-29T06:43:40.182Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-29T06:43:40.182Z
Learning: Applies to packages/**/etc/*.api.md : Always commit API extractor output after running `pnpm turbo api-extractor -- --local` (commit updated API report files)
Applied to files:
packages/web-platform/web-mainthread-apis/turbo.json
📚 Learning: 2025-08-27T11:36:36.415Z
Learnt from: PupilTong
Repo: lynx-family/lynx-stack PR: 1589
File: packages/web-platform/web-tests/resources/web-core.main-thread.json:4-4
Timestamp: 2025-08-27T11:36:36.415Z
Learning: User PupilTong indicated that packages/web-platform/web-tests/resources/web-core.main-thread.json is considered a binary file, despite it appearing as a JSON text file with readable JavaScript code strings in the content.
Applied to files:
packages/web-platform/web-mainthread-apis/turbo.jsonpackages/web-platform/web-mainthread-apis/package.json
📚 Learning: 2025-10-10T08:22:12.051Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1837
File: packages/web-platform/web-mainthread-apis/src/prepareMainThreadAPIs.ts:266-266
Timestamp: 2025-10-10T08:22:12.051Z
Learning: In packages/web-platform/web-mainthread-apis, the handleUpdatedData function returned from prepareMainThreadAPIs is internal-only, used to serve web-core. It does not require public documentation, type exports, or SSR support.
Applied to files:
packages/web-platform/web-mainthread-apis/wasm/legacy.jspackages/web-platform/web-mainthread-apis/Cargo.tomlpackages/web-platform/web-mainthread-apis/ts/utils/tokenizer.tspackages/web-platform/web-mainthread-apis/package.json
📚 Learning: 2025-09-28T08:46:43.177Z
Learnt from: f0rdream
Repo: lynx-family/lynx-stack PR: 1835
File: packages/react/worklet-runtime/src/workletRuntime.ts:52-55
Timestamp: 2025-09-28T08:46:43.177Z
Learning: The legacy worklet path with `_lepusWorkletHash` in `packages/react/worklet-runtime/src/workletRuntime.ts` is preserved for compatibility with MTS (Mini-app Threading Service) that doesn't support Initial Frame Rendering. This path will not be touched in current implementations.
Applied to files:
packages/web-platform/web-mainthread-apis/wasm/legacy.js
📚 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/web-platform/web-mainthread-apis/src/style/transformer/transform.rspackages/web-platform/web-mainthread-apis/Cargo.tomlpackages/web-platform/web-mainthread-apis/ts/utils/tokenizer.ts
📚 Learning: 2025-09-10T11:42:36.855Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1714
File: packages/react/transform/Cargo.toml:19-19
Timestamp: 2025-09-10T11:42:36.855Z
Learning: In packages/react/transform/Cargo.toml, the crate uses serde derive macros (#[derive(Serialize, Deserialize)]) in multiple files including src/esbuild.rs and src/swc_plugin_extract_str/mod.rs, so the "derive" feature is required when migrating to workspace dependencies.
Applied to files:
packages/web-platform/web-mainthread-apis/Cargo.tomlpackages/web-platform/web-mainthread-apis/src/style/inline_style_parser/tokenize.rs
📚 Learning: 2025-11-05T03:26:52.546Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1916
File: packages/react/transform/crates/swc_plugin_snapshot/lib.rs:9-9
Timestamp: 2025-11-05T03:26:52.546Z
Learning: In the lynx-stack repository's swc_core v47 upgrade (PR #1916), the import `use swc_core::atoms as swc_atoms;` is required in files that use the `quote!` macro (e.g., packages/react/transform/crates/swc_plugin_snapshot/lib.rs, swc_plugin_list/lib.rs, swc_plugin_worklet/gen_stmt.rs) even though swc_atoms may not appear explicitly in the source code. This is because the quote! macro generates code that internally references swc_atoms. Removing this import causes compiler error: "failed to resolve: use of unresolved module or unlinked crate `swc_atoms`".
Applied to files:
packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/tokenize.rs
📚 Learning: 2025-07-16T06:25:41.055Z
Learnt from: PupilTong
Repo: lynx-family/lynx-stack PR: 1029
File: packages/web-platform/web-mainthread-apis/src/createMainThreadGlobalThis.ts:214-217
Timestamp: 2025-07-16T06:25:41.055Z
Learning: In the lynx-stack codebase, CSS strings produced by `genCssContent` are considered trusted developer input, so additional sanitization/escaping is not required.
Applied to files:
packages/web-platform/web-mainthread-apis/ts/utils/tokenizer.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/web-platform/web-mainthread-apis/package.json.changeset/long-baths-prove.md
📚 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/web-platform/web-mainthread-apis/package.json.changeset/long-baths-prove.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:
packages/web-platform/web-mainthread-apis/package.json
📚 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/web-platform/web-mainthread-apis/package.json
📚 Learning: 2025-08-20T04:56:36.011Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1566
File: package.json:53-53
Timestamp: 2025-08-20T04:56:36.011Z
Learning: In lynx-stack, Node.js v24 is the preferred/default version for development (established in PR #1557), but Node.js v22 compatibility is maintained specifically for external CI systems like rspack-ecosystem-ci. The engines.node specification uses "^22 || ^24" to support both versions while keeping v24 as the primary target.
Applied to files:
packages/web-platform/web-mainthread-apis/package.json
📚 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/web-platform/web-mainthread-apis/package.json
📚 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/web-platform/web-mainthread-apis/package.json.changeset/long-baths-prove.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:
packages/web-platform/web-mainthread-apis/package.json.changeset/long-baths-prove.md
📚 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/web-platform/web-mainthread-apis/package.json
📚 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/long-baths-prove.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/long-baths-prove.md
📚 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/long-baths-prove.md
📚 Learning: 2025-09-29T06:43:40.182Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-29T06:43:40.182Z
Learning: Applies to .changeset/*.md : For contributions, generate and commit a Changeset describing your changes
Applied to files:
.changeset/long-baths-prove.md
🧬 Code graph analysis (1)
packages/web-platform/web-mainthread-apis/src/style/transformer/transform.rs (2)
packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/parse_inline_style.rs (1)
parse_inline_style(140-156)packages/web-platform/web-mainthread-apis/src/style/transformer/rules.rs (4)
get_rename_rule_value(221-223)get_replace_rule_value(226-235)get_replace_rule_value(261-265)get_replace_rule_value(278-282)
🔇 Additional comments (12)
packages/web-platform/web-mainthread-apis/wasm/legacy.js (1)
1-1: Proxy re-export is correct and consistent with wasm/binary layoutThe relative path and
export *proxy pattern look right and align with the describedstandard.jssetup. This keeps the legacy wasm surface centralized without adding extra complexity..changeset/long-baths-prove.md (1)
1-7: Clarify whether this changeset should document a version bump or remain empty.The changeset marks a patch version bump for @lynx-js/web-core-server, but the PR is described as a refactoring with an internal "chore" change. Per learnings from prior PRs (1736, 1330), internal refactoring changes typically use empty changesets to satisfy CI requirements without generating release notes, reserving non-empty changesets for user-facing changes (bugfixes, features).
The description "minor bundle output change" and "timing of loading wasm chunk" is vague and doesn't clearly signal user-facing impact.
If this is an internal-only change: Use an empty changeset (
---\n\n---) to satisfy CI without publishing release notes.If WASM timing changes are user-facing: Expand the description to clarify the user impact and justify the patch bump.
Please confirm whether the WASM loading timing change is user-facing (affecting @lynx-js/web-core-server's public API/behavior) or purely internal optimization.
packages/web-platform/web-mainthread-apis/Cargo.toml (1)
2-2: Dependency migration verified as complete.All concerns have been addressed:
- No serde derive macros are used in the source code, so the "derive" feature is not needed.
- The
inline-style-parserfunctionality has been properly inlined as a local module (packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/), not removed.- All dependencies from the original
web-style-transformercrate have been accounted for; no external references remain.- The consolidation is complete and correct.
packages/web-platform/web-mainthread-apis/turbo.json (1)
15-18: Thebinary/**output configuration is correct and well-founded.Verification confirms that the build process explicitly outputs WASM artifacts to the
binary/directory via thewasm-bindgen --out-dir binarycommand inscripts/build.js. Thepackage.jsonfile intentionally includesbinaryin thefilesarray for npm publishing, and the turbo.json change correctly tracks these outputs for caching. The configuration is complete and consistent with the actual build process.packages/web-platform/web-mainthread-apis/src/style/inline_style_parser/tokenize.rs (2)
1-5: LGTM! Import refactoring is correct.The module import changes correctly reflect the reorganization from crate-level to nested module structure. Using
super::to access parent module items is appropriate for this new hierarchy.
542-542: Test imports updated correctly.The test module's import path has been properly updated to reflect the new module structure.
packages/web-platform/web-mainthread-apis/src/style/transformer/transform.rs (2)
253-256: Logic simplification looks good.The unconditional append of the remaining source is safe and cleaner than a conditional check. When
offsetequalssource.len(), an empty string is appended (harmless), and whenoffsetis less, the remaining untransformed source is correctly preserved.
267-272: Good addition of basic test coverage.This test validates that simple declarations without transformation rules pass through unchanged, providing a useful baseline check for the refactored code.
packages/web-platform/web-mainthread-apis/package.json (3)
31-35: Consolidation of web-style-transformer is complete.The verification confirms:
Dependency successfully removed:
@lynx-js/web-style-transformeris no longer listed in web-mainthread-apis/package.json dependencies.No lingering references: Zero references to web-style-transformer exist across the entire codebase—no imports, no package directories, no configuration references.
Functionality properly integrated: Style transformation logic is now embedded within web-mainthread-apis:
- Rust implementation:
src/style/inline_style_parser/andsrc/style/transformer/modules- TypeScript exports:
ts/style/transformInlineStyle.tsandts/style/cssPropertyMap.tsThe consolidation is complete and the changes are safe to merge.
34-34: I need to clarify the binaryen version discrepancy before finalizing the review.The search confirms a critical issue. The latest version of binaryen is 124.0.0, but the package.json specifies
binaryen@125.0.0, which does not exist on npm. Let me verify Node.js compatibility for these packages:Fix version error: binaryen@125.0.0 does not exist on npm.
The latest version of binaryen available is 124.0.0, not 125.0.0 as specified in the package.json. This version mismatch will cause npm install to fail. Update the package.json to use
"binaryen": "^124.0.0".The other two packages—
wasm-feature-detect@1.8.0andfb-dotslash@0.5.8—are available and current. wasm-feature-detect runs in browsers, Node and Deno, and both packages are compatible with the project's Node.js ≥22 requirement.⛔ Skipped due to learnings
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.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: 1566 File: package.json:53-53 Timestamp: 2025-08-20T04:56:36.011Z Learning: In lynx-stack, Node.js v24 is the preferred/default version for development (established in PR #1557), but Node.js v22 compatibility is maintained specifically for external CI systems like rspack-ecosystem-ci. The engines.node specification uses "^22 || ^24" to support both versions while keeping v24 as the primary target.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.
16-27: No validation issues found—package.json configuration is correct.The files array correctly specifies build artifacts (
dist,binary,wasm) along with source files. These directories don't exist in the source tree because they're generated during the build process, which is the standard pattern for compiled packages. The CI workflow (deploy-main.yml) explicitly runs the build step before publishing via changesets, ensuring the directories exist in the npm tarball. The glob patterns for exclusions (!dist/**/*.js.map,!binary/**/*.js.map) and CSS inclusion (**/*.css) are properly specified.packages/web-platform/web-mainthread-apis/ts/utils/tokenizer.ts (1)
1-1: Critical issue: Missing error handling in wasm module initialization causes runtime crashes.The import path change in
tokenizer.tsis correct, and the wasm module exports match expectations. However, the wasm module has a critical flaw:
wasm/index.jsexports uninitializedlet wasm;and callsawait initWasm();at module scopeinitWasm()has no error handling — if eitherreferenceTypes()or the dynamic import fails,wasmremainsundefinedtokenizer.tscallswasm.transform_raw_u16_inline_style_ptr()without null-checking thewasmobject- This causes runtime crash: "Cannot read property of undefined"
Add try-catch error handling to
packages/web-platform/web-mainthread-apis/wasm/index.jsaround theinitWasm()call and provide a graceful fallback or throw with helpful error message.⛔ Skipped due to learnings
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.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.
There was a problem hiding this comment.
Pull Request Overview
This PR consolidates the WebAssembly-based style transformation functionality by moving Rust source files from the standalone web-style-transformer package into the web-mainthread-apis package. This refactoring simplifies the package structure and improves WASM initialization timing.
Key Changes:
- Removed the standalone
@lynx-js/web-style-transformerpackage and moved its Rust source files intopackages/web-platform/web-mainthread-apis/src/style/ - Updated WASM initialization to use top-level await in the module, ensuring automatic initialization before use
- Changed
web-core-serverto dynamically importprepareMainThreadAPIsto ensure WASM is initialized before execution
Reviewed Changes
Copilot reviewed 34 out of 44 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updated dependencies: moved wasm-feature-detect to web-mainthread-apis, upgraded binaryen to 125.0.0, removed web-style-transformer references |
| packages/web-platform/web-tests/shell-project/mainthread-test.ts | Removed manual WASM initialization as it now happens automatically via top-level await |
| packages/web-platform/web-tests/package.json | Removed web-style-transformer dependency |
| packages/web-platform/web-style-transformer/* | Deleted entire package directory including build scripts, package.json, and documentation |
| packages/web-platform/web-mainthread-apis/wasm/* | Added WASM wrapper files with automatic initialization via top-level await |
| packages/web-platform/web-mainthread-apis/turbo.json | Added binary/** to build outputs |
| packages/web-platform/web-mainthread-apis/ts/utils/tokenizer.ts | Updated import path from @lynx-js/web-style-transformer to local wasm module |
| packages/web-platform/web-mainthread-apis/ts/prepareMainThreadAPIs.ts | Removed manual WASM initialization logic as it now happens automatically |
| packages/web-platform/web-mainthread-apis/src/style/* | Moved and refactored Rust source files with updated module paths |
| packages/web-platform/web-mainthread-apis/scripts/* | Added build scripts and wasm-bindgen dotslash configuration |
| packages/web-platform/web-mainthread-apis/package.json | Added build script, wasm-feature-detect dependency, and devDependencies for WASM tooling |
| packages/web-platform/web-mainthread-apis/Cargo.toml | Renamed package from web-style-transformer to web-mainthread-apis, removed inline-style-parser dependency |
| packages/web-platform/web-core-server/src/createLynxView.ts | Changed to dynamic import of prepareMainThreadAPIs to ensure WASM initialization completes first |
| packages/web-platform/web-core-server/rslib.config.ts | Added futureDefaults experiment for improved module handling |
| packages/web-platform/inline-style-parser/Cargo.toml | Deleted standalone inline-style-parser package |
| Cargo.toml | Updated workspace members to reference web-mainthread-apis instead of separate packages |
| Cargo.lock | Updated package references reflecting the consolidation |
| .changeset/long-baths-prove.md | Documented the WASM loading timing change for web-core-server |
| .changeset/config.json | Removed web-style-transformer from ignored packages list |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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/rspeedy@0.12.0 ### Minor Changes - Bump Rsbuild v1.6.7 with Rspack v1.6.4. ([#1905](#1905)) ### Patch Changes - Updated dependencies \[]: - @lynx-js/web-rsbuild-server-middleware@0.18.4 ## @lynx-js/devtool-mcp-server@0.4.1 ### Patch Changes - Export `registerTool` and `defineTool`. ([#1931](#1931)) - Fix failed to connect to client. ([#1931](#1931)) ## @lynx-js/react@0.114.5 ### Patch Changes - Reduce `__SetInlineStyles` element API call when attrs in spread not changed ([#1919](#1919)) ## @lynx-js/web-constants@0.18.4 ### Patch Changes - Updated dependencies \[]: - @lynx-js/web-worker-rpc@0.18.4 ## @lynx-js/web-core@0.18.4 ### Patch Changes - feat: builtinTagTransformMap add `'x-input-ng': 'x-input'` ([#1932](#1932)) - Updated dependencies \[]: - @lynx-js/web-constants@0.18.4 - @lynx-js/web-mainthread-apis@0.18.4 - @lynx-js/web-worker-rpc@0.18.4 - @lynx-js/web-worker-runtime@0.18.4 ## @lynx-js/web-core-server@0.18.4 ### Patch Changes - feat: builtinTagTransformMap add `'x-input-ng': 'x-input'` ([#1932](#1932)) - chore: minor bundle output change ([#1946](#1946)) the timing of loading wasm chunk has been changed ## @lynx-js/web-elements@0.8.11 ### Patch Changes - fix: when estimated-main-axis-size-px is not set, should use the height of list ([#1930](#1930)) - Updated dependencies \[]: - @lynx-js/web-elements-template@0.8.11 ## @lynx-js/web-explorer@0.0.13 ### Patch Changes - feat: builtinTagTransformMap add `'x-input-ng': 'x-input'` ([#1932](#1932)) ## @lynx-js/web-mainthread-apis@0.18.4 ### Patch Changes - Updated dependencies \[]: - @lynx-js/web-constants@0.18.4 ## @lynx-js/web-worker-runtime@0.18.4 ### Patch Changes - Updated dependencies \[]: - @lynx-js/web-constants@0.18.4 - @lynx-js/web-mainthread-apis@0.18.4 - @lynx-js/web-worker-rpc@0.18.4 ## create-rspeedy@0.12.0 ## upgrade-rspeedy@0.12.0 ## @lynx-js/web-elements-template@0.8.11 ## @lynx-js/web-rsbuild-server-middleware@0.18.4 ## @lynx-js/web-worker-rpc@0.18.4 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
refactor: move rust source files into web-mainthread-apis dir
This is a part of #1937
Summary by CodeRabbit
Chores
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.