refactor: support aliased and member runtime import shake#2437
Conversation
🦋 Changeset detectedLatest commit: 5dd3785 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (16)
✅ Files skipped from review due to trivial changes (9)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughRecords runtime import bindings per-local-identifier and expands the shake transform's call-matching to handle aliased named imports and member calls from default/namespace runtime imports; adds/updates SWC snapshot and webpack tests accordingly. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/react/transform/crates/swc_plugin_shake/lib.rs`:
- Around line 774-783: The test should_keep_use_effect_call_from_custom_runtime
contains a typo in the import specifier ("@lynx-js/custon-react-runtime");
update the import line inside that test's source string to
"@lynx-js/custom-react-runtime" so the package name matches the test name and
intent, i.e., fix the import specifier in the test string where useEffect is
imported.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 98def1e1-da8a-4ccd-b53d-9b195c5368a5
📒 Files selected for processing (7)
.changeset/fair-crews-lie.mdpackages/react/transform/crates/swc_plugin_shake/lib.rspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_keep_use_effect_call_from_custom_runtime.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_aliased_use_effect_call.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_aliased_use_effect_param.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_default_and_namespace_runtime_import_calls.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_default_and_namespace_runtime_import_params.js
Merging this PR will degrade performance by 26.94%
Performance Changes
Comparing Footnotes
|
React MTF Example#279 Bundle Size — 206.07KiB (+0.01%).5dd3785(current) vs 59d11b2 main#278(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch p/refactor-shake Project dashboard Generated by RelativeCI Documentation Report issue |
React Example#7146 Bundle Size — 236.82KiB (+0.01%).5dd3785(current) vs 59d11b2 main#7145(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch p/refactor-shake Project dashboard Generated by RelativeCI Documentation Report issue |
Web Explorer#8721 Bundle Size — 730.24KiB (0%).5dd3785(current) vs 59d11b2 main#8720(baseline) Bundle metrics
Bundle size by type
|
| Current #8721 |
Baseline #8720 |
|
|---|---|---|
385.55KiB |
385.55KiB |
|
342.53KiB |
342.53KiB |
|
2.16KiB |
2.16KiB |
Bundle analysis report Branch p/refactor-shake Project dashboard
Generated by RelativeCI Documentation Report issue
React External#265 Bundle Size — 590.13KiB (-0.08%).5dd3785(current) vs 59d11b2 main#264(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch p/refactor-shake Project dashboard Generated by RelativeCI Documentation Report issue |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03e44463d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
♻️ Duplicate comments (1)
packages/react/transform/crates/swc_plugin_shake/lib.rs (1)
774-776:⚠️ Potential issue | 🟡 MinorFix the package name typo in the custom-runtime keep-case.
@lynx-js/custon-react-runtimeis confusing here and does not match the test name.Proposed fix
- import { useEffect } from "@lynx-js/custon-react-runtime"; + import { useEffect } from "@lynx-js/custom-react-runtime";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/react/transform/crates/swc_plugin_shake/lib.rs` around lines 774 - 776, The import string in the test named should_keep_use_effect_call_from_custom_runtime contains a typo: change the package name literal "@lynx-js/custon-react-runtime" to "@lynx-js/custom-react-runtime" so it matches the test name and intended custom runtime; update the import line within the test (the string in the r#"... import { useEffect } from ... "... block) to use the corrected package name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@packages/react/transform/crates/swc_plugin_shake/lib.rs`:
- Around line 774-776: The import string in the test named
should_keep_use_effect_call_from_custom_runtime contains a typo: change the
package name literal "@lynx-js/custon-react-runtime" to
"@lynx-js/custom-react-runtime" so it matches the test name and intended custom
runtime; update the import line within the test (the string in the r#"... import
{ useEffect } from ... "... block) to use the corrected package name.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2d819764-e973-4383-9582-6fc02b1b63d7
📒 Files selected for processing (12)
.changeset/fair-crews-lie.mdpackages/react/transform/crates/swc_plugin_shake/lib.rspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_keep_use_effect_call_from_custom_runtime.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_aliased_use_effect_call.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_aliased_use_effect_param.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_default_and_namespace_runtime_import_calls.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_default_and_namespace_runtime_import_params.jspackages/webpack/react-webpack-plugin/test/cases/compat/run-in-js/index.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/lynx-js-react.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/react.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/lynx-js-react.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/react.js
✅ Files skipped from review due to trivial changes (8)
- packages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/react.js
- packages/webpack/react-webpack-plugin/test/cases/compat/run-in-js/index.js
- packages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/react.js
- .changeset/fair-crews-lie.md
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_keep_use_effect_call_from_custom_runtime.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_default_and_namespace_runtime_import_calls.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_aliased_use_effect_call.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_default_and_namespace_runtime_import_params.js
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_aliased_use_effect_param.js
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/react/transform/crates/swc_plugin_shake/lib.rs`:
- Around line 191-212: The current check treats default and namespace imports
the same, allowing member-call removal for default imports (symbols: import_ids,
object_ident, imported_name, member.prop, target_calls), which is unsafe because
default-import objects can be reassigned; change the logic so the optimization
only runs for namespace imports (imported_name == "*") rather than both
"default" and "*", i.e., require imported_name == "*" before matching MemberProp
(MemberProp::Ident / MemberProp::Computed) and checking target_calls;
alternatively (if you prefer) implement reassignment tracking for default-import
properties, but for a minimal safe fix restrict to "*" only.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a2f99646-72a8-4b71-b344-faf8e16bb894
📒 Files selected for processing (12)
.changeset/fair-crews-lie.mdpackages/react/transform/crates/swc_plugin_shake/lib.rspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_keep_use_effect_call_from_custom_runtime.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_aliased_use_effect_call.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_aliased_use_effect_param.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_default_and_namespace_runtime_import_calls.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_default_and_namespace_runtime_import_params.jspackages/webpack/react-webpack-plugin/test/cases/compat/run-in-js/index.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/lynx-js-react.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/react.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/lynx-js-react.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/react.js
✅ Files skipped from review due to trivial changes (7)
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_aliased_use_effect_param.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_keep_use_effect_call_from_custom_runtime.js
- packages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/lynx-js-react.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_default_and_namespace_runtime_import_calls.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_aliased_use_effect_call.js
- packages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/lynx-js-react.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_default_and_namespace_runtime_import_params.js
🚧 Files skipped from review as they are similar to previous changes (4)
- packages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/react.js
- .changeset/fair-crews-lie.md
- packages/webpack/react-webpack-plugin/test/cases/compat/run-in-js/index.js
- packages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/react.js
There was a problem hiding this comment.
♻️ Duplicate comments (1)
packages/react/transform/crates/swc_plugin_shake/lib.rs (1)
197-200:⚠️ Potential issue | 🟠 MajorRestrict member-call shaking to namespace imports.
import Runtime from "..."; Runtime.useEffect = keep; Runtime.useEffect()is valid, but this branch treatsRuntimethe same as a namespace import and strips the second call. That makes the transform unsound for default imports. The new default-import tests at Lines 725-766 should flip to keep/regression cases once this is fixed.Minimal safe fix
- // Only `default import` and `namespace import` can legally produce runtime member calls. - if imported_name != "default" && imported_name != "*" { + // Namespace imports are read-only module namespace objects. + // Default imports may reference mutable objects, so member-call shaking is unsafe there. + if imported_name != "*" { return false; }In ECMAScript modules, can code mutate properties on an object received through `import foo from "mod"`? Are properties on `import * as ns from "mod"` effectively read-only/live bindings in the importing module?🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/react/transform/crates/swc_plugin_shake/lib.rs` around lines 197 - 200, The member-call shaking currently treats default imports like namespace imports by checking imported_name != "default" && imported_name != "*"; change the check so only namespace imports (imported_name == "*") are allowed to produce runtime member calls, i.e., remove/default-exclude "default" from the allowed set in the relevant branch in lib.rs (the variable imported_name and the guard in the runtime member-call pruning logic). Update the tests referenced (the new default-import tests at lines ~725-766) to flip to keep/regression expectations once this restriction is applied.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@packages/react/transform/crates/swc_plugin_shake/lib.rs`:
- Around line 197-200: The member-call shaking currently treats default imports
like namespace imports by checking imported_name != "default" && imported_name
!= "*"; change the check so only namespace imports (imported_name == "*") are
allowed to produce runtime member calls, i.e., remove/default-exclude "default"
from the allowed set in the relevant branch in lib.rs (the variable
imported_name and the guard in the runtime member-call pruning logic). Update
the tests referenced (the new default-import tests at lines ~725-766) to flip to
keep/regression expectations once this restriction is applied.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6bc982c4-df25-42b8-998a-d954485877e8
📒 Files selected for processing (14)
.changeset/fair-crews-lie.mdpackages/react/transform/crates/swc_plugin_shake/lib.rspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_keep_use_effect_call_from_custom_runtime.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_aliased_use_effect_call.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_aliased_use_effect_call_by_local_name.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_aliased_use_effect_param.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_aliased_use_effect_param_by_local_name.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_default_and_namespace_runtime_import_calls.jspackages/react/transform/crates/swc_plugin_shake/tests/__swc_snapshots__/lib.rs/should_remove_default_and_namespace_runtime_import_params.jspackages/webpack/react-webpack-plugin/test/cases/compat/run-in-js/index.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/lynx-js-react.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/react.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/lynx-js-react.jspackages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/react.js
✅ Files skipped from review due to trivial changes (7)
- .changeset/fair-crews-lie.md
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_aliased_use_effect_param.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_aliased_use_effect_call.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_aliased_use_effect_call_by_local_name.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_aliased_use_effect_param_by_local_name.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_keep_use_effect_call_from_custom_runtime.js
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_default_and_namespace_runtime_import_calls.js
🚧 Files skipped from review as they are similar to previous changes (6)
- packages/react/transform/crates/swc_plugin_shake/tests/swc_snapshots/lib.rs/should_remove_default_and_namespace_runtime_import_params.js
- packages/webpack/react-webpack-plugin/test/cases/compat/run-in-js/index.js
- packages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/lynx-js-react.js
- packages/webpack/react-webpack-plugin/test/cases/main-thread/use-effect/react.js
- packages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/react.js
- packages/webpack/react-webpack-plugin/test/cases/main-thread/use-imperative-handle/lynx-js-react.js
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @lynx-js/react@0.118.0 ### Minor Changes - refactor: create SnapshotInstance in renderToString directly ([#2393](#2393)) - Add `removeCall` for shake function calls. Its initial default value matches the hooks that were previously in `removeCallParams`, and `removeCallParams` now defaults to empty. ([#2423](#2423)) `removeCall` removes matched runtime hook calls entirely, replacing them with `undefined` in expression positions and dropping them in statement positions. `removeCallParams` keeps the existing behavior of preserving the call while stripping its arguments. ### Patch Changes - Improve `shake.removeCall` and `shake.removeCallParams` in the React transform so they also match aliased runtime imports such as `import { useEffect as myUseEffect } ...` and member calls such as `ReactLynxRuntime.useEffect(...)` from default or namespace runtime imports. ([#2437](#2437)) - Create element without ref for suspense in main thread. ([#2426](#2426)) - refactor: make `useEffect`, `useLayoutEffect` and `useImperativeHandle` no-op on the main thread ([#2424](#2424)) ## @lynx-js/react-rsbuild-plugin@0.15.0 ### Minor Changes - Add `removeCall` for shake function calls. Its initial default value matches the hooks that were previously in `removeCallParams`, and `removeCallParams` now defaults to empty. ([#2423](#2423)) `removeCall` removes matched runtime hook calls entirely, replacing them with `undefined` in expression positions and dropping them in statement positions. `removeCallParams` keeps the existing behavior of preserving the call while stripping its arguments. ### Patch Changes - Support `@lynx-js/react` 0.118.0. ([#2432](#2432)) - Updated dependencies \[[`1f4f117`](1f4f117)]: - @lynx-js/react-webpack-plugin@0.9.0 - @lynx-js/react-alias-rsbuild-plugin@0.15.0 - @lynx-js/use-sync-external-store@1.5.0 - @lynx-js/react-refresh-webpack-plugin@0.3.5 - @lynx-js/css-extract-webpack-plugin@0.7.0 - @lynx-js/template-webpack-plugin@0.10.8 ## @lynx-js/react-webpack-plugin@0.9.0 ### Minor Changes - Add `removeCall` for shake function calls. Its initial default value matches the hooks that were previously in `removeCallParams`, and `removeCallParams` now defaults to empty. ([#2423](#2423)) `removeCall` removes matched runtime hook calls entirely, replacing them with `undefined` in expression positions and dropping them in statement positions. `removeCallParams` keeps the existing behavior of preserving the call while stripping its arguments. ## @lynx-js/rspeedy@0.14.1 ### Patch Changes - Updated dependencies \[]: - @lynx-js/web-rsbuild-server-middleware@0.20.1 ## create-rspeedy@0.14.1 ### Patch Changes - Fix the error when installing Lynx DevTool skill. ([#2427](#2427)) ## @lynx-js/lynx-bundle-rslib-config@0.3.1 ### Patch Changes - Updated dependencies \[[`156d64d`](156d64d), [`59d11b2`](59d11b2)]: - @lynx-js/css-serializer@0.1.5 ## @lynx-js/config-rsbuild-plugin@0.0.2 ### Patch Changes - Support `@lynx-js/rspeedy` 0.14.0. ([#2431](#2431)) ## @lynx-js/css-serializer@0.1.5 ### Patch Changes - feat: add support for @media, @supports, and @layer at-rules ([#2330](#2330)) Add support for additional CSS at-rules in the CSS serializer: - `@media` - for media queries - `@supports` - for feature queries - `@layer` - for cascade layers (both named and anonymous) The parser now handles these at-rules with proper recursive parsing support for nested at-rules. - feat: support custom property declaration in keyframe rule ([#2429](#2429)) ## @lynx-js/web-core@0.20.1 ### Patch Changes - Added support for the `global-bind` event handling modifier in the web platform runtime. ([#2438](#2438)) This mechanism enables seamless cross-element event communication without requiring a formal DOM tree relationship, allowing decoupled elements to observe and respond to standard events occurring anywhere within the component tree. ### Usage Global bindings allow an observer element to react to events triggered on another target element. #### 1. Define the Global Subscription Attach `global-bindTap` (or any equivalent standard event alias) to your observer element: ```jsx <view id="observer" global-bindTap={(event) => { // This will trigger whenever 'tap' is caught by a globally bound event. console.log("Global tap handled!", event); }} /> ``` #### 2. Trigger the Event anywhere The event will be triggered via normal user interaction (such as `tap`) on any other constituent elements: ```jsx <view id="target" bindTap={(event) => { // Note: To successfully propagate globally, ensure the event bubbles. }} /> ``` - feat(web-core): add support for configurable rem unit transform ([#2403](#2403)) - **Description**: Added a new configuration option `transformREM` (also exposed as `transform_rem` on the Rust layer) to the Web Core renderer. When enabled, it recursively converts static `rem` unit values in your styles into dynamic CSS custom properties (`calc(VALUE * var(--rem-unit))`) during template decoding and evaluation. This enables developers to implement responsive font scaling and layout sizing dynamically on the client side simply by modifying the root CSS variable `--rem-unit`. - **Usage**: You can enable this feature when working with `LynxView` by setting `transformREM` to `true`, or directly as an HTML attribute `transform-rem`: ```html <lynx-view url="https://example.com/template.js" transform-rem="true" ></lynx-view> ``` ```javascript const lynxView = document.createElement("lynx-view"); lynxView.transformREM = true; ``` With this enabled, a CSS declaration like `font-size: 1.5rem;` is transparently evaluated as `font-size: calc(1.5 * var(--rem-unit));` by the runtime engine. - Updated dependencies \[[`156d64d`](156d64d), [`59d11b2`](59d11b2)]: - @lynx-js/css-serializer@0.1.5 - @lynx-js/web-worker-rpc@0.20.1 ## @lynx-js/template-webpack-plugin@0.10.8 ### Patch Changes - Updated dependencies \[[`156d64d`](156d64d), [`5151fcf`](5151fcf), [`b630df2`](b630df2), [`59d11b2`](59d11b2)]: - @lynx-js/css-serializer@0.1.5 - @lynx-js/web-core@0.20.1 ## @lynx-js/react-umd@0.118.0 ## @lynx-js/react-alias-rsbuild-plugin@0.15.0 ## upgrade-rspeedy@0.14.1 ## @lynx-js/web-rsbuild-server-middleware@0.20.1 ## @lynx-js/web-worker-rpc@0.20.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary by CodeRabbit
Bug Fixes
Tests
Chores
Checklist