Skip to content

chore: mark the "multi-thread" deprecated#2030

Merged
PupilTong merged 1 commit intolynx-family:mainfrom
PupilTong:p/hw/deprecate-all-on-ui
Dec 22, 2025
Merged

chore: mark the "multi-thread" deprecated#2030
PupilTong merged 1 commit intolynx-family:mainfrom
PupilTong:p/hw/deprecate-all-on-ui

Conversation

@PupilTong
Copy link
Copy Markdown
Collaborator

@PupilTong PupilTong commented Dec 18, 2025

NOTICE This will be a breaking change in the future

mark the thread strategy "multi-thread" as deprecated.

Please use "all-on-ui" instead. If you still want to use multi-thread mode, please try to use a cross-origin isolated iframe.

A console warning will be printed if thread-strategy is set to multi-thread.

Summary by CodeRabbit

  • Deprecations
    • The "multi-thread" thread strategy is now deprecated. Console warnings appear when this strategy is used, alerting users to the deprecation status. Migration to the "all-on-ui" strategy is recommended, with a cross-origin isolated iframe available as an alternative for continued multi-thread functionality if needed.

✏️ Tip: You can customize this high-level summary in your review settings.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

**NOTICE This will be a breaking change in the future**

mark the thread strategy "multi-thread" as deprecated.

Please use "all-on-ui" instead. If you still want to use multi-thread mode, please try to use a cross-origin isolated iframe.

A console warning will be printed if `thread-strategy` is set to `multi-thread`.
@PupilTong PupilTong self-assigned this Dec 18, 2025
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Dec 18, 2025

🦋 Changeset detected

Latest commit: 91500f0

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

This PR includes changesets to release 10 packages
Name Type
@lynx-js/web-core Patch
upgrade-rspeedy Patch
@lynx-js/web-rsbuild-server-middleware Patch
@lynx-js/web-core-server Patch
@lynx-js/web-constants Patch
@lynx-js/web-mainthread-apis Patch
@lynx-js/web-worker-rpc Patch
@lynx-js/web-worker-runtime Patch
@lynx-js/rspeedy Patch
create-rspeedy Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 18, 2025

📝 Walkthrough

Walkthrough

This PR deprecates the "multi-thread" thread strategy in @lynx-js/web-core by introducing a changeset, removing MULTI_THREAD from the Playwright CI matrix, and adding deprecation JSDoc and runtime console warnings to LynxView.threadStrategy. Users are directed to adopt the "all-on-ui" strategy instead.

Changes

Cohort / File(s) Summary
Deprecation Announcement
.changeset/curvy-stars-kneel.md
Introduces deprecation notice for "multi-thread" thread strategy, signaling future breaking change and recommending "all-on-ui" with optional cross-origin isolated iframe fallback.
CI Configuration
.github/workflows/test.yml
Removes MULTI_THREAD from Playwright matrix thread dimension, leaving only ALL_ON_UI for execution. Comments out prior MULTI_THREAD+SSR exclusion logic.
Core API Deprecation
packages/web-platform/web-core/src/apis/LynxView.ts
Removes threadStrategy documentation from INapiModulesCall, marks LynxView.threadStrategy getter as @deprecated, and adds console warnings when threadStrategy resolves to "multi-thread" in render and getter evaluation paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

  • Verify console warnings are emitted in both expected code paths (render and threadStrategy getter)
  • Confirm test matrix reduction doesn't compromise coverage of remaining thread strategies
  • Validate deprecation messaging is clear and actionable for users

Possibly related PRs

Suggested labels

platform:Web

Suggested reviewers

  • Sherry-hue
  • colinaaa

Poem

🐰 hops contentedly
Multi-threads now fade into the night,
All-on-UI shines clear and bright!
With warnings kind, we guide the way,
One strategy wins the modern day! 🌟

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: mark the "multi-thread" deprecated' directly relates to the main objective of the pull request, which is to deprecate the multi-thread thread strategy across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

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

⚠️ Outside diff range comments (1)
.github/workflows/test.yml (1)

102-104: Remove dead code.

Since MULTI_THREAD has been removed from the matrix (line 90), this conditional block will never execute and should be removed to avoid confusion.

🔎 Apply this diff to remove the dead code:
-        if [ "${{ matrix.thread }}" = "MULTI_THREAD" ]; then
-          export ENABLE_MULTI_THREAD=true
-        fi
🧹 Nitpick comments (1)
.changeset/curvy-stars-kneel.md (1)

