Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/curvy-stars-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@lynx-js/web-core": patch
---

chore: mark the "multi-thread" deprecated

**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`.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ jobs:
strategy:
fail-fast: false
matrix:
thread: [MULTI_THREAD, ALL_ON_UI]
thread: [ALL_ON_UI]
render: [SSR, CSR]
shard: [1, 2, 3, 4]
exclude:
- thread: MULTI_THREAD
render: SSR
# exclude:
# - thread: MULTI_THREAD
# render: SSR
with:
runs-on: lynx-custom-container
is-web: true
Expand Down
7 changes: 6 additions & 1 deletion packages/web-platform/web-core/src/apis/LynxView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export type INapiModulesCall = (
* @property {"false" | "true" | null} injectHeadLinks [optional] (attribute: "inject-head-links") @default true set it to "false" to disable injecting the <link href="" ref="stylesheet"> styles into shadowroot
* @property {string[]} injectStyleRules [optional] the css rules which will be injected into shadowroot. Each items will be inserted by `insertRule` method. @see https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/insertRule
* @property {number} lynxGroupId [optional] (attribute: "lynx-group-id") the background shared context id, which is used to share webworker between different lynx cards
* @property {"all-on-ui" | "multi-thread"} threadStrategy [optional] @default "multi-thread" (attribute: "thread-strategy") controls the thread strategy for current lynx view
* @property {(string)=>Promise<LynxTemplate>} customTemplateLoader [optional] the custom template loader, which is used to load the template
* @property {InitI18nResources} initI18nResources [optional] (attribute: "init-i18n-resources") the complete set of i18nResources that on the container side, which can be obtained synchronously by _I18nResourceTranslation
*
Expand Down Expand Up @@ -344,6 +343,7 @@ export class LynxView extends HTMLElement {
/**
* @param
* @property
* @deprecated multi-thread is 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.
*/
get threadStrategy(): 'all-on-ui' | 'multi-thread' {
// @ts-expect-error
Expand Down Expand Up @@ -431,6 +431,11 @@ export class LynxView extends HTMLElement {
const threadStrategy = (this.threadStrategy ?? 'all-on-ui') as
| 'all-on-ui'
| 'multi-thread';
if (threadStrategy === 'multi-thread') {
console.warn(
`[LynxView] multi-thread strategy is 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.`,
);
}
const lynxView = createLynxView({
threadStrategy,
tagMap,
Expand Down
Loading