@lynx-js/web-worker-runtime-canary 0.18.1 → 0.18.2-canary-20251030-53eed0a5
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.2-canary-20251030071334-53eed0a562fb32455214a94d198f1516cb4359eb
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @lynx-js/web-constants@0.18.2-canary-20251030071334-53eed0a562fb32455214a94d198f1516cb4359eb
|
|
9
|
+
- @lynx-js/web-mainthread-apis@0.18.2-canary-20251030071334-53eed0a562fb32455214a94d198f1516cb4359eb
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.18.2-canary-20251030071334-53eed0a562fb32455214a94d198f1516cb4359eb
|
|
11
|
+
|
|
3
12
|
## 0.18.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -195,14 +204,14 @@
|
|
|
195
204
|
Usage:
|
|
196
205
|
|
|
197
206
|
```ts
|
|
198
|
-
import { pluginWebPlatform } from
|
|
199
|
-
import { defineConfig } from
|
|
207
|
+
import { pluginWebPlatform } from "@lynx-js/web-platform-rsbuild-plugin";
|
|
208
|
+
import { defineConfig } from "@rsbuild/core";
|
|
200
209
|
|
|
201
210
|
export default defineConfig({
|
|
202
211
|
plugins: [
|
|
203
212
|
pluginWebPlatform({
|
|
204
213
|
// replace with your actual napi-modules file path
|
|
205
|
-
napiModulesPath: path.resolve(__dirname,
|
|
214
|
+
napiModulesPath: path.resolve(__dirname, "./index.napi-modules.ts"),
|
|
206
215
|
}),
|
|
207
216
|
],
|
|
208
217
|
});
|
|
@@ -213,10 +222,10 @@
|
|
|
213
222
|
```ts
|
|
214
223
|
// index.napi-modules.ts
|
|
215
224
|
export default {
|
|
216
|
-
custom_module: function(NapiModules, NapiModulesCall) {
|
|
225
|
+
custom_module: function (NapiModules, NapiModulesCall) {
|
|
217
226
|
return {
|
|
218
227
|
async test(name) {
|
|
219
|
-
console.log(
|
|
228
|
+
console.log("CustomModule", NapiModules, NapiModulesCall);
|
|
220
229
|
},
|
|
221
230
|
};
|
|
222
231
|
},
|
|
@@ -268,25 +277,25 @@
|
|
|
268
277
|
lynxView.initI18nResources = [
|
|
269
278
|
{
|
|
270
279
|
options: {
|
|
271
|
-
locale:
|
|
272
|
-
channel:
|
|
273
|
-
fallback_url:
|
|
280
|
+
locale: "en",
|
|
281
|
+
channel: "1",
|
|
282
|
+
fallback_url: "",
|
|
274
283
|
},
|
|
275
284
|
resource: {
|
|
276
|
-
hello:
|
|
277
|
-
lynx:
|
|
285
|
+
hello: "hello",
|
|
286
|
+
lynx: "lynx web platform1",
|
|
278
287
|
},
|
|
279
288
|
},
|
|
280
289
|
];
|
|
281
|
-
lynxView.addEventListener(
|
|
290
|
+
lynxView.addEventListener("i18nResourceMissed", (e) => {
|
|
282
291
|
console.log(e);
|
|
283
292
|
});
|
|
284
293
|
|
|
285
294
|
// mts
|
|
286
295
|
_I18nResourceTranslation({
|
|
287
|
-
locale:
|
|
288
|
-
channel:
|
|
289
|
-
fallback_url:
|
|
296
|
+
locale: "en",
|
|
297
|
+
channel: "1",
|
|
298
|
+
fallback_url: "",
|
|
290
299
|
});
|
|
291
300
|
```
|
|
292
301
|
|
|
@@ -536,8 +545,8 @@
|
|
|
536
545
|
}
|
|
537
546
|
};`,
|
|
538
547
|
],
|
|
539
|
-
{ type:
|
|
540
|
-
)
|
|
548
|
+
{ type: "text/javascript" }
|
|
549
|
+
)
|
|
541
550
|
),
|
|
542
551
|
};
|
|
543
552
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -627,8 +636,8 @@
|
|
|
627
636
|
};
|
|
628
637
|
};`,
|
|
629
638
|
],
|
|
630
|
-
{ type:
|
|
631
|
-
)
|
|
639
|
+
{ type: "text/javascript" }
|
|
640
|
+
)
|
|
632
641
|
);
|
|
633
642
|
|
|
634
643
|
const color_methods = URL.createObjectURL(
|
|
@@ -643,8 +652,8 @@
|
|
|
643
652
|
};
|
|
644
653
|
};`,
|
|
645
654
|
],
|
|
646
|
-
{ type:
|
|
647
|
-
)
|
|
655
|
+
{ type: "text/javascript" }
|
|
656
|
+
)
|
|
648
657
|
);
|
|
649
658
|
|
|
650
659
|
lynxView.napiModuleMap = {
|
|
@@ -661,7 +670,7 @@
|
|
|
661
670
|
|
|
662
671
|
```js
|
|
663
672
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
664
|
-
if (name ===
|
|
673
|
+
if (name === "getColor" && moduleName === "color_methods") {
|
|
665
674
|
return data.color;
|
|
666
675
|
}
|
|
667
676
|
};
|
|
@@ -716,8 +725,8 @@
|
|
|
716
725
|
}
|
|
717
726
|
};`,
|
|
718
727
|
],
|
|
719
|
-
{ type:
|
|
720
|
-
)
|
|
728
|
+
{ type: "text/javascript" }
|
|
729
|
+
)
|
|
721
730
|
);
|
|
722
731
|
```
|
|
723
732
|
|
|
@@ -729,7 +738,7 @@
|
|
|
729
738
|
|
|
730
739
|
```js
|
|
731
740
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
732
|
-
if (name ===
|
|
741
|
+
if (name === "getColor") {
|
|
733
742
|
callback(data.color);
|
|
734
743
|
}
|
|
735
744
|
};
|
|
@@ -739,7 +748,7 @@
|
|
|
739
748
|
|
|
740
749
|
```js
|
|
741
750
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
742
|
-
if (name ===
|
|
751
|
+
if (name === "getColor" && moduleName === "bridge") {
|
|
743
752
|
return data.color;
|
|
744
753
|
}
|
|
745
754
|
};
|
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.2-canary-20251030-53eed0a5",
|
|
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.2-canary-20251030-53eed0a5",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.18.2-canary-20251030-53eed0a5",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.2-canary-20251030-53eed0a5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|