@lynx-js/web-worker-runtime-canary 0.18.0-canary-20251012-dd7c14a8 → 0.18.0
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,6 +1,6 @@
|
|
|
1
1
|
# @lynx-js/web-worker-runtime
|
|
2
2
|
|
|
3
|
-
## 0.18.0
|
|
3
|
+
## 0.18.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
- Updated dependencies [[`77397fd`](https://github.com/lynx-family/lynx-stack/commit/77397fd535cf60556f8f82f7ef8dae8a623d1625), [`7d90ed5`](https://github.com/lynx-family/lynx-stack/commit/7d90ed52a20fd7665a3517507800e7e29426f6f9)]:
|
|
18
|
-
- @lynx-js/web-constants@0.18.0
|
|
19
|
-
- @lynx-js/web-mainthread-apis@0.18.0
|
|
20
|
-
- @lynx-js/web-worker-rpc@0.18.0
|
|
18
|
+
- @lynx-js/web-constants@0.18.0
|
|
19
|
+
- @lynx-js/web-mainthread-apis@0.18.0
|
|
20
|
+
- @lynx-js/web-worker-rpc@0.18.0
|
|
21
21
|
|
|
22
22
|
## 0.17.2
|
|
23
23
|
|
|
@@ -186,14 +186,14 @@
|
|
|
186
186
|
Usage:
|
|
187
187
|
|
|
188
188
|
```ts
|
|
189
|
-
import { pluginWebPlatform } from
|
|
190
|
-
import { defineConfig } from
|
|
189
|
+
import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
|
|
190
|
+
import { defineConfig } from '@rsbuild/core';
|
|
191
191
|
|
|
192
192
|
export default defineConfig({
|
|
193
193
|
plugins: [
|
|
194
194
|
pluginWebPlatform({
|
|
195
195
|
// replace with your actual napi-modules file path
|
|
196
|
-
napiModulesPath: path.resolve(__dirname,
|
|
196
|
+
napiModulesPath: path.resolve(__dirname, './index.napi-modules.ts'),
|
|
197
197
|
}),
|
|
198
198
|
],
|
|
199
199
|
});
|
|
@@ -204,10 +204,10 @@
|
|
|
204
204
|
```ts
|
|
205
205
|
// index.napi-modules.ts
|
|
206
206
|
export default {
|
|
207
|
-
custom_module: function
|
|
207
|
+
custom_module: function(NapiModules, NapiModulesCall) {
|
|
208
208
|
return {
|
|
209
209
|
async test(name) {
|
|
210
|
-
console.log(
|
|
210
|
+
console.log('CustomModule', NapiModules, NapiModulesCall);
|
|
211
211
|
},
|
|
212
212
|
};
|
|
213
213
|
},
|
|
@@ -259,25 +259,25 @@
|
|
|
259
259
|
lynxView.initI18nResources = [
|
|
260
260
|
{
|
|
261
261
|
options: {
|
|
262
|
-
locale:
|
|
263
|
-
channel:
|
|
264
|
-
fallback_url:
|
|
262
|
+
locale: 'en',
|
|
263
|
+
channel: '1',
|
|
264
|
+
fallback_url: '',
|
|
265
265
|
},
|
|
266
266
|
resource: {
|
|
267
|
-
hello:
|
|
268
|
-
lynx:
|
|
267
|
+
hello: 'hello',
|
|
268
|
+
lynx: 'lynx web platform1',
|
|
269
269
|
},
|
|
270
270
|
},
|
|
271
271
|
];
|
|
272
|
-
lynxView.addEventListener(
|
|
272
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
273
273
|
console.log(e);
|
|
274
274
|
});
|
|
275
275
|
|
|
276
276
|
// mts
|
|
277
277
|
_I18nResourceTranslation({
|
|
278
|
-
locale:
|
|
279
|
-
channel:
|
|
280
|
-
fallback_url:
|
|
278
|
+
locale: 'en',
|
|
279
|
+
channel: '1',
|
|
280
|
+
fallback_url: '',
|
|
281
281
|
});
|
|
282
282
|
```
|
|
283
283
|
|
|
@@ -527,8 +527,8 @@
|
|
|
527
527
|
}
|
|
528
528
|
};`,
|
|
529
529
|
],
|
|
530
|
-
{ type:
|
|
531
|
-
)
|
|
530
|
+
{ type: 'text/javascript' },
|
|
531
|
+
),
|
|
532
532
|
),
|
|
533
533
|
};
|
|
534
534
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -618,8 +618,8 @@
|
|
|
618
618
|
};
|
|
619
619
|
};`,
|
|
620
620
|
],
|
|
621
|
-
{ type:
|
|
622
|
-
)
|
|
621
|
+
{ type: 'text/javascript' },
|
|
622
|
+
),
|
|
623
623
|
);
|
|
624
624
|
|
|
625
625
|
const color_methods = URL.createObjectURL(
|
|
@@ -634,8 +634,8 @@
|
|
|
634
634
|
};
|
|
635
635
|
};`,
|
|
636
636
|
],
|
|
637
|
-
{ type:
|
|
638
|
-
)
|
|
637
|
+
{ type: 'text/javascript' },
|
|
638
|
+
),
|
|
639
639
|
);
|
|
640
640
|
|
|
641
641
|
lynxView.napiModuleMap = {
|
|
@@ -652,7 +652,7 @@
|
|
|
652
652
|
|
|
653
653
|
```js
|
|
654
654
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
655
|
-
if (name ===
|
|
655
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
656
656
|
return data.color;
|
|
657
657
|
}
|
|
658
658
|
};
|
|
@@ -707,8 +707,8 @@
|
|
|
707
707
|
}
|
|
708
708
|
};`,
|
|
709
709
|
],
|
|
710
|
-
{ type:
|
|
711
|
-
)
|
|
710
|
+
{ type: 'text/javascript' },
|
|
711
|
+
),
|
|
712
712
|
);
|
|
713
713
|
```
|
|
714
714
|
|
|
@@ -720,7 +720,7 @@
|
|
|
720
720
|
|
|
721
721
|
```js
|
|
722
722
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
723
|
-
if (name ===
|
|
723
|
+
if (name === 'getColor') {
|
|
724
724
|
callback(data.color);
|
|
725
725
|
}
|
|
726
726
|
};
|
|
@@ -730,7 +730,7 @@
|
|
|
730
730
|
|
|
731
731
|
```js
|
|
732
732
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
733
|
-
if (name ===
|
|
733
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
734
734
|
return data.color;
|
|
735
735
|
}
|
|
736
736
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.18.0
|
|
3
|
+
"version": "0.18.0",
|
|
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.18.0
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.18.0
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.0
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.18.0",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.18.0",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|