7-7: Consider using proper markdown heading.

The emphasis (bold) could be replaced with a proper heading for better markdown structure.

🔎 Suggested formatting improvements:
-**NOTICE This will be a breaking change in the future**
+## ⚠️ NOTICE: This will be a breaking change in the future
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb67780 and 91500f0.

📒 Files selected for processing (3)
  • .changeset/curvy-stars-kneel.md (1 hunks)
  • .github/workflows/test.yml (1 hunks)
  • packages/web-platform/web-core/src/apis/LynxView.ts (2 hunks)
🧰 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/curvy-stars-kneel.md
🧠 Learnings (9)
📓 Common learnings
Learnt from: PupilTong
Repo: lynx-family/lynx-stack PR: 1706
File: .github/workflows/test.yml:0-0
Timestamp: 2025-09-10T10:27:32.903Z
Learning: MULTI_THREAD×SSR combination is NYI (Not Yet Implemented) in the Playwright test configuration, which is why it's excluded from the test matrix in .github/workflows/test.yml.
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, private packages (marked with "private": true in package.json) like lynx-js/react-transform don't require meaningful changeset entries even when their public APIs change, since they are not published externally and only affect internal development.

Applied to files:

  • .changeset/curvy-stars-kneel.md
📚 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/curvy-stars-kneel.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/curvy-stars-kneel.md
📚 Learning: 2025-09-10T10:27:32.903Z
Learnt from: PupilTong
Repo: lynx-family/lynx-stack PR: 1706
File: .github/workflows/test.yml:0-0
Timestamp: 2025-09-10T10:27:32.903Z
Learning: MULTI_THREAD×SSR combination is NYI (Not Yet Implemented) in the Playwright test configuration, which is why it's excluded from the test matrix in .github/workflows/test.yml.

Applied to files:

  • .github/workflows/test.yml
📚 Learning: 2025-09-10T10:24:40.137Z
Learnt from: PupilTong
Repo: lynx-family/lynx-stack PR: 1706
File: .github/workflows/test.yml:109-109
Timestamp: 2025-09-10T10:24:40.137Z
Learning: In Playwright, when fullyParallel: true is set, the --shard option distributes individual tests across shards rather than splitting by files. This provides better load balancing compared to the default file-level sharding when fullyParallel is false.

Applied to files:

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

Applied to files:

  • packages/web-platform/web-core/src/apis/LynxView.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/src/apis/LynxView.ts
🪛 markdownlint-cli2 (0.18.1)
.changeset/curvy-stars-kneel.md

7-7: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

🔇 Additional comments (4)
.github/workflows/test.yml (1)

90-90: LGTM - Consistent with deprecation strategy.

Removing MULTI_THREAD from the test matrix aligns with the deprecation plan. This ensures CI no longer validates the deprecated code path.

packages/web-platform/web-core/src/apis/LynxView.ts (2)

346-346: LGTM - Well-documented deprecation.

The @deprecated JSDoc tag properly marks this API as deprecated and provides clear migration guidance for developers.


434-438: LGTM - Appropriate runtime warning.

The console warning effectively notifies developers at runtime about the deprecation, complementing the JSDoc @deprecated tag. The message is clear and consistent with the documentation.

.changeset/curvy-stars-kneel.md (1)

1-13: LGTM - Appropriate changeset type for deprecation.

The patch changeset type is correct for this deprecation notice. Since the multi-thread functionality still works and only warnings are added, this is not yet a breaking change. When multi-thread support is actually removed in the future, that change should be released as a major version bump.

As per coding guidelines, the breaking change is clearly marked in the changeset description.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 18, 2025

Codecov Report

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

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 18, 2025

CodSpeed Performance Report

Merging #2030 will improve performances by 8.42%

Comparing PupilTong:p/hw/deprecate-all-on-ui (91500f0) with main (fb67780)

Summary

⚡ 2 improvements
✅ 61 untouched
⏩ 3 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Change
transform 1000 view elements 47 ms 44.3 ms +5.93%
basic-performance-div-10000 435.7 ms 401.9 ms +8.42%

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Dec 18, 2025

React Example

#6550 Bundle Size — 236.9KiB (0%).

91500f0(current) vs fb67780 main#6526(baseline)

Bundle metrics  no changes
                 Current
#6550
     Baseline
#6526
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 162 162
No change  Duplicate Modules 65 65
No change  Duplicate Code 46.74% 46.74%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#6550
     Baseline
#6526
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.14KiB 91.14KiB

