@lynx-js/web-worker-runtime-canary 0.19.0 → 0.19.1-canary-20251210-47cc2bc6
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 +34 -25
- package/dist/mainThread/startMainThread.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @lynx-js/web-worker-runtime
|
|
2
2
|
|
|
3
|
+
## 0.19.1-canary-20251210073827-47cc2bc694d0da12b41d55e459c4e78338e8b77a
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`f7256d5`](https://github.com/lynx-family/lynx-stack/commit/f7256d5bd920b2f6c0cadab44455585c35621b35)]:
|
|
8
|
+
- @lynx-js/web-mainthread-apis@0.19.1-canary-20251210073827-47cc2bc694d0da12b41d55e459c4e78338e8b77a
|
|
9
|
+
- @lynx-js/web-constants@0.19.1-canary-20251210073827-47cc2bc694d0da12b41d55e459c4e78338e8b77a
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.19.1-canary-20251210073827-47cc2bc694d0da12b41d55e459c4e78338e8b77a
|
|
11
|
+
|
|
3
12
|
## 0.19.0
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -235,14 +244,14 @@
|
|
|
235
244
|
Usage:
|
|
236
245
|
|
|
237
246
|
```ts
|
|
238
|
-
import { pluginWebPlatform } from
|
|
239
|
-
import { defineConfig } from
|
|
247
|
+
import { pluginWebPlatform } from "@lynx-js/web-platform-rsbuild-plugin";
|
|
248
|
+
import { defineConfig } from "@rsbuild/core";
|
|
240
249
|
|
|
241
250
|
export default defineConfig({
|
|
242
251
|
plugins: [
|
|
243
252
|
pluginWebPlatform({
|
|
244
253
|
// replace with your actual napi-modules file path
|
|
245
|
-
napiModulesPath: path.resolve(__dirname,
|
|
254
|
+
napiModulesPath: path.resolve(__dirname, "./index.napi-modules.ts"),
|
|
246
255
|
}),
|
|
247
256
|
],
|
|
248
257
|
});
|
|
@@ -253,10 +262,10 @@
|
|
|
253
262
|
```ts
|
|
254
263
|
// index.napi-modules.ts
|
|
255
264
|
export default {
|
|
256
|
-
custom_module: function(NapiModules, NapiModulesCall) {
|
|
265
|
+
custom_module: function (NapiModules, NapiModulesCall) {
|
|
257
266
|
return {
|
|
258
267
|
async test(name) {
|
|
259
|
-
console.log(
|
|
268
|
+
console.log("CustomModule", NapiModules, NapiModulesCall);
|
|
260
269
|
},
|
|
261
270
|
};
|
|
262
271
|
},
|
|
@@ -308,25 +317,25 @@
|
|
|
308
317
|
lynxView.initI18nResources = [
|
|
309
318
|
{
|
|
310
319
|
options: {
|
|
311
|
-
locale:
|
|
312
|
-
channel:
|
|
313
|
-
fallback_url:
|
|
320
|
+
locale: "en",
|
|
321
|
+
channel: "1",
|
|
322
|
+
fallback_url: "",
|
|
314
323
|
},
|
|
315
324
|
resource: {
|
|
316
|
-
hello:
|
|
317
|
-
lynx:
|
|
325
|
+
hello: "hello",
|
|
326
|
+
lynx: "lynx web platform1",
|
|
318
327
|
},
|
|
319
328
|
},
|
|
320
329
|
];
|
|
321
|
-
lynxView.addEventListener(
|
|
330
|
+
lynxView.addEventListener("i18nResourceMissed", (e) => {
|
|
322
331
|
console.log(e);
|
|
323
332
|
});
|
|
324
333
|
|
|
325
334
|
// mts
|
|
326
335
|
_I18nResourceTranslation({
|
|
327
|
-
locale:
|
|
328
|
-
channel:
|
|
329
|
-
fallback_url:
|
|
336
|
+
locale: "en",
|
|
337
|
+
channel: "1",
|
|
338
|
+
fallback_url: "",
|
|
330
339
|
});
|
|
331
340
|
```
|
|
332
341
|
|
|
@@ -576,8 +585,8 @@
|
|
|
576
585
|
}
|
|
577
586
|
};`,
|
|
578
587
|
],
|
|
579
|
-
{ type:
|
|
580
|
-
)
|
|
588
|
+
{ type: "text/javascript" }
|
|
589
|
+
)
|
|
581
590
|
),
|
|
582
591
|
};
|
|
583
592
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -667,8 +676,8 @@
|
|
|
667
676
|
};
|
|
668
677
|
};`,
|
|
669
678
|
],
|
|
670
|
-
{ type:
|
|
671
|
-
)
|
|
679
|
+
{ type: "text/javascript" }
|
|
680
|
+
)
|
|
672
681
|
);
|
|
673
682
|
|
|
674
683
|
const color_methods = URL.createObjectURL(
|
|
@@ -683,8 +692,8 @@
|
|
|
683
692
|
};
|
|
684
693
|
};`,
|
|
685
694
|
],
|
|
686
|
-
{ type:
|
|
687
|
-
)
|
|
695
|
+
{ type: "text/javascript" }
|
|
696
|
+
)
|
|
688
697
|
);
|
|
689
698
|
|
|
690
699
|
lynxView.napiModuleMap = {
|
|
@@ -701,7 +710,7 @@
|
|
|
701
710
|
|
|
702
711
|
```js
|
|
703
712
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
704
|
-
if (name ===
|
|
713
|
+
if (name === "getColor" && moduleName === "color_methods") {
|
|
705
714
|
return data.color;
|
|
706
715
|
}
|
|
707
716
|
};
|
|
@@ -756,8 +765,8 @@
|
|
|
756
765
|
}
|
|
757
766
|
};`,
|
|
758
767
|
],
|
|
759
|
-
{ type:
|
|
760
|
-
)
|
|
768
|
+
{ type: "text/javascript" }
|
|
769
|
+
)
|
|
761
770
|
);
|
|
762
771
|
```
|
|
763
772
|
|
|
@@ -769,7 +778,7 @@
|
|
|
769
778
|
|
|
770
779
|
```js
|
|
771
780
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
772
|
-
if (name ===
|
|
781
|
+
if (name === "getColor") {
|
|
773
782
|
callback(data.color);
|
|
774
783
|
}
|
|
775
784
|
};
|
|
@@ -779,7 +788,7 @@
|
|
|
779
788
|
|
|
780
789
|
```js
|
|
781
790
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
782
|
-
if (name ===
|
|
791
|
+
if (name === "getColor" && moduleName === "bridge") {
|
|
783
792
|
return data.color;
|
|
784
793
|
}
|
|
785
794
|
};
|
|
@@ -70,7 +70,7 @@ export async function startMainThreadWorker(uiThreadPort, backgroundThreadPort)
|
|
|
70
70
|
}, markTimingInternal, flushMarkTimingInternal, reportError, triggerI18nResourceFallback, (initI18nResources) => {
|
|
71
71
|
i18nResources.setData(initI18nResources);
|
|
72
72
|
return i18nResources;
|
|
73
|
-
}, loadTemplate);
|
|
73
|
+
}, loadTemplate, undefined, false);
|
|
74
74
|
uiThreadRpc.registerHandler(mainThreadStartEndpoint, async (config) => {
|
|
75
75
|
await startMainThread(config);
|
|
76
76
|
registerUpdateDataHandler(uiThreadRpc, handleUpdatedData);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.1-canary-20251210-47cc2bc6",
|
|
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": "npm:@lynx-js/offscreen-document-canary@0.1.4",
|
|
26
|
-
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.1-canary-20251210-47cc2bc6",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.1-canary-20251210-47cc2bc6",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.1-canary-20251210-47cc2bc6"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|