@lynx-js/web-worker-runtime-canary 0.16.1-canary-20250915-59a0d600 → 0.16.1
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,15 +1,15 @@
|
|
|
1
1
|
# @lynx-js/web-worker-runtime
|
|
2
2
|
|
|
3
|
-
## 0.16.1
|
|
3
|
+
## 0.16.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- feat: supports lazy bundle. (This feature requires `@lynx-js/lynx-core >= 0.1.3`) ([#1235](https://github.com/lynx-family/lynx-stack/pull/1235))
|
|
8
8
|
|
|
9
9
|
- Updated dependencies [[`608f375`](https://github.com/lynx-family/lynx-stack/commit/608f375e20732cc4c9f141bfbf9800ba6896100b)]:
|
|
10
|
-
- @lynx-js/web-mainthread-apis@0.16.1
|
|
11
|
-
- @lynx-js/web-constants@0.16.1
|
|
12
|
-
- @lynx-js/web-worker-rpc@0.16.1
|
|
10
|
+
- @lynx-js/web-mainthread-apis@0.16.1
|
|
11
|
+
- @lynx-js/web-constants@0.16.1
|
|
12
|
+
- @lynx-js/web-worker-rpc@0.16.1
|
|
13
13
|
|
|
14
14
|
## 0.16.0
|
|
15
15
|
|
|
@@ -133,14 +133,14 @@
|
|
|
133
133
|
Usage:
|
|
134
134
|
|
|
135
135
|
```ts
|
|
136
|
-
import { pluginWebPlatform } from
|
|
137
|
-
import { defineConfig } from
|
|
136
|
+
import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
|
|
137
|
+
import { defineConfig } from '@rsbuild/core';
|
|
138
138
|
|
|
139
139
|
export default defineConfig({
|
|
140
140
|
plugins: [
|
|
141
141
|
pluginWebPlatform({
|
|
142
142
|
// replace with your actual napi-modules file path
|
|
143
|
-
napiModulesPath: path.resolve(__dirname,
|
|
143
|
+
napiModulesPath: path.resolve(__dirname, './index.napi-modules.ts'),
|
|
144
144
|
}),
|
|
145
145
|
],
|
|
146
146
|
});
|
|
@@ -151,10 +151,10 @@
|
|
|
151
151
|
```ts
|
|
152
152
|
// index.napi-modules.ts
|
|
153
153
|
export default {
|
|
154
|
-
custom_module: function
|
|
154
|
+
custom_module: function(NapiModules, NapiModulesCall) {
|
|
155
155
|
return {
|
|
156
156
|
async test(name) {
|
|
157
|
-
console.log(
|
|
157
|
+
console.log('CustomModule', NapiModules, NapiModulesCall);
|
|
158
158
|
},
|
|
159
159
|
};
|
|
160
160
|
},
|
|
@@ -206,25 +206,25 @@
|
|
|
206
206
|
lynxView.initI18nResources = [
|
|
207
207
|
{
|
|
208
208
|
options: {
|
|
209
|
-
locale:
|
|
210
|
-
channel:
|
|
211
|
-
fallback_url:
|
|
209
|
+
locale: 'en',
|
|
210
|
+
channel: '1',
|
|
211
|
+
fallback_url: '',
|
|
212
212
|
},
|
|
213
213
|
resource: {
|
|
214
|
-
hello:
|
|
215
|
-
lynx:
|
|
214
|
+
hello: 'hello',
|
|
215
|
+
lynx: 'lynx web platform1',
|
|
216
216
|
},
|
|
217
217
|
},
|
|
218
218
|
];
|
|
219
|
-
lynxView.addEventListener(
|
|
219
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
220
220
|
console.log(e);
|
|
221
221
|
});
|
|
222
222
|
|
|
223
223
|
// mts
|
|
224
224
|
_I18nResourceTranslation({
|
|
225
|
-
locale:
|
|
226
|
-
channel:
|
|
227
|
-
fallback_url:
|
|
225
|
+
locale: 'en',
|
|
226
|
+
channel: '1',
|
|
227
|
+
fallback_url: '',
|
|
228
228
|
});
|
|
229
229
|
```
|
|
230
230
|
|
|
@@ -474,8 +474,8 @@
|
|
|
474
474
|
}
|
|
475
475
|
};`,
|
|
476
476
|
],
|
|
477
|
-
{ type:
|
|
478
|
-
)
|
|
477
|
+
{ type: 'text/javascript' },
|
|
478
|
+
),
|
|
479
479
|
),
|
|
480
480
|
};
|
|
481
481
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -565,8 +565,8 @@
|
|
|
565
565
|
};
|
|
566
566
|
};`,
|
|
567
567
|
],
|
|
568
|
-
{ type:
|
|
569
|
-
)
|
|
568
|
+
{ type: 'text/javascript' },
|
|
569
|
+
),
|
|
570
570
|
);
|
|
571
571
|
|
|
572
572
|
const color_methods = URL.createObjectURL(
|
|
@@ -581,8 +581,8 @@
|
|
|
581
581
|
};
|
|
582
582
|
};`,
|
|
583
583
|
],
|
|
584
|
-
{ type:
|
|
585
|
-
)
|
|
584
|
+
{ type: 'text/javascript' },
|
|
585
|
+
),
|
|
586
586
|
);
|
|
587
587
|
|
|
588
588
|
lynxView.napiModuleMap = {
|
|
@@ -599,7 +599,7 @@
|
|
|
599
599
|
|
|
600
600
|
```js
|
|
601
601
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
602
|
-
if (name ===
|
|
602
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
603
603
|
return data.color;
|
|
604
604
|
}
|
|
605
605
|
};
|
|
@@ -654,8 +654,8 @@
|
|
|
654
654
|
}
|
|
655
655
|
};`,
|
|
656
656
|
],
|
|
657
|
-
{ type:
|
|
658
|
-
)
|
|
657
|
+
{ type: 'text/javascript' },
|
|
658
|
+
),
|
|
659
659
|
);
|
|
660
660
|
```
|
|
661
661
|
|
|
@@ -667,7 +667,7 @@
|
|
|
667
667
|
|
|
668
668
|
```js
|
|
669
669
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
670
|
-
if (name ===
|
|
670
|
+
if (name === 'getColor') {
|
|
671
671
|
callback(data.color);
|
|
672
672
|
}
|
|
673
673
|
};
|
|
@@ -677,7 +677,7 @@
|
|
|
677
677
|
|
|
678
678
|
```js
|
|
679
679
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
680
|
-
if (name ===
|
|
680
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
681
681
|
return data.color;
|
|
682
682
|
}
|
|
683
683
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.16.1
|
|
3
|
+
"version": "0.16.1",
|
|
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.16.1
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.16.1
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.16.1
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.16.1",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.16.1",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.16.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|