Bundle analysis reportBranch PupilTong:p/hw/deprecate-all-on-...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Dec 18, 2025

Web Explorer

#6710 Bundle Size — 372.84KiB (+0.06%).

91500f0(current) vs fb67780 main#6686(baseline)

Bundle metrics  Change 3 changes Regression 1 regression
                 Current
#6710
     Baseline
#6686
Regression  Initial JS 146.57KiB(+0.14%) 146.36KiB
No change  Initial CSS 32.4KiB 32.4KiB
Change  Cache Invalidation 39.28% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 229(-0.43%) 230
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.97% 2.97%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#6710
     Baseline
#6686
Regression  JS 243.46KiB (+0.09%) 243.25KiB
No change  Other 96.98KiB 96.98KiB
No change  CSS 32.4KiB 32.4KiB

Bundle analysis reportBranch PupilTong:p/hw/deprecate-all-on-...Project dashboard


Generated by RelativeCIDocumentationReport issue

@PupilTong PupilTong requested a review from Sherry-hue December 19, 2025 03:55
@PupilTong PupilTong merged commit c5da3b2 into lynx-family:main Dec 22, 2025
47 checks passed
colinaaa pushed a commit that referenced this pull request Dec 22, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @lynx-js/gesture-runtime@2.1.0

### Minor Changes

- Initialize `'@lynx-js/gesture-runtime`
([#1984](#1984))

## @lynx-js/rspeedy@0.12.3

### Patch Changes

- Support environment variants to enable multiple configurations for the
same targets.
([#1969](#1969))

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

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

### Patch Changes

- Introduce `@lynx-js/externals-loading-webpack-plugin`. It will help
you to load externals built by `@lynx-js/lynx-bundle-rslib-config`.
([#1924](#1924))

    ```js
    // webpack.config.js
import { ExternalsLoadingPlugin } from
"@lynx-js/externals-loading-webpack-plugin";

    export default {
      plugins: [
        new ExternalsLoadingPlugin({
          mainThreadLayer: "main-thread",
          backgroundLayer: "background",
          externals: {
            lodash: {
              url: "http://lodash.lynx.bundle",
              background: { sectionPath: "background" },
              mainThread: { sectionPath: "main-thread" },
            },
          },
        }),
      ],
    };
    ```

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

### Patch Changes

- Support environment variants to enable multiple configurations for the
same targets.
([#1969](#1969))

-   Updated dependencies \[]:
    -   @lynx-js/react-alias-rsbuild-plugin@0.12.2

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

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-worker-rpc@0.19.2

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

### Patch Changes

- chore: mark the "multi-thread" deprecated
([#2030](#2030))

    **NOTICE This will be a breaking change in the future**

    mark the thread strategy "multi-thread" as deprecated.

Please use "all-on-ui" instead. If you still want to use multi-thread
mode, please try to use a cross-origin isolated iframe.

A console warning will be printed if `thread-strategy` is set to
`multi-thread`.

- fix csp issue for mts realm
([#1998](#1998))

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.2
    -   @lynx-js/web-mainthread-apis@0.19.2
    -   @lynx-js/web-worker-rpc@0.19.2
    -   @lynx-js/web-worker-runtime@0.19.2

## @lynx-js/web-explorer@0.0.15

### Patch Changes

- fix: web-explorer needs to actively send an iframeReady message to the
parent, the parent uses `iframe load` listener cannot guarantee that the
`message-listener` will complete execution.
([#2001](#2001))

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

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.2

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

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.2
    -   @lynx-js/web-mainthread-apis@0.19.2
    -   @lynx-js/web-worker-rpc@0.19.2

## @lynx-js/externals-loading-webpack-plugin@0.0.1

### Patch Changes

- Introduce `@lynx-js/externals-loading-webpack-plugin`. It will help
you to load externals built by `@lynx-js/lynx-bundle-rslib-config`.
([#1924](#1924))

    ```js
    // webpack.config.js
import { ExternalsLoadingPlugin } from
"@lynx-js/externals-loading-webpack-plugin";

    export default {
      plugins: [
        new ExternalsLoadingPlugin({
          mainThreadLayer: "main-thread",
          backgroundLayer: "background",
          externals: {
            lodash: {
              url: "http://lodash.lynx.bundle",
              background: { sectionPath: "background" },
              mainThread: { sectionPath: "main-thread" },
            },
          },
        }),
      ],
    };
    ```

## create-rspeedy@0.12.3



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



## upgrade-rspeedy@0.12.3



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



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



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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants