@lynx-js/web-worker-runtime-canary 0.17.0 → 0.17.1-canary-20250925-9ab108fc
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.17.1-canary-20250925040534-9ab108fc8b1323f8369eacad4b561725713f8ee1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @lynx-js/web-constants@0.17.1-canary-20250925040534-9ab108fc8b1323f8369eacad4b561725713f8ee1
|
|
9
|
+
- @lynx-js/web-mainthread-apis@0.17.1-canary-20250925040534-9ab108fc8b1323f8369eacad4b561725713f8ee1
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.17.1-canary-20250925040534-9ab108fc8b1323f8369eacad4b561725713f8ee1
|
|
11
|
+
|
|
3
12
|
## 0.17.0
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -142,14 +151,14 @@
|
|
|
142
151
|
Usage:
|
|
143
152
|
|
|
144
153
|
```ts
|
|
145
|
-
import { pluginWebPlatform } from
|
|
146
|
-
import { defineConfig } from
|
|
154
|
+
import { pluginWebPlatform } from "@lynx-js/web-platform-rsbuild-plugin";
|
|
155
|
+
import { defineConfig } from "@rsbuild/core";
|
|
147
156
|
|
|
148
157
|
export default defineConfig({
|
|
149
158
|
plugins: [
|
|
150
159
|
pluginWebPlatform({
|
|
151
160
|
// replace with your actual napi-modules file path
|
|
152
|
-
napiModulesPath: path.resolve(__dirname,
|
|
161
|
+
napiModulesPath: path.resolve(__dirname, "./index.napi-modules.ts"),
|
|
153
162
|
}),
|
|
154
163
|
],
|
|
155
164
|
});
|
|
@@ -160,10 +169,10 @@
|
|
|
160
169
|
```ts
|
|
161
170
|
// index.napi-modules.ts
|
|
162
171
|
export default {
|
|
163
|
-
custom_module: function(NapiModules, NapiModulesCall) {
|
|
172
|
+
custom_module: function (NapiModules, NapiModulesCall) {
|
|
164
173
|
return {
|
|
165
174
|
async test(name) {
|
|
166
|
-
console.log(
|
|
175
|
+
console.log("CustomModule", NapiModules, NapiModulesCall);
|
|
167
176
|
},
|
|
168
177
|
};
|
|
169
178
|
},
|
|
@@ -215,25 +224,25 @@
|
|
|
215
224
|
lynxView.initI18nResources = [
|
|
216
225
|
{
|
|
217
226
|
options: {
|
|
218
|
-
locale:
|
|
219
|
-
channel:
|
|
220
|
-
fallback_url:
|
|
227
|
+
locale: "en",
|
|
228
|
+
channel: "1",
|
|
229
|
+
fallback_url: "",
|
|
221
230
|
},
|
|
222
231
|
resource: {
|
|
223
|
-
hello:
|
|
224
|
-
lynx:
|
|
232
|
+
hello: "hello",
|
|
233
|
+
lynx: "lynx web platform1",
|
|
225
234
|
},
|
|
226
235
|
},
|
|
227
236
|
];
|
|
228
|
-
lynxView.addEventListener(
|
|
237
|
+
lynxView.addEventListener("i18nResourceMissed", (e) => {
|
|
229
238
|
console.log(e);
|
|
230
239
|
});
|
|
231
240
|
|
|
232
241
|
// mts
|
|
233
242
|
_I18nResourceTranslation({
|
|
234
|
-
locale:
|
|
235
|
-
channel:
|
|
236
|
-
fallback_url:
|
|
243
|
+
locale: "en",
|
|
244
|
+
channel: "1",
|
|
245
|
+
fallback_url: "",
|
|
237
246
|
});
|
|
238
247
|
```
|
|
239
248
|
|
|
@@ -483,8 +492,8 @@
|
|
|
483
492
|
}
|
|
484
493
|
};`,
|
|
485
494
|
],
|
|
486
|
-
{ type:
|
|
487
|
-
)
|
|
495
|
+
{ type: "text/javascript" }
|
|
496
|
+
)
|
|
488
497
|
),
|
|
489
498
|
};
|
|
490
499
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -574,8 +583,8 @@
|
|
|
574
583
|
};
|
|
575
584
|
};`,
|
|
576
585
|
],
|
|
577
|
-
{ type:
|
|
578
|
-
)
|
|
586
|
+
{ type: "text/javascript" }
|
|
587
|
+
)
|
|
579
588
|
);
|
|
580
589
|
|
|
581
590
|
const color_methods = URL.createObjectURL(
|
|
@@ -590,8 +599,8 @@
|
|
|
590
599
|
};
|
|
591
600
|
};`,
|
|
592
601
|
],
|
|
593
|
-
{ type:
|
|
594
|
-
)
|
|
602
|
+
{ type: "text/javascript" }
|
|
603
|
+
)
|
|
595
604
|
);
|
|
596
605
|
|
|
597
606
|
lynxView.napiModuleMap = {
|
|
@@ -608,7 +617,7 @@
|
|
|
608
617
|
|
|
609
618
|
```js
|
|
610
619
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
611
|
-
if (name ===
|
|
620
|
+
if (name === "getColor" && moduleName === "color_methods") {
|
|
612
621
|
return data.color;
|
|
613
622
|
}
|
|
614
623
|
};
|
|
@@ -663,8 +672,8 @@
|
|
|
663
672
|
}
|
|
664
673
|
};`,
|
|
665
674
|
],
|
|
666
|
-
{ type:
|
|
667
|
-
)
|
|
675
|
+
{ type: "text/javascript" }
|
|
676
|
+
)
|
|
668
677
|
);
|
|
669
678
|
```
|
|
670
679
|
|
|
@@ -676,7 +685,7 @@
|
|
|
676
685
|
|
|
677
686
|
```js
|
|
678
687
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
679
|
-
if (name ===
|
|
688
|
+
if (name === "getColor") {
|
|
680
689
|
callback(data.color);
|
|
681
690
|
}
|
|
682
691
|
};
|
|
@@ -686,7 +695,7 @@
|
|
|
686
695
|
|
|
687
696
|
```js
|
|
688
697
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
689
|
-
if (name ===
|
|
698
|
+
if (name === "getColor" && moduleName === "bridge") {
|
|
690
699
|
return data.color;
|
|
691
700
|
}
|
|
692
701
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.1-canary-20250925-9ab108fc",
|
|
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.17.
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.17.
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.17.
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.17.1-canary-20250925-9ab108fc",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.17.1-canary-20250925-9ab108fc",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.17.1-canary-20250925-9ab108fc"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|