@lynx-js/web-mainthread-apis-canary 0.18.0-canary-20251012-dd7c14a8 → 0.18.1-canary-20251016-70a18fce

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # @lynx-js/web-mainthread-apis
2
2
 
3
- ## 0.18.0-canary-20251012050336-dd7c14a838a10804949a953d0f5b54f34ba7cc67
3
+ ## 0.18.1-canary-20251016065218-70a18fce0083743e4516eefc91c0392d748b855f
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: mts freeze after reload() ([#1892](https://github.com/lynx-family/lynx-stack/pull/1892))
8
+
9
+ The mts may be freezed after reload() called.
10
+
11
+ We fixed it by waiting until the all-on-ui Javascript realm implementation, an iframe, to be fully loaded.
12
+
13
+ - Updated dependencies []:
14
+ - @lynx-js/web-constants@0.18.1-canary-20251016065218-70a18fce0083743e4516eefc91c0392d748b855f
15
+ - @lynx-js/web-style-transformer@0.18.1-canary-20251016065218-70a18fce0083743e4516eefc91c0392d748b855f
16
+
17
+ ## 0.18.0
4
18
 
5
19
  ### Patch Changes
6
20
 
@@ -17,8 +31,8 @@
17
31
  - feat: mouse event output structures remain aligned ([#1820](https://github.com/lynx-family/lynx-stack/pull/1820))
18
32
 
19
33
  - Updated dependencies [[`77397fd`](https://github.com/lynx-family/lynx-stack/commit/77397fd535cf60556f8f82f7ef8dae8a623d1625)]:
20
- - @lynx-js/web-constants@0.18.0-canary-20251012050336-dd7c14a838a10804949a953d0f5b54f34ba7cc67
21
- - @lynx-js/web-style-transformer@0.18.0-canary-20251012050336-dd7c14a838a10804949a953d0f5b54f34ba7cc67
34
+ - @lynx-js/web-constants@0.18.0
35
+ - @lynx-js/web-style-transformer@0.18.0
22
36
 
23
37
  ## 0.17.2
24
38
 
@@ -1,5 +1,5 @@
1
1
  import { type Rpc, type StartMainThreadContextConfig, type RpcCallType, type reportErrorEndpoint, type I18nResourceTranslationOptions, type InitI18nResources, type I18nResources, type Cloneable, type SSRHydrateInfo, type SSRDehydrateHooks, type JSRealm, type TemplateLoader, type UpdateDataOptions } from '@lynx-js/web-constants';
2
- export declare function prepareMainThreadAPIs(backgroundThreadRpc: Rpc, rootDom: Document | ShadowRoot, document: Document, mtsRealm: JSRealm, commitDocument: (exposureChangedElements: HTMLElement[]) => Promise<void> | void, markTimingInternal: (timingKey: string, pipelineId?: string) => void, flushMarkTimingInternal: () => void, reportError: RpcCallType<typeof reportErrorEndpoint>, triggerI18nResourceFallback: (options: I18nResourceTranslationOptions) => void, initialI18nResources: (data: InitI18nResources) => I18nResources, loadTemplate: TemplateLoader, ssrHooks?: SSRDehydrateHooks): {
2
+ export declare function prepareMainThreadAPIs(backgroundThreadRpc: Rpc, rootDom: Document | ShadowRoot, document: Document, mtsRealmPromise: JSRealm | Promise<JSRealm>, commitDocument: (exposureChangedElements: HTMLElement[]) => Promise<void> | void, markTimingInternal: (timingKey: string, pipelineId?: string) => void, flushMarkTimingInternal: () => void, reportError: RpcCallType<typeof reportErrorEndpoint>, triggerI18nResourceFallback: (options: I18nResourceTranslationOptions) => void, initialI18nResources: (data: InitI18nResources) => I18nResources, loadTemplate: TemplateLoader, ssrHooks?: SSRDehydrateHooks): {
3
3
  startMainThread: (config: StartMainThreadContextConfig, ssrHydrateInfo?: SSRHydrateInfo) => Promise<void>;
4
4
  handleUpdatedData: (newData: Cloneable, options: UpdateDataOptions | undefined) => Promise<void>;
5
5
  };
@@ -10,7 +10,7 @@ import { initWasm } from '@lynx-js/web-style-transformer';
10
10
  import { appendStyleElement } from './utils/processStyleInfo.js';
11
11
  import { createQueryComponent } from './crossThreadHandlers/createQueryComponent.js';
12
12
  const initWasmPromise = initWasm();
13
- export function prepareMainThreadAPIs(backgroundThreadRpc, rootDom, document, mtsRealm, commitDocument, markTimingInternal, flushMarkTimingInternal, reportError, triggerI18nResourceFallback, initialI18nResources, loadTemplate, ssrHooks) {
13
+ export function prepareMainThreadAPIs(backgroundThreadRpc, rootDom, document, mtsRealmPromise, commitDocument, markTimingInternal, flushMarkTimingInternal, reportError, triggerI18nResourceFallback, initialI18nResources, loadTemplate, ssrHooks) {
14
14
  const postTimingFlags = backgroundThreadRpc.createCall(postTimingFlagsEndpoint);
15
15
  const backgroundStart = backgroundThreadRpc.createCall(BackgroundThreadStartEndpoint);
16
16
  const publishEvent = backgroundThreadRpc.createCall(publishEventEndpoint);
@@ -23,6 +23,7 @@ export function prepareMainThreadAPIs(backgroundThreadRpc, rootDom, document, mt
23
23
  let isFp = true;
24
24
  const { globalProps, template, browserConfig, nativeModulesMap, napiModulesMap, tagMap, initI18nResources, } = config;
25
25
  const { styleInfo, pageConfig, customSections, cardType, } = template;
26
+ const mtsRealm = await mtsRealmPromise;
26
27
  markTimingInternal('decode_start');
27
28
  await initWasmPromise;
28
29
  const jsContext = new LynxCrossThreadContext({
@@ -141,7 +142,8 @@ export function prepareMainThreadAPIs(backgroundThreadRpc, rootDom, document, mt
141
142
  await mtsRealm.loadScript(template.lepusCode.root);
142
143
  jsContext.__start(); // start the jsContext after the runtime is created
143
144
  }
144
- function handleUpdatedData(newData, options) {
145
+ async function handleUpdatedData(newData, options) {
146
+ const mtsRealm = await mtsRealmPromise;
145
147
  const runtime = mtsRealm.globalWindow;
146
148
  const processedData = runtime.processData
147
149
  ? runtime.processData(newData, options?.processorName)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-mainthread-apis-canary",
3
- "version": "0.18.0-canary-20251012-dd7c14a8",
3
+ "version": "0.18.1-canary-20251016-70a18fce",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -24,8 +24,8 @@
24
24
  "**/*.css"
25
25
  ],
26
26
  "dependencies": {
27
- "@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.18.0-canary-20251012-dd7c14a8",
28
- "@lynx-js/web-style-transformer": "npm:@lynx-js/web-style-transformer-canary@0.18.0-canary-20251012-dd7c14a8",
27
+ "@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.18.1-canary-20251016-70a18fce",
28
+ "@lynx-js/web-style-transformer": "npm:@lynx-js/web-style-transformer-canary@0.18.1-canary-20251016-70a18fce",
29
29
  "hyphenate-style-name": "^1.1.0"
30
30
  }
31
31
  }