@lynx-js/web-worker-runtime-canary 0.18.2 → 0.18.3-canary-20251104-e7d186a6
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/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @lynx-js/web-worker-runtime
|
|
2
2
|
|
|
3
|
+
## 0.18.3-canary-20251104063141-e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`fece7d0`](https://github.com/lynx-family/lynx-stack/commit/fece7d0a92fa76948488373757a27dff52a90437)]:
|
|
8
|
+
- @lynx-js/web-mainthread-apis@0.18.3-canary-20251104063141-e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3
|
|
9
|
+
- @lynx-js/web-constants@0.18.3-canary-20251104063141-e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.18.3-canary-20251104063141-e7d186a6fcf08fecf18b5ab82b004b955bb1a2b3
|
|
11
|
+
|
|
3
12
|
## 0.18.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -204,14 +213,14 @@
|
|
|
204
213
|
Usage:
|
|
205
214
|
|
|
206
215
|
```ts
|
|
207
|
-
import { pluginWebPlatform } from
|
|
208
|
-
import { defineConfig } from
|
|
216
|
+
import { pluginWebPlatform } from "@lynx-js/web-platform-rsbuild-plugin";
|
|
217
|
+
import { defineConfig } from "@rsbuild/core";
|
|
209
218
|
|
|
210
219
|
export default defineConfig({
|
|
211
220
|
plugins: [
|
|
212
221
|
pluginWebPlatform({
|
|
213
222
|
// replace with your actual napi-modules file path
|
|
214
|
-
napiModulesPath: path.resolve(__dirname,
|
|
223
|
+
napiModulesPath: path.resolve(__dirname, "./index.napi-modules.ts"),
|
|
215
224
|
}),
|
|
216
225
|
],
|
|
217
226
|
});
|
|
@@ -222,10 +231,10 @@
|
|
|
222
231
|
```ts
|
|
223
232
|
// index.napi-modules.ts
|
|
224
233
|
export default {
|
|
225
|
-
custom_module: function(NapiModules, NapiModulesCall) {
|
|
234
|
+
custom_module: function (NapiModules, NapiModulesCall) {
|
|
226
235
|
return {
|
|
227
236
|
async test(name) {
|
|
228
|
-
console.log(
|
|
237
|
+
console.log("CustomModule", NapiModules, NapiModulesCall);
|
|
229
238
|
},
|
|
230
239
|
};
|
|
231
240
|
},
|
|
@@ -277,25 +286,25 @@
|
|
|
277
286
|
lynxView.initI18nResources = [
|
|
278
287
|
{
|
|
279
288
|
options: {
|
|
280
|
-
locale:
|
|
281
|
-
channel:
|
|
282
|
-
fallback_url:
|
|
289
|
+
locale: "en",
|
|
290
|
+
channel: "1",
|
|
291
|
+
fallback_url: "",
|
|
283
292
|
},
|
|
284
293
|
resource: {
|
|
285
|
-
hello:
|
|
286
|
-
lynx:
|
|
294
|
+
hello: "hello",
|
|
295
|
+
lynx: "lynx web platform1",
|
|
287
296
|
},
|
|
288
297
|
},
|
|
289
298
|
];
|
|
290
|
-
lynxView.addEventListener(
|
|
299
|
+
lynxView.addEventListener("i18nResourceMissed", (e) => {
|
|
291
300
|
console.log(e);
|
|
292
301
|
});
|
|
293
302
|
|
|
294
303
|
// mts
|
|
295
304
|
_I18nResourceTranslation({
|
|
296
|
-
locale:
|
|
297
|
-
channel:
|
|
298
|
-
fallback_url:
|
|
305
|
+
locale: "en",
|
|
306
|
+
channel: "1",
|
|
307
|
+
fallback_url: "",
|
|
299
308
|
});
|
|
300
309
|
```
|
|
301
310
|
|
|
@@ -545,8 +554,8 @@
|
|
|
545
554
|
}
|
|
546
555
|
};`,
|
|
547
556
|
],
|
|
548
|
-
{ type:
|
|
549
|
-
)
|
|
557
|
+
{ type: "text/javascript" }
|
|
558
|
+
)
|
|
550
559
|
),
|
|
551
560
|
};
|
|
552
561
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -636,8 +645,8 @@
|
|
|
636
645
|
};
|
|
637
646
|
};`,
|
|
638
647
|
],
|
|
639
|
-
{ type:
|
|
640
|
-
)
|
|
648
|
+
{ type: "text/javascript" }
|
|
649
|
+
)
|
|
641
650
|
);
|
|
642
651
|
|
|
643
652
|
const color_methods = URL.createObjectURL(
|
|
@@ -652,8 +661,8 @@
|
|
|
652
661
|
};
|
|
653
662
|
};`,
|
|
654
663
|
],
|
|
655
|
-
{ type:
|
|
656
|
-
)
|
|
664
|
+
{ type: "text/javascript" }
|
|
665
|
+
)
|
|
657
666
|
);
|
|
658
667
|
|
|
659
668
|
lynxView.napiModuleMap = {
|
|
@@ -670,7 +679,7 @@
|
|
|
670
679
|
|
|
671
680
|
```js
|
|
672
681
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
673
|
-
if (name ===
|
|
682
|
+
if (name === "getColor" && moduleName === "color_methods") {
|
|
674
683
|
return data.color;
|
|
675
684
|
}
|
|
676
685
|
};
|
|
@@ -725,8 +734,8 @@
|
|
|
725
734
|
}
|
|
726
735
|
};`,
|
|
727
736
|
],
|
|
728
|
-
{ type:
|
|
729
|
-
)
|
|
737
|
+
{ type: "text/javascript" }
|
|
738
|
+
)
|
|
730
739
|
);
|
|
731
740
|
```
|
|
732
741
|
|
|
@@ -738,7 +747,7 @@
|
|
|
738
747
|
|
|
739
748
|
```js
|
|
740
749
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
741
|
-
if (name ===
|
|
750
|
+
if (name === "getColor") {
|
|
742
751
|
callback(data.color);
|
|
743
752
|
}
|
|
744
753
|
};
|
|
@@ -748,7 +757,7 @@
|
|
|
748
757
|
|
|
749
758
|
```js
|
|
750
759
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
751
|
-
if (name ===
|
|
760
|
+
if (name === "getColor" && moduleName === "bridge") {
|
|
752
761
|
return data.color;
|
|
753
762
|
}
|
|
754
763
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.3-canary-20251104-e7d186a6",
|
|
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.18.
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.18.
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.18.3-canary-20251104-e7d186a6",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.18.3-canary-20251104-e7d186a6",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.3-canary-20251104-e7d186a6"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|