@lynx-js/web-worker-runtime-canary 0.16.1 → 0.17.0-canary-20250918-b69a986a
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,14 @@
|
|
|
1
1
|
# @lynx-js/web-worker-runtime
|
|
2
2
|
|
|
3
|
+
## 0.17.0-canary-20250918085607-b69a986acd19ecbcb6246a7c9dccd99544415131
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`721635d`](https://github.com/lynx-family/lynx-stack/commit/721635de6c1d2d617c7cbaa86e7d816c42d62930), [`93d707b`](https://github.com/lynx-family/lynx-stack/commit/93d707b82a59f7256952e21da6dcad2999f8233d)]:
|
|
8
|
+
- @lynx-js/web-mainthread-apis@0.17.0-canary-20250918085607-b69a986acd19ecbcb6246a7c9dccd99544415131
|
|
9
|
+
- @lynx-js/web-constants@0.17.0-canary-20250918085607-b69a986acd19ecbcb6246a7c9dccd99544415131
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.17.0-canary-20250918085607-b69a986acd19ecbcb6246a7c9dccd99544415131
|
|
11
|
+
|
|
3
12
|
## 0.16.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -133,14 +142,14 @@
|
|
|
133
142
|
Usage:
|
|
134
143
|
|
|
135
144
|
```ts
|
|
136
|
-
import { pluginWebPlatform } from
|
|
137
|
-
import { defineConfig } from
|
|
145
|
+
import { pluginWebPlatform } from "@lynx-js/web-platform-rsbuild-plugin";
|
|
146
|
+
import { defineConfig } from "@rsbuild/core";
|
|
138
147
|
|
|
139
148
|
export default defineConfig({
|
|
140
149
|
plugins: [
|
|
141
150
|
pluginWebPlatform({
|
|
142
151
|
// replace with your actual napi-modules file path
|
|
143
|
-
napiModulesPath: path.resolve(__dirname,
|
|
152
|
+
napiModulesPath: path.resolve(__dirname, "./index.napi-modules.ts"),
|
|
144
153
|
}),
|
|
145
154
|
],
|
|
146
155
|
});
|
|
@@ -151,10 +160,10 @@
|
|
|
151
160
|
```ts
|
|
152
161
|
// index.napi-modules.ts
|
|
153
162
|
export default {
|
|
154
|
-
custom_module: function(NapiModules, NapiModulesCall) {
|
|
163
|
+
custom_module: function (NapiModules, NapiModulesCall) {
|
|
155
164
|
return {
|
|
156
165
|
async test(name) {
|
|
157
|
-
console.log(
|
|
166
|
+
console.log("CustomModule", NapiModules, NapiModulesCall);
|
|
158
167
|
},
|
|
159
168
|
};
|
|
160
169
|
},
|
|
@@ -206,25 +215,25 @@
|
|
|
206
215
|
lynxView.initI18nResources = [
|
|
207
216
|
{
|
|
208
217
|
options: {
|
|
209
|
-
locale:
|
|
210
|
-
channel:
|
|
211
|
-
fallback_url:
|
|
218
|
+
locale: "en",
|
|
219
|
+
channel: "1",
|
|
220
|
+
fallback_url: "",
|
|
212
221
|
},
|
|
213
222
|
resource: {
|
|
214
|
-
hello:
|
|
215
|
-
lynx:
|
|
223
|
+
hello: "hello",
|
|
224
|
+
lynx: "lynx web platform1",
|
|
216
225
|
},
|
|
217
226
|
},
|
|
218
227
|
];
|
|
219
|
-
lynxView.addEventListener(
|
|
228
|
+
lynxView.addEventListener("i18nResourceMissed", (e) => {
|
|
220
229
|
console.log(e);
|
|
221
230
|
});
|
|
222
231
|
|
|
223
232
|
// mts
|
|
224
233
|
_I18nResourceTranslation({
|
|
225
|
-
locale:
|
|
226
|
-
channel:
|
|
227
|
-
fallback_url:
|
|
234
|
+
locale: "en",
|
|
235
|
+
channel: "1",
|
|
236
|
+
fallback_url: "",
|
|
228
237
|
});
|
|
229
238
|
```
|
|
230
239
|
|
|
@@ -474,8 +483,8 @@
|
|
|
474
483
|
}
|
|
475
484
|
};`,
|
|
476
485
|
],
|
|
477
|
-
{ type:
|
|
478
|
-
)
|
|
486
|
+
{ type: "text/javascript" }
|
|
487
|
+
)
|
|
479
488
|
),
|
|
480
489
|
};
|
|
481
490
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -565,8 +574,8 @@
|
|
|
565
574
|
};
|
|
566
575
|
};`,
|
|
567
576
|
],
|
|
568
|
-
{ type:
|
|
569
|
-
)
|
|
577
|
+
{ type: "text/javascript" }
|
|
578
|
+
)
|
|
570
579
|
);
|
|
571
580
|
|
|
572
581
|
const color_methods = URL.createObjectURL(
|
|
@@ -581,8 +590,8 @@
|
|
|
581
590
|
};
|
|
582
591
|
};`,
|
|
583
592
|
],
|
|
584
|
-
{ type:
|
|
585
|
-
)
|
|
593
|
+
{ type: "text/javascript" }
|
|
594
|
+
)
|
|
586
595
|
);
|
|
587
596
|
|
|
588
597
|
lynxView.napiModuleMap = {
|
|
@@ -599,7 +608,7 @@
|
|
|
599
608
|
|
|
600
609
|
```js
|
|
601
610
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
602
|
-
if (name ===
|
|
611
|
+
if (name === "getColor" && moduleName === "color_methods") {
|
|
603
612
|
return data.color;
|
|
604
613
|
}
|
|
605
614
|
};
|
|
@@ -654,8 +663,8 @@
|
|
|
654
663
|
}
|
|
655
664
|
};`,
|
|
656
665
|
],
|
|
657
|
-
{ type:
|
|
658
|
-
)
|
|
666
|
+
{ type: "text/javascript" }
|
|
667
|
+
)
|
|
659
668
|
);
|
|
660
669
|
```
|
|
661
670
|
|
|
@@ -667,7 +676,7 @@
|
|
|
667
676
|
|
|
668
677
|
```js
|
|
669
678
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
670
|
-
if (name ===
|
|
679
|
+
if (name === "getColor") {
|
|
671
680
|
callback(data.color);
|
|
672
681
|
}
|
|
673
682
|
};
|
|
@@ -677,7 +686,7 @@
|
|
|
677
686
|
|
|
678
687
|
```js
|
|
679
688
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
680
|
-
if (name ===
|
|
689
|
+
if (name === "getColor" && moduleName === "bridge") {
|
|
681
690
|
return data.color;
|
|
682
691
|
}
|
|
683
692
|
};
|
|
@@ -48,6 +48,8 @@ export async function createNativeApp(config) {
|
|
|
48
48
|
?.manifest[`/${sourceURL}`];
|
|
49
49
|
if (manifestUrl)
|
|
50
50
|
sourceURL = manifestUrl;
|
|
51
|
+
else
|
|
52
|
+
throw Error(`Cannot find ${sourceURL} in manifest`);
|
|
51
53
|
globalThis.module.exports = null;
|
|
52
54
|
globalThis.__bundle__holder = null;
|
|
53
55
|
import(
|
|
@@ -62,6 +64,8 @@ export async function createNativeApp(config) {
|
|
|
62
64
|
?.manifest[`/${sourceURL}`];
|
|
63
65
|
if (manifestUrl)
|
|
64
66
|
sourceURL = manifestUrl;
|
|
67
|
+
else
|
|
68
|
+
throw Error(`Cannot find ${sourceURL} in manifest`);
|
|
65
69
|
globalThis.module.exports = null;
|
|
66
70
|
globalThis.__bundle__holder = null;
|
|
67
71
|
importScripts(sourceURL);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0-canary-20250918-b69a986a",
|
|
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.
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.17.0-canary-20250918-b69a986a",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.17.0-canary-20250918-b69a986a",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.17.0-canary-20250918-b69a986a"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|