@lynx-js/web-worker-runtime-canary 0.15.2 → 0.15.3-canary-20250724-0da5ef03
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.3-canary-20250724030837-0da5ef03e41f20e9f8019c6dc03cb4a38ab18854
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`0da5ef0`](https://github.com/lynx-family/lynx-stack/commit/0da5ef03e41f20e9f8019c6dc03cb4a38ab18854)]:
|
|
8
|
+
- @lynx-js/web-constants@0.15.3-canary-20250724030837-0da5ef03e41f20e9f8019c6dc03cb4a38ab18854
|
|
9
|
+
- @lynx-js/web-mainthread-apis@0.15.3-canary-20250724030837-0da5ef03e41f20e9f8019c6dc03cb4a38ab18854
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.15.3-canary-20250724030837-0da5ef03e41f20e9f8019c6dc03cb4a38ab18854
|
|
11
|
+
|
|
3
12
|
## 0.15.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -43,14 +52,14 @@
|
|
|
43
52
|
Usage:
|
|
44
53
|
|
|
45
54
|
```ts
|
|
46
|
-
import { pluginWebPlatform } from
|
|
47
|
-
import { defineConfig } from
|
|
55
|
+
import { pluginWebPlatform } from "@lynx-js/web-platform-rsbuild-plugin";
|
|
56
|
+
import { defineConfig } from "@rsbuild/core";
|
|
48
57
|
|
|
49
58
|
export default defineConfig({
|
|
50
59
|
plugins: [
|
|
51
60
|
pluginWebPlatform({
|
|
52
61
|
// replace with your actual napi-modules file path
|
|
53
|
-
napiModulesPath: path.resolve(__dirname,
|
|
62
|
+
napiModulesPath: path.resolve(__dirname, "./index.napi-modules.ts"),
|
|
54
63
|
}),
|
|
55
64
|
],
|
|
56
65
|
});
|
|
@@ -61,10 +70,10 @@
|
|
|
61
70
|
```ts
|
|
62
71
|
// index.napi-modules.ts
|
|
63
72
|
export default {
|
|
64
|
-
custom_module: function(NapiModules, NapiModulesCall) {
|
|
73
|
+
custom_module: function (NapiModules, NapiModulesCall) {
|
|
65
74
|
return {
|
|
66
75
|
async test(name) {
|
|
67
|
-
console.log(
|
|
76
|
+
console.log("CustomModule", NapiModules, NapiModulesCall);
|
|
68
77
|
},
|
|
69
78
|
};
|
|
70
79
|
},
|
|
@@ -116,25 +125,25 @@
|
|
|
116
125
|
lynxView.initI18nResources = [
|
|
117
126
|
{
|
|
118
127
|
options: {
|
|
119
|
-
locale:
|
|
120
|
-
channel:
|
|
121
|
-
fallback_url:
|
|
128
|
+
locale: "en",
|
|
129
|
+
channel: "1",
|
|
130
|
+
fallback_url: "",
|
|
122
131
|
},
|
|
123
132
|
resource: {
|
|
124
|
-
hello:
|
|
125
|
-
lynx:
|
|
133
|
+
hello: "hello",
|
|
134
|
+
lynx: "lynx web platform1",
|
|
126
135
|
},
|
|
127
136
|
},
|
|
128
137
|
];
|
|
129
|
-
lynxView.addEventListener(
|
|
138
|
+
lynxView.addEventListener("i18nResourceMissed", (e) => {
|
|
130
139
|
console.log(e);
|
|
131
140
|
});
|
|
132
141
|
|
|
133
142
|
// mts
|
|
134
143
|
_I18nResourceTranslation({
|
|
135
|
-
locale:
|
|
136
|
-
channel:
|
|
137
|
-
fallback_url:
|
|
144
|
+
locale: "en",
|
|
145
|
+
channel: "1",
|
|
146
|
+
fallback_url: "",
|
|
138
147
|
});
|
|
139
148
|
```
|
|
140
149
|
|
|
@@ -384,8 +393,8 @@
|
|
|
384
393
|
}
|
|
385
394
|
};`,
|
|
386
395
|
],
|
|
387
|
-
{ type:
|
|
388
|
-
)
|
|
396
|
+
{ type: "text/javascript" }
|
|
397
|
+
)
|
|
389
398
|
),
|
|
390
399
|
};
|
|
391
400
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -475,8 +484,8 @@
|
|
|
475
484
|
};
|
|
476
485
|
};`,
|
|
477
486
|
],
|
|
478
|
-
{ type:
|
|
479
|
-
)
|
|
487
|
+
{ type: "text/javascript" }
|
|
488
|
+
)
|
|
480
489
|
);
|
|
481
490
|
|
|
482
491
|
const color_methods = URL.createObjectURL(
|
|
@@ -491,8 +500,8 @@
|
|
|
491
500
|
};
|
|
492
501
|
};`,
|
|
493
502
|
],
|
|
494
|
-
{ type:
|
|
495
|
-
)
|
|
503
|
+
{ type: "text/javascript" }
|
|
504
|
+
)
|
|
496
505
|
);
|
|
497
506
|
|
|
498
507
|
lynxView.napiModuleMap = {
|
|
@@ -509,7 +518,7 @@
|
|
|
509
518
|
|
|
510
519
|
```js
|
|
511
520
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
512
|
-
if (name ===
|
|
521
|
+
if (name === "getColor" && moduleName === "color_methods") {
|
|
513
522
|
return data.color;
|
|
514
523
|
}
|
|
515
524
|
};
|
|
@@ -564,8 +573,8 @@
|
|
|
564
573
|
}
|
|
565
574
|
};`,
|
|
566
575
|
],
|
|
567
|
-
{ type:
|
|
568
|
-
)
|
|
576
|
+
{ type: "text/javascript" }
|
|
577
|
+
)
|
|
569
578
|
);
|
|
570
579
|
```
|
|
571
580
|
|
|
@@ -577,7 +586,7 @@
|
|
|
577
586
|
|
|
578
587
|
```js
|
|
579
588
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
580
|
-
if (name ===
|
|
589
|
+
if (name === "getColor") {
|
|
581
590
|
callback(data.color);
|
|
582
591
|
}
|
|
583
592
|
};
|
|
@@ -587,7 +596,7 @@
|
|
|
587
596
|
|
|
588
597
|
```js
|
|
589
598
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
590
|
-
if (name ===
|
|
599
|
+
if (name === "getColor" && moduleName === "bridge") {
|
|
591
600
|
return data.color;
|
|
592
601
|
}
|
|
593
602
|
};
|
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.3-canary-20250724-0da5ef03",
|
|
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.3-canary-20250724-0da5ef03",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.3-canary-20250724-0da5ef03",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.3-canary-20250724-0da5ef03"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.2"
|