@lynx-js/web-worker-runtime-canary 0.15.3-canary-20250728-58c82e92 → 0.15.3
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 +29 -29
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# @lynx-js/web-worker-runtime
|
|
2
2
|
|
|
3
|
-
## 0.15.3
|
|
3
|
+
## 0.15.3
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies [[`0da5ef0`](https://github.com/lynx-family/lynx-stack/commit/0da5ef03e41f20e9f8019c6dc03cb4a38ab18854)]:
|
|
8
|
-
- @lynx-js/web-constants@0.15.3
|
|
9
|
-
- @lynx-js/web-mainthread-apis@0.15.3
|
|
10
|
-
- @lynx-js/web-worker-rpc@0.15.3
|
|
8
|
+
- @lynx-js/web-constants@0.15.3
|
|
9
|
+
- @lynx-js/web-mainthread-apis@0.15.3
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.15.3
|
|
11
11
|
|
|
12
12
|
## 0.15.2
|
|
13
13
|
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
Usage:
|
|
53
53
|
|
|
54
54
|
```ts
|
|
55
|
-
import { pluginWebPlatform } from
|
|
56
|
-
import { defineConfig } from
|
|
55
|
+
import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
|
|
56
|
+
import { defineConfig } from '@rsbuild/core';
|
|
57
57
|
|
|
58
58
|
export default defineConfig({
|
|
59
59
|
plugins: [
|
|
60
60
|
pluginWebPlatform({
|
|
61
61
|
// replace with your actual napi-modules file path
|
|
62
|
-
napiModulesPath: path.resolve(__dirname,
|
|
62
|
+
napiModulesPath: path.resolve(__dirname, './index.napi-modules.ts'),
|
|
63
63
|
}),
|
|
64
64
|
],
|
|
65
65
|
});
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
```ts
|
|
71
71
|
// index.napi-modules.ts
|
|
72
72
|
export default {
|
|
73
|
-
custom_module: function
|
|
73
|
+
custom_module: function(NapiModules, NapiModulesCall) {
|
|
74
74
|
return {
|
|
75
75
|
async test(name) {
|
|
76
|
-
console.log(
|
|
76
|
+
console.log('CustomModule', NapiModules, NapiModulesCall);
|
|
77
77
|
},
|
|
78
78
|
};
|
|
79
79
|
},
|
|
@@ -125,25 +125,25 @@
|
|
|
125
125
|
lynxView.initI18nResources = [
|
|
126
126
|
{
|
|
127
127
|
options: {
|
|
128
|
-
locale:
|
|
129
|
-
channel:
|
|
130
|
-
fallback_url:
|
|
128
|
+
locale: 'en',
|
|
129
|
+
channel: '1',
|
|
130
|
+
fallback_url: '',
|
|
131
131
|
},
|
|
132
132
|
resource: {
|
|
133
|
-
hello:
|
|
134
|
-
lynx:
|
|
133
|
+
hello: 'hello',
|
|
134
|
+
lynx: 'lynx web platform1',
|
|
135
135
|
},
|
|
136
136
|
},
|
|
137
137
|
];
|
|
138
|
-
lynxView.addEventListener(
|
|
138
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
139
139
|
console.log(e);
|
|
140
140
|
});
|
|
141
141
|
|
|
142
142
|
// mts
|
|
143
143
|
_I18nResourceTranslation({
|
|
144
|
-
locale:
|
|
145
|
-
channel:
|
|
146
|
-
fallback_url:
|
|
144
|
+
locale: 'en',
|
|
145
|
+
channel: '1',
|
|
146
|
+
fallback_url: '',
|
|
147
147
|
});
|
|
148
148
|
```
|
|
149
149
|
|
|
@@ -393,8 +393,8 @@
|
|
|
393
393
|
}
|
|
394
394
|
};`,
|
|
395
395
|
],
|
|
396
|
-
{ type:
|
|
397
|
-
)
|
|
396
|
+
{ type: 'text/javascript' },
|
|
397
|
+
),
|
|
398
398
|
),
|
|
399
399
|
};
|
|
400
400
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -484,8 +484,8 @@
|
|
|
484
484
|
};
|
|
485
485
|
};`,
|
|
486
486
|
],
|
|
487
|
-
{ type:
|
|
488
|
-
)
|
|
487
|
+
{ type: 'text/javascript' },
|
|
488
|
+
),
|
|
489
489
|
);
|
|
490
490
|
|
|
491
491
|
const color_methods = URL.createObjectURL(
|
|
@@ -500,8 +500,8 @@
|
|
|
500
500
|
};
|
|
501
501
|
};`,
|
|
502
502
|
],
|
|
503
|
-
{ type:
|
|
504
|
-
)
|
|
503
|
+
{ type: 'text/javascript' },
|
|
504
|
+
),
|
|
505
505
|
);
|
|
506
506
|
|
|
507
507
|
lynxView.napiModuleMap = {
|
|
@@ -518,7 +518,7 @@
|
|
|
518
518
|
|
|
519
519
|
```js
|
|
520
520
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
521
|
-
if (name ===
|
|
521
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
522
522
|
return data.color;
|
|
523
523
|
}
|
|
524
524
|
};
|
|
@@ -573,8 +573,8 @@
|
|
|
573
573
|
}
|
|
574
574
|
};`,
|
|
575
575
|
],
|
|
576
|
-
{ type:
|
|
577
|
-
)
|
|
576
|
+
{ type: 'text/javascript' },
|
|
577
|
+
),
|
|
578
578
|
);
|
|
579
579
|
```
|
|
580
580
|
|
|
@@ -586,7 +586,7 @@
|
|
|
586
586
|
|
|
587
587
|
```js
|
|
588
588
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
589
|
-
if (name ===
|
|
589
|
+
if (name === 'getColor') {
|
|
590
590
|
callback(data.color);
|
|
591
591
|
}
|
|
592
592
|
};
|
|
@@ -596,7 +596,7 @@
|
|
|
596
596
|
|
|
597
597
|
```js
|
|
598
598
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
599
|
-
if (name ===
|
|
599
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
600
600
|
return data.color;
|
|
601
601
|
}
|
|
602
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
|
|
3
|
+
"version": "0.15.3",
|
|
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.3
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.3
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.3
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.15.3",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.3",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.2"
|