@lynx-js/web-core-canary 0.15.7 → 0.15.8-canary-20250826-bb53d9a0
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,21 @@
|
|
|
1
1
|
# @lynx-js/web-core
|
|
2
2
|
|
|
3
|
+
## 0.15.8-canary-20250826112003-bb53d9a035f607e7c89952098d4ed77877a2e3c1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: remove multi-thread mts heating ([#1597](https://github.com/lynx-family/lynx-stack/pull/1597))
|
|
8
|
+
|
|
9
|
+
The default rendering mode is "all-on-ui". Therefore the preheating for "multi-thread" will be removed.
|
|
10
|
+
|
|
11
|
+
- fix: the SystemInfo in bts should be assigned to the globalThis ([#1599](https://github.com/lynx-family/lynx-stack/pull/1599))
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`bb53d9a`](https://github.com/lynx-family/lynx-stack/commit/bb53d9a035f607e7c89952098d4ed77877a2e3c1)]:
|
|
14
|
+
- @lynx-js/web-mainthread-apis@0.15.8-canary-20250826112003-bb53d9a035f607e7c89952098d4ed77877a2e3c1
|
|
15
|
+
- @lynx-js/web-worker-runtime@0.15.8-canary-20250826112003-bb53d9a035f607e7c89952098d4ed77877a2e3c1
|
|
16
|
+
- @lynx-js/web-constants@0.15.8-canary-20250826112003-bb53d9a035f607e7c89952098d4ed77877a2e3c1
|
|
17
|
+
- @lynx-js/web-worker-rpc@0.15.8-canary-20250826112003-bb53d9a035f607e7c89952098d4ed77877a2e3c1
|
|
18
|
+
|
|
3
19
|
## 0.15.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -216,25 +232,25 @@
|
|
|
216
232
|
lynxView.initI18nResources = [
|
|
217
233
|
{
|
|
218
234
|
options: {
|
|
219
|
-
locale:
|
|
220
|
-
channel:
|
|
221
|
-
fallback_url:
|
|
235
|
+
locale: "en",
|
|
236
|
+
channel: "1",
|
|
237
|
+
fallback_url: "",
|
|
222
238
|
},
|
|
223
239
|
resource: {
|
|
224
|
-
hello:
|
|
225
|
-
lynx:
|
|
240
|
+
hello: "hello",
|
|
241
|
+
lynx: "lynx web platform1",
|
|
226
242
|
},
|
|
227
243
|
},
|
|
228
244
|
];
|
|
229
|
-
lynxView.addEventListener(
|
|
245
|
+
lynxView.addEventListener("i18nResourceMissed", (e) => {
|
|
230
246
|
console.log(e);
|
|
231
247
|
});
|
|
232
248
|
|
|
233
249
|
// mts
|
|
234
250
|
_I18nResourceTranslation({
|
|
235
|
-
locale:
|
|
236
|
-
channel:
|
|
237
|
-
fallback_url:
|
|
251
|
+
locale: "en",
|
|
252
|
+
channel: "1",
|
|
253
|
+
fallback_url: "",
|
|
238
254
|
});
|
|
239
255
|
```
|
|
240
256
|
|
|
@@ -642,8 +658,8 @@
|
|
|
642
658
|
}
|
|
643
659
|
};`,
|
|
644
660
|
],
|
|
645
|
-
{ type:
|
|
646
|
-
)
|
|
661
|
+
{ type: "text/javascript" }
|
|
662
|
+
)
|
|
647
663
|
),
|
|
648
664
|
};
|
|
649
665
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -758,8 +774,8 @@
|
|
|
758
774
|
};
|
|
759
775
|
};`,
|
|
760
776
|
],
|
|
761
|
-
{ type:
|
|
762
|
-
)
|
|
777
|
+
{ type: "text/javascript" }
|
|
778
|
+
)
|
|
763
779
|
);
|
|
764
780
|
|
|
765
781
|
const color_methods = URL.createObjectURL(
|
|
@@ -774,8 +790,8 @@
|
|
|
774
790
|
};
|
|
775
791
|
};`,
|
|
776
792
|
],
|
|
777
|
-
{ type:
|
|
778
|
-
)
|
|
793
|
+
{ type: "text/javascript" }
|
|
794
|
+
)
|
|
779
795
|
);
|
|
780
796
|
|
|
781
797
|
lynxView.napiModuleMap = {
|
|
@@ -792,7 +808,7 @@
|
|
|
792
808
|
|
|
793
809
|
```js
|
|
794
810
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
795
|
-
if (name ===
|
|
811
|
+
if (name === "getColor" && moduleName === "color_methods") {
|
|
796
812
|
return data.color;
|
|
797
813
|
}
|
|
798
814
|
};
|
|
@@ -871,8 +887,8 @@
|
|
|
871
887
|
}
|
|
872
888
|
};`,
|
|
873
889
|
],
|
|
874
|
-
{ type:
|
|
875
|
-
)
|
|
890
|
+
{ type: "text/javascript" }
|
|
891
|
+
)
|
|
876
892
|
);
|
|
877
893
|
```
|
|
878
894
|
|
|
@@ -884,7 +900,7 @@
|
|
|
884
900
|
|
|
885
901
|
```js
|
|
886
902
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
887
|
-
if (name ===
|
|
903
|
+
if (name === "getColor") {
|
|
888
904
|
callback(data.color);
|
|
889
905
|
}
|
|
890
906
|
};
|
|
@@ -894,7 +910,7 @@
|
|
|
894
910
|
|
|
895
911
|
```js
|
|
896
912
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
897
|
-
if (name ===
|
|
913
|
+
if (name === "getColor" && moduleName === "bridge") {
|
|
898
914
|
return data.color;
|
|
899
915
|
}
|
|
900
916
|
};
|
|
@@ -1252,7 +1268,7 @@
|
|
|
1252
1268
|
This flag changes the behaviour of cascading. It provide a way to do this
|
|
1253
1269
|
|
|
1254
1270
|
```jsx
|
|
1255
|
-
<view class=
|
|
1271
|
+
<view class="class-a class-b" />
|
|
1256
1272
|
```
|
|
1257
1273
|
|
|
1258
1274
|
The class-b will override (cascading) styles of class-a.
|
|
@@ -1352,11 +1368,11 @@
|
|
|
1352
1368
|
There is also a simple way to use this feature
|
|
1353
1369
|
|
|
1354
1370
|
```javascript
|
|
1355
|
-
import { LynxCard } from
|
|
1356
|
-
import { loadElement } from
|
|
1357
|
-
import
|
|
1358
|
-
import
|
|
1359
|
-
import
|
|
1371
|
+
import { LynxCard } from "@lynx-js/web-core";
|
|
1372
|
+
import { loadElement } from "@lynx-js/web-elements/lazy";
|
|
1373
|
+
import "@lynx-js/web-elements/index.css";
|
|
1374
|
+
import "@lynx-js/web-core/index.css";
|
|
1375
|
+
import "./index.css";
|
|
1360
1376
|
|
|
1361
1377
|
const lynxcard = new LynxCard({
|
|
1362
1378
|
...beforeConfigs,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type BrowserConfig } from '@lynx-js/web-constants';
|
|
1
2
|
import { Rpc } from '@lynx-js/web-worker-rpc';
|
|
2
3
|
interface LynxViewRpc {
|
|
3
4
|
mainThreadRpc: Rpc;
|
|
4
5
|
backgroundRpc: Rpc;
|
|
5
6
|
terminateWorkers: () => void;
|
|
6
7
|
}
|
|
7
|
-
export declare function bootWorkers(lynxGroupId: number | undefined, allOnUI
|
|
8
|
+
export declare function bootWorkers(lynxGroupId: number | undefined, allOnUI: boolean, browserConfig: BrowserConfig): LynxViewRpc;
|
|
8
9
|
export {};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
// Copyright 2023 The Lynx Authors. All rights reserved.
|
|
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
|
+
import { systemInfo } from '@lynx-js/web-constants';
|
|
4
5
|
import { Rpc } from '@lynx-js/web-worker-rpc';
|
|
5
6
|
const backgroundWorkerContextCount = [];
|
|
6
7
|
const contextIdToBackgroundWorker = [];
|
|
7
|
-
|
|
8
|
-
export function bootWorkers(lynxGroupId, allOnUI) {
|
|
8
|
+
export function bootWorkers(lynxGroupId, allOnUI, browserConfig) {
|
|
9
9
|
let curMainWorker;
|
|
10
10
|
if (allOnUI) {
|
|
11
11
|
curMainWorker = createUIChannel();
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
14
|
-
curMainWorker =
|
|
15
|
-
preHeatedMainWorker = createMainWorker();
|
|
14
|
+
curMainWorker = createMainWorker();
|
|
16
15
|
}
|
|
17
|
-
const curBackgroundWorker = createBackgroundWorker(lynxGroupId, curMainWorker.channelMainThreadWithBackground);
|
|
16
|
+
const curBackgroundWorker = createBackgroundWorker(lynxGroupId, curMainWorker.channelMainThreadWithBackground, browserConfig);
|
|
18
17
|
if (lynxGroupId !== undefined) {
|
|
19
18
|
if (backgroundWorkerContextCount[lynxGroupId]) {
|
|
20
19
|
backgroundWorkerContextCount[lynxGroupId]++;
|
|
@@ -71,7 +70,7 @@ function createMainWorker() {
|
|
|
71
70
|
channelMainThreadWithBackground,
|
|
72
71
|
};
|
|
73
72
|
}
|
|
74
|
-
function createBackgroundWorker(lynxGroupId, channelMainThreadWithBackground) {
|
|
73
|
+
function createBackgroundWorker(lynxGroupId, channelMainThreadWithBackground, browserConfig) {
|
|
75
74
|
const channelToBackground = new MessageChannel();
|
|
76
75
|
let backgroundThreadWorker;
|
|
77
76
|
if (lynxGroupId) {
|
|
@@ -86,6 +85,7 @@ function createBackgroundWorker(lynxGroupId, channelMainThreadWithBackground) {
|
|
|
86
85
|
mode: 'background',
|
|
87
86
|
toUIThread: channelToBackground.port2,
|
|
88
87
|
toPeerThread: channelMainThreadWithBackground.port2,
|
|
88
|
+
systemInfo: { ...systemInfo, ...browserConfig },
|
|
89
89
|
};
|
|
90
90
|
backgroundThreadWorker.postMessage(backgroundThreadMessage, [
|
|
91
91
|
channelToBackground.port2,
|
|
@@ -95,7 +95,12 @@ function createBackgroundWorker(lynxGroupId, channelMainThreadWithBackground) {
|
|
|
95
95
|
return { backgroundRpc, backgroundThreadWorker };
|
|
96
96
|
}
|
|
97
97
|
function createWebWorker(name) {
|
|
98
|
-
return new Worker(
|
|
98
|
+
return new Worker(
|
|
99
|
+
/* webpackFetchPriority: "high" */
|
|
100
|
+
/* webpackChunkName: "web-core-worker-runtime" */
|
|
101
|
+
/* webpackPrefetch: true */
|
|
102
|
+
/* webpackPreload: true */
|
|
103
|
+
new URL('@lynx-js/web-worker-runtime', import.meta.url), {
|
|
99
104
|
type: 'module',
|
|
100
105
|
name,
|
|
101
106
|
});
|
|
@@ -5,7 +5,13 @@ import { i18nResourceMissedEventName, I18nResources, lynxUniqueIdAttribute, } fr
|
|
|
5
5
|
import { Rpc } from '@lynx-js/web-worker-rpc';
|
|
6
6
|
import { dispatchLynxViewEvent } from '../utils/dispatchLynxViewEvent.js';
|
|
7
7
|
import { createExposureMonitor } from './crossThreadHandlers/createExposureMonitor.js';
|
|
8
|
-
const { prepareMainThreadAPIs, } = await import(
|
|
8
|
+
const { prepareMainThreadAPIs, } = await import(
|
|
9
|
+
/* webpackChunkName: "web-core-main-thread-apis" */
|
|
10
|
+
/* webpackMode: "lazy-once" */
|
|
11
|
+
/* webpackPreload: true */
|
|
12
|
+
/* webpackPrefetch: true */
|
|
13
|
+
/* webpackFetchPriority: "high" */
|
|
14
|
+
'@lynx-js/web-mainthread-apis');
|
|
9
15
|
export function createRenderAllOnUI(mainToBackgroundRpc, shadowRoot, markTimingInternal, flushMarkTimingInternal, callbacks, ssrDumpInfo) {
|
|
10
16
|
if (!globalThis.module) {
|
|
11
17
|
Object.assign(globalThis, { module: {} });
|
|
@@ -12,7 +12,7 @@ import { createRenderAllOnUI } from './createRenderAllOnUI.js';
|
|
|
12
12
|
export function startUIThread(templateUrl, configs, shadowRoot, lynxGroupId, threadStrategy, callbacks, ssr) {
|
|
13
13
|
const createLynxStartTiming = performance.now() + performance.timeOrigin;
|
|
14
14
|
const allOnUI = threadStrategy === 'all-on-ui';
|
|
15
|
-
const { mainThreadRpc, backgroundRpc, terminateWorkers, } = bootWorkers(lynxGroupId, allOnUI);
|
|
15
|
+
const { mainThreadRpc, backgroundRpc, terminateWorkers, } = bootWorkers(lynxGroupId, allOnUI, configs.browserConfig);
|
|
16
16
|
const { markTiming, sendGlobalEvent, updateDataBackground, updateI18nResourceBackground, } = startBackground(backgroundRpc, shadowRoot, callbacks);
|
|
17
17
|
const cacheMarkTimings = {
|
|
18
18
|
records: [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-core-canary",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.8-canary-20250826-bb53d9a0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.3",
|
|
28
|
-
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.15.
|
|
29
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.
|
|
30
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.
|
|
31
|
-
"@lynx-js/web-worker-runtime": "npm:@lynx-js/web-worker-runtime-canary@0.15.
|
|
28
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.15.8-canary-20250826-bb53d9a0",
|
|
29
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.8-canary-20250826-bb53d9a0",
|
|
30
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.8-canary-20250826-bb53d9a0",
|
|
31
|
+
"@lynx-js/web-worker-runtime": "npm:@lynx-js/web-worker-runtime-canary@0.15.8-canary-20250826-bb53d9a0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@lynx-js/lynx-core": "0.1.3",
|