@lynx-js/web-worker-runtime-canary 0.15.4 → 0.15.5-canary-20250806-5b6cdc37
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.15.5-canary-20250806045727-5b6cdc3757ede85a59e44917ae3fe02f6de9a6da
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`29434ae`](https://github.com/lynx-family/lynx-stack/commit/29434aec853f14242f521316429cf07a93b8c371)]:
|
|
8
|
+
- @lynx-js/web-mainthread-apis@0.15.5-canary-20250806045727-5b6cdc3757ede85a59e44917ae3fe02f6de9a6da
|
|
9
|
+
- @lynx-js/web-constants@0.15.5-canary-20250806045727-5b6cdc3757ede85a59e44917ae3fe02f6de9a6da
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.15.5-canary-20250806045727-5b6cdc3757ede85a59e44917ae3fe02f6de9a6da
|
|
11
|
+
|
|
3
12
|
## 0.15.4
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -63,14 +72,14 @@
|
|
|
63
72
|
Usage:
|
|
64
73
|
|
|
65
74
|
```ts
|
|
66
|
-
import { pluginWebPlatform } from
|
|
67
|
-
import { defineConfig } from
|
|
75
|
+
import { pluginWebPlatform } from "@lynx-js/web-platform-rsbuild-plugin";
|
|
76
|
+
import { defineConfig } from "@rsbuild/core";
|
|
68
77
|
|
|
69
78
|
export default defineConfig({
|
|
70
79
|
plugins: [
|
|
71
80
|
pluginWebPlatform({
|
|
72
81
|
// replace with your actual napi-modules file path
|
|
73
|
-
napiModulesPath: path.resolve(__dirname,
|
|
82
|
+
napiModulesPath: path.resolve(__dirname, "./index.napi-modules.ts"),
|
|
74
83
|
}),
|
|
75
84
|
],
|
|
76
85
|
});
|
|
@@ -81,10 +90,10 @@
|
|
|
81
90
|
```ts
|
|
82
91
|
// index.napi-modules.ts
|
|
83
92
|
export default {
|
|
84
|
-
custom_module: function(NapiModules, NapiModulesCall) {
|
|
93
|
+
custom_module: function (NapiModules, NapiModulesCall) {
|
|
85
94
|
return {
|
|
86
95
|
async test(name) {
|
|
87
|
-
console.log(
|
|
96
|
+
console.log("CustomModule", NapiModules, NapiModulesCall);
|
|
88
97
|
},
|
|
89
98
|
};
|
|
90
99
|
},
|
|
@@ -136,25 +145,25 @@
|
|
|
136
145
|
lynxView.initI18nResources = [
|
|
137
146
|
{
|
|
138
147
|
options: {
|
|
139
|
-
locale:
|
|
140
|
-
channel:
|
|
141
|
-
fallback_url:
|
|
148
|
+
locale: "en",
|
|
149
|
+
channel: "1",
|
|
150
|
+
fallback_url: "",
|
|
142
151
|
},
|
|
143
152
|
resource: {
|
|
144
|
-
hello:
|
|
145
|
-
lynx:
|
|
153
|
+
hello: "hello",
|
|
154
|
+
lynx: "lynx web platform1",
|
|
146
155
|
},
|
|
147
156
|
},
|
|
148
157
|
];
|
|
149
|
-
lynxView.addEventListener(
|
|
158
|
+
lynxView.addEventListener("i18nResourceMissed", (e) => {
|
|
150
159
|
console.log(e);
|
|
151
160
|
});
|
|
152
161
|
|
|
153
162
|
// mts
|
|
154
163
|
_I18nResourceTranslation({
|
|
155
|
-
locale:
|
|
156
|
-
channel:
|
|
157
|
-
fallback_url:
|
|
164
|
+
locale: "en",
|
|
165
|
+
channel: "1",
|
|
166
|
+
fallback_url: "",
|
|
158
167
|
});
|
|
159
168
|
```
|
|
160
169
|
|
|
@@ -404,8 +413,8 @@
|
|
|
404
413
|
}
|
|
405
414
|
};`,
|
|
406
415
|
],
|
|
407
|
-
{ type:
|
|
408
|
-
)
|
|
416
|
+
{ type: "text/javascript" }
|
|
417
|
+
)
|
|
409
418
|
),
|
|
410
419
|
};
|
|
411
420
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -495,8 +504,8 @@
|
|
|
495
504
|
};
|
|
496
505
|
};`,
|
|
497
506
|
],
|
|
498
|
-
{ type:
|
|
499
|
-
)
|
|
507
|
+
{ type: "text/javascript" }
|
|
508
|
+
)
|
|
500
509
|
);
|
|
501
510
|
|
|
502
511
|
const color_methods = URL.createObjectURL(
|
|
@@ -511,8 +520,8 @@
|
|
|
511
520
|
};
|
|
512
521
|
};`,
|
|
513
522
|
],
|
|
514
|
-
{ type:
|
|
515
|
-
)
|
|
523
|
+
{ type: "text/javascript" }
|
|
524
|
+
)
|
|
516
525
|
);
|
|
517
526
|
|
|
518
527
|
lynxView.napiModuleMap = {
|
|
@@ -529,7 +538,7 @@
|
|
|
529
538
|
|
|
530
539
|
```js
|
|
531
540
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
532
|
-
if (name ===
|
|
541
|
+
if (name === "getColor" && moduleName === "color_methods") {
|
|
533
542
|
return data.color;
|
|
534
543
|
}
|
|
535
544
|
};
|
|
@@ -584,8 +593,8 @@
|
|
|
584
593
|
}
|
|
585
594
|
};`,
|
|
586
595
|
],
|
|
587
|
-
{ type:
|
|
588
|
-
)
|
|
596
|
+
{ type: "text/javascript" }
|
|
597
|
+
)
|
|
589
598
|
);
|
|
590
599
|
```
|
|
591
600
|
|
|
@@ -597,7 +606,7 @@
|
|
|
597
606
|
|
|
598
607
|
```js
|
|
599
608
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
600
|
-
if (name ===
|
|
609
|
+
if (name === "getColor") {
|
|
601
610
|
callback(data.color);
|
|
602
611
|
}
|
|
603
612
|
};
|
|
@@ -607,7 +616,7 @@
|
|
|
607
616
|
|
|
608
617
|
```js
|
|
609
618
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
610
|
-
if (name ===
|
|
619
|
+
if (name === "getColor" && moduleName === "bridge") {
|
|
611
620
|
return data.color;
|
|
612
621
|
}
|
|
613
622
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.5-canary-20250806-5b6cdc37",
|
|
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.3",
|
|
26
|
-
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.15.
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.15.5-canary-20250806-5b6cdc37",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.5-canary-20250806-5b6cdc37",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.5-canary-20250806-5b6cdc37"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.2"
|