@lynx-js/web-core 0.14.0 → 0.14.1

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,5 +1,19 @@
1
1
  # @lynx-js/web-core
2
2
 
3
+ ## 0.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: support BTS API `lynx.reportError` && `__SetSourceMapRelease`, now you can use it and handle it in lynx-view error event. ([#1059](https://github.com/lynx-family/lynx-stack/pull/1059))
8
+
9
+ - fix: under the all-on-ui strategy, reload() will add two page elements. ([#1147](https://github.com/lynx-family/lynx-stack/pull/1147))
10
+
11
+ - Updated dependencies [[`a64333e`](https://github.com/lynx-family/lynx-stack/commit/a64333ef28228d6b90c32e027f67bef8acbd8432), [`7751375`](https://github.com/lynx-family/lynx-stack/commit/775137521782ca5445f22029c39163c0a63bbfa5), [`b52a924`](https://github.com/lynx-family/lynx-stack/commit/b52a924a2375cb6f7ebafdd8abfbab0254eb2330)]:
12
+ - @lynx-js/web-worker-runtime@0.14.1
13
+ - @lynx-js/web-constants@0.14.1
14
+ - @lynx-js/web-mainthread-apis@0.14.1
15
+ - @lynx-js/web-worker-rpc@0.14.1
16
+
3
17
  ## 0.14.0
4
18
 
5
19
  ### Minor Changes
@@ -2,7 +2,7 @@
2
2
  // Licensed under the Apache License Version 2.0 that can be found in the
3
3
  // LICENSE file in the root directory of this source tree.
4
4
  import { createLynxView, } from './createLynxView.js';
5
- import { inShadowRootStyles, } from '@lynx-js/web-constants';
5
+ import { inShadowRootStyles, lynxDisposedAttribute, lynxTagAttribute, } from '@lynx-js/web-constants';
6
6
  /**
7
7
  * Based on our experiences, these elements are almost used in all lynx cards.
8
8
  */
@@ -315,6 +315,10 @@ export class LynxView extends HTMLElement {
315
315
  disconnectedCallback() {
316
316
  this.#instance?.dispose();
317
317
  this.#instance = undefined;
318
+ // under the all-on-ui strategy, when reload() triggers dsl flush, the previously removed pageElement will be used in __FlushElementTree.
319
+ // This attribute is added to filter this issue.
320
+ this.shadowRoot?.querySelector(`[${lynxTagAttribute}="page"]`)
321
+ ?.setAttribute(lynxDisposedAttribute, '');
318
322
  if (this.shadowRoot) {
319
323
  this.shadowRoot.innerHTML = '';
320
324
  }
@@ -1,9 +1,7 @@
1
- import { type Cloneable, type I18nResourceTranslationOptions, type InitI18nResources, type NapiModulesCall, type NativeModulesCall } from '@lynx-js/web-constants';
1
+ import { type Cloneable, type I18nResourceTranslationOptions, type InitI18nResources } from '@lynx-js/web-constants';
2
2
  import type { Rpc } from '@lynx-js/web-worker-rpc';
3
- export declare function startBackground(backgroundRpc: Rpc, shadowRoot: ShadowRoot, callbacks: {
4
- nativeModulesCall: NativeModulesCall;
5
- napiModulesCall: NapiModulesCall;
6
- }): {
3
+ import type { StartUIThreadCallbacks } from './startUIThread.js';
4
+ export declare function startBackground(backgroundRpc: Rpc, shadowRoot: ShadowRoot, callbacks: StartUIThreadCallbacks): {
7
5
  sendGlobalEvent: (args_0: string, args_1: Cloneable[] | undefined) => void;
8
6
  markTiming: (timingKey: string, pipelineId: string | undefined, timeStamp: number) => void;
9
7
  updateDataBackground: (args_0: Cloneable, args_1: Record<string, string>) => Promise<void>;
@@ -7,6 +7,7 @@ import { registerSelectComponentHandler } from './crossThreadHandlers/registerSe
7
7
  import { registerNapiModulesCallHandler } from './crossThreadHandlers/registerNapiModulesCallHandler.js';
8
8
  import { registerDispatchLynxViewEventHandler } from './crossThreadHandlers/registerDispatchLynxViewEventHandler.js';
9
9
  import { registerTriggerElementMethodEndpointHandler } from './crossThreadHandlers/registerTriggerElementMethodEndpointHandler.js';
10
+ import { registerReportErrorHandler } from './crossThreadHandlers/registerReportErrorHandler.js';
10
11
  export function startBackground(backgroundRpc, shadowRoot, callbacks) {
11
12
  registerInvokeUIMethodHandler(backgroundRpc, shadowRoot);
12
13
  registerNativePropsHandler(backgroundRpc, shadowRoot);
@@ -16,6 +17,7 @@ export function startBackground(backgroundRpc, shadowRoot, callbacks) {
16
17
  registerNapiModulesCallHandler(backgroundRpc, callbacks.napiModulesCall);
17
18
  registerDispatchLynxViewEventHandler(backgroundRpc, shadowRoot);
18
19
  registerTriggerElementMethodEndpointHandler(backgroundRpc, shadowRoot);
20
+ registerReportErrorHandler(backgroundRpc, callbacks.onError);
19
21
  const sendGlobalEvent = backgroundRpc.createCall(sendGlobalEventEndpoint);
20
22
  const markTiming = backgroundRpc.createCall(markTimingEndpoint);
21
23
  const updateDataBackground = backgroundRpc.createCall(updateDataEndpoint);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-core",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -25,14 +25,14 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@lynx-js/offscreen-document": "0.1.2",
28
- "@lynx-js/web-constants": "0.14.0",
29
- "@lynx-js/web-mainthread-apis": "0.14.0",
30
- "@lynx-js/web-worker-rpc": "0.14.0",
31
- "@lynx-js/web-worker-runtime": "0.14.0"
28
+ "@lynx-js/web-constants": "0.14.1",
29
+ "@lynx-js/web-mainthread-apis": "0.14.1",
30
+ "@lynx-js/web-worker-rpc": "0.14.1",
31
+ "@lynx-js/web-worker-runtime": "0.14.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@lynx-js/lynx-core": "0.1.2",
35
- "@lynx-js/web-elements": "0.7.6"
35
+ "@lynx-js/web-elements": "0.7.7"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@lynx-js/lynx-core": "0.1.2",