@lynx-js/web-worker-runtime-canary 0.18.0 → 0.18.1-canary-20251016-70a18fce
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.1-canary-20251016065218-70a18fce0083743e4516eefc91c0392d748b855f
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`70a18fc`](https://github.com/lynx-family/lynx-stack/commit/70a18fce0083743e4516eefc91c0392d748b855f)]:
|
|
8
|
+
- @lynx-js/web-mainthread-apis@0.18.1-canary-20251016065218-70a18fce0083743e4516eefc91c0392d748b855f
|
|
9
|
+
- @lynx-js/web-constants@0.18.1-canary-20251016065218-70a18fce0083743e4516eefc91c0392d748b855f
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.18.1-canary-20251016065218-70a18fce0083743e4516eefc91c0392d748b855f
|
|
11
|
+
|
|
3
12
|
## 0.18.0
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -186,14 +195,14 @@
|
|
|
186
195
|
Usage:
|
|
187
196
|
|
|
188
197
|
```ts
|
|
189
|
-
import { pluginWebPlatform } from
|
|
190
|
-
import { defineConfig } from
|
|
198
|
+
import { pluginWebPlatform } from "@lynx-js/web-platform-rsbuild-plugin";
|
|
199
|
+
import { defineConfig } from "@rsbuild/core";
|
|
191
200
|
|
|
192
201
|
export default defineConfig({
|
|
193
202
|
plugins: [
|
|
194
203
|
pluginWebPlatform({
|
|
195
204
|
// replace with your actual napi-modules file path
|
|
196
|
-
napiModulesPath: path.resolve(__dirname,
|
|
205
|
+
napiModulesPath: path.resolve(__dirname, "./index.napi-modules.ts"),
|
|
197
206
|
}),
|
|
198
207
|
],
|
|
199
208
|
});
|
|
@@ -204,10 +213,10 @@
|
|
|
204
213
|
```ts
|
|
205
214
|
// index.napi-modules.ts
|
|
206
215
|
export default {
|
|
207
|
-
custom_module: function(NapiModules, NapiModulesCall) {
|
|
216
|
+
custom_module: function (NapiModules, NapiModulesCall) {
|
|
208
217
|
return {
|
|
209
218
|
async test(name) {
|
|
210
|
-
console.log(
|
|
219
|
+
console.log("CustomModule", NapiModules, NapiModulesCall);
|
|
211
220
|
},
|
|
212
221
|
};
|
|
213
222
|
},
|
|
@@ -259,25 +268,25 @@
|
|
|
259
268
|
lynxView.initI18nResources = [
|
|
260
269
|
{
|
|
261
270
|
options: {
|
|
262
|
-
locale:
|
|
263
|
-
channel:
|
|
264
|
-
fallback_url:
|
|
271
|
+
locale: "en",
|
|
272
|
+
channel: "1",
|
|
273
|
+
fallback_url: "",
|
|
265
274
|
},
|
|
266
275
|
resource: {
|
|
267
|
-
hello:
|
|
268
|
-
lynx:
|
|
276
|
+
hello: "hello",
|
|
277
|
+
lynx: "lynx web platform1",
|
|
269
278
|
},
|
|
270
279
|
},
|
|
271
280
|
];
|
|
272
|
-
lynxView.addEventListener(
|
|
281
|
+
lynxView.addEventListener("i18nResourceMissed", (e) => {
|
|
273
282
|
console.log(e);
|
|
274
283
|
});
|
|
275
284
|
|
|
276
285
|
// mts
|
|
277
286
|
_I18nResourceTranslation({
|
|
278
|
-
locale:
|
|
279
|
-
channel:
|
|
280
|
-
fallback_url:
|
|
287
|
+
locale: "en",
|
|
288
|
+
channel: "1",
|
|
289
|
+
fallback_url: "",
|
|
281
290
|
});
|
|
282
291
|
```
|
|
283
292
|
|
|
@@ -527,8 +536,8 @@
|
|
|
527
536
|
}
|
|
528
537
|
};`,
|
|
529
538
|
],
|
|
530
|
-
{ type:
|
|
531
|
-
)
|
|
539
|
+
{ type: "text/javascript" }
|
|
540
|
+
)
|
|
532
541
|
),
|
|
533
542
|
};
|
|
534
543
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -618,8 +627,8 @@
|
|
|
618
627
|
};
|
|
619
628
|
};`,
|
|
620
629
|
],
|
|
621
|
-
{ type:
|
|
622
|
-
)
|
|
630
|
+
{ type: "text/javascript" }
|
|
631
|
+
)
|
|
623
632
|
);
|
|
624
633
|
|
|
625
634
|
const color_methods = URL.createObjectURL(
|
|
@@ -634,8 +643,8 @@
|
|
|
634
643
|
};
|
|
635
644
|
};`,
|
|
636
645
|
],
|
|
637
|
-
{ type:
|
|
638
|
-
)
|
|
646
|
+
{ type: "text/javascript" }
|
|
647
|
+
)
|
|
639
648
|
);
|
|
640
649
|
|
|
641
650
|
lynxView.napiModuleMap = {
|
|
@@ -652,7 +661,7 @@
|
|
|
652
661
|
|
|
653
662
|
```js
|
|
654
663
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
655
|
-
if (name ===
|
|
664
|
+
if (name === "getColor" && moduleName === "color_methods") {
|
|
656
665
|
return data.color;
|
|
657
666
|
}
|
|
658
667
|
};
|
|
@@ -707,8 +716,8 @@
|
|
|
707
716
|
}
|
|
708
717
|
};`,
|
|
709
718
|
],
|
|
710
|
-
{ type:
|
|
711
|
-
)
|
|
719
|
+
{ type: "text/javascript" }
|
|
720
|
+
)
|
|
712
721
|
);
|
|
713
722
|
```
|
|
714
723
|
|
|
@@ -720,7 +729,7 @@
|
|
|
720
729
|
|
|
721
730
|
```js
|
|
722
731
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
723
|
-
if (name ===
|
|
732
|
+
if (name === "getColor") {
|
|
724
733
|
callback(data.color);
|
|
725
734
|
}
|
|
726
735
|
};
|
|
@@ -730,7 +739,7 @@
|
|
|
730
739
|
|
|
731
740
|
```js
|
|
732
741
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
733
|
-
if (name ===
|
|
742
|
+
if (name === "getColor" && moduleName === "bridge") {
|
|
734
743
|
return data.color;
|
|
735
744
|
}
|
|
736
745
|
};
|
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.1-canary-20251016-70a18fce",
|
|
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.1-canary-20251016-70a18fce",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.18.1-canary-20251016-70a18fce",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.1-canary-20251016-70a18fce"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|