@lynx-js/web-worker-runtime 0.15.3 → 0.15.5
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 +26 -0
- package/dist/backgroundThread/background-apis/createNativeApp.js +2 -0
- package/dist/backgroundThread/background-apis/createPerformanceApis.d.ts +1 -1
- package/dist/backgroundThread/background-apis/createPerformanceApis.js +11 -0
- package/dist/backgroundThread/background-apis/crossThreadHandlers/createGetPathInfo.d.ts +3 -0
- package/dist/backgroundThread/background-apis/crossThreadHandlers/createGetPathInfo.js +22 -0
- package/dist/mainThread/startMainThread.d.ts +1 -1
- package/dist/mainThread/startMainThread.js +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @lynx-js/web-worker-runtime
|
|
2
2
|
|
|
3
|
+
## 0.15.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: support path() for `createQuerySelector` ([#1456](https://github.com/lynx-family/lynx-stack/pull/1456))
|
|
8
|
+
|
|
9
|
+
- Added `getPathInfo` API to `NativeApp` and its cross-thread handler for retrieving the path from a DOM node to the root.
|
|
10
|
+
- Implemented endpoint and handler registration in both background and UI threads.
|
|
11
|
+
- Implemented `nativeApp.getPathInfo()`
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`29434ae`](https://github.com/lynx-family/lynx-stack/commit/29434aec853f14242f521316429cf07a93b8c371), [`fb7096b`](https://github.com/lynx-family/lynx-stack/commit/fb7096bb3c79166cd619a407095b8206eccb7918)]:
|
|
14
|
+
- @lynx-js/web-mainthread-apis@0.15.5
|
|
15
|
+
- @lynx-js/web-constants@0.15.5
|
|
16
|
+
- @lynx-js/web-worker-rpc@0.15.5
|
|
17
|
+
|
|
18
|
+
## 0.15.4
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- optimize IO for all-on-ui: make startMainThreadWorker async and defer import ([#1385](https://github.com/lynx-family/lynx-stack/pull/1385))
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [[`22ca433`](https://github.com/lynx-family/lynx-stack/commit/22ca433eb96b39724c6eb47ce0a938d291bbdef2), [`143e481`](https://github.com/lynx-family/lynx-stack/commit/143e481b4353b3c3d2e8d9cc4f201442ca56f097)]:
|
|
25
|
+
- @lynx-js/web-mainthread-apis@0.15.4
|
|
26
|
+
- @lynx-js/web-constants@0.15.4
|
|
27
|
+
- @lynx-js/web-worker-rpc@0.15.4
|
|
28
|
+
|
|
3
29
|
## 0.15.3
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -10,6 +10,7 @@ import { registerSendGlobalEventHandler } from './crossThreadHandlers/registerSe
|
|
|
10
10
|
import { createJSObjectDestructionObserver } from './crossThreadHandlers/createJSObjectDestructionObserver.js';
|
|
11
11
|
import { registerUpdateGlobalPropsHandler } from './crossThreadHandlers/registerUpdateGlobalPropsHandler.js';
|
|
12
12
|
import { registerUpdateI18nResource } from './crossThreadHandlers/registerUpdateI18nResource.js';
|
|
13
|
+
import { createGetPathInfo } from './crossThreadHandlers/createGetPathInfo.js';
|
|
13
14
|
let nativeAppCount = 0;
|
|
14
15
|
const sharedData = {};
|
|
15
16
|
export async function createNativeApp(config) {
|
|
@@ -82,6 +83,7 @@ export async function createNativeApp(config) {
|
|
|
82
83
|
},
|
|
83
84
|
callLepusMethod,
|
|
84
85
|
setNativeProps,
|
|
86
|
+
getPathInfo: createGetPathInfo(uiThreadRpc),
|
|
85
87
|
invokeUIMethod: createInvokeUIMethod(uiThreadRpc),
|
|
86
88
|
setCard(tt) {
|
|
87
89
|
registerPublicComponentEventHandler(mainThreadRpc, tt);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { NativeApp } from '@lynx-js/web-constants';
|
|
2
2
|
import type { TimingSystem } from './createTimingSystem.js';
|
|
3
|
-
export declare function createPerformanceApis(timingSystem: TimingSystem): Pick<NativeApp, 'generatePipelineOptions' | 'onPipelineStart' | 'markPipelineTiming' | 'bindPipelineIdWithTimingFlag' | 'profileStart' | 'profileEnd'>;
|
|
3
|
+
export declare function createPerformanceApis(timingSystem: TimingSystem): Pick<NativeApp, 'generatePipelineOptions' | 'onPipelineStart' | 'markPipelineTiming' | 'bindPipelineIdWithTimingFlag' | 'profileStart' | 'profileEnd' | 'profileMark' | 'profileFlowId' | 'isProfileRecording'>;
|
|
@@ -30,6 +30,17 @@ export function createPerformanceApis(timingSystem) {
|
|
|
30
30
|
profileEnd: () => {
|
|
31
31
|
console.error('NYI: profileEnd. This is an issue of lynx-core.');
|
|
32
32
|
},
|
|
33
|
+
profileMark: () => {
|
|
34
|
+
console.error('NYI: profileMark. This is an issue of lynx-core.');
|
|
35
|
+
},
|
|
36
|
+
profileFlowId: () => {
|
|
37
|
+
console.error('NYI: profileFlowId. This is an issue of lynx-core.');
|
|
38
|
+
return 0;
|
|
39
|
+
},
|
|
40
|
+
isProfileRecording: () => {
|
|
41
|
+
console.error('NYI: isProfileRecording. This is an issue of lynx-core.');
|
|
42
|
+
return false;
|
|
43
|
+
},
|
|
33
44
|
};
|
|
34
45
|
return performanceApis;
|
|
35
46
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright 2023 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
import { ErrorCode, getPathInfoEndpoint, } from '@lynx-js/web-constants';
|
|
5
|
+
export function createGetPathInfo(rpc) {
|
|
6
|
+
return (type, identifier, component_id, first_only, callback, root_unique_id) => {
|
|
7
|
+
rpc.invoke(getPathInfoEndpoint, [
|
|
8
|
+
type,
|
|
9
|
+
identifier,
|
|
10
|
+
component_id,
|
|
11
|
+
first_only,
|
|
12
|
+
root_unique_id,
|
|
13
|
+
]).then(callback).catch((error) => {
|
|
14
|
+
console.error(`[lynx-web] getPathInfo failed`, error);
|
|
15
|
+
callback({
|
|
16
|
+
code: ErrorCode.UNKNOWN,
|
|
17
|
+
data: error.message || '',
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=createGetPathInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function startMainThreadWorker(uiThreadPort: MessagePort, backgroundThreadPort: MessagePort): void
|
|
1
|
+
export declare function startMainThreadWorker(uiThreadPort: MessagePort, backgroundThreadPort: MessagePort): Promise<void>;
|
|
@@ -7,8 +7,8 @@ import { createMarkTimingInternal } from './crossThreadHandlers/createMainthread
|
|
|
7
7
|
import { OffscreenDocument } from '@lynx-js/offscreen-document/webworker';
|
|
8
8
|
import { _onEvent } from '@lynx-js/offscreen-document/webworker';
|
|
9
9
|
import { registerUpdateDataHandler } from './crossThreadHandlers/registerUpdateDataHandler.js';
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export async function startMainThreadWorker(uiThreadPort, backgroundThreadPort) {
|
|
11
|
+
const { prepareMainThreadAPIs } = await import('@lynx-js/web-mainthread-apis');
|
|
12
12
|
const uiThreadRpc = new Rpc(uiThreadPort, 'main-to-ui');
|
|
13
13
|
const backgroundThreadRpc = new Rpc(backgroundThreadPort, 'main-to-bg');
|
|
14
14
|
const { markTimingInternal, flushMarkTimingInternal } = createMarkTimingInternal(backgroundThreadRpc);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@lynx-js/offscreen-document": "0.1.3",
|
|
26
|
-
"@lynx-js/web-constants": "0.15.
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "0.15.
|
|
28
|
-
"@lynx-js/web-worker-rpc": "0.15.
|
|
26
|
+
"@lynx-js/web-constants": "0.15.5",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "0.15.5",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "0.15.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.2"
|