@lynx-js/web-worker-runtime-canary 0.19.3-canary-20251226-f8b5be81 → 0.19.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.19.3
|
|
3
|
+
## 0.19.3
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies [[`986761d`](https://github.com/lynx-family/lynx-stack/commit/986761dd1e9e631f8118faec68188f29f78e9236)]:
|
|
8
|
-
- @lynx-js/web-worker-rpc@0.19.3
|
|
9
|
-
- @lynx-js/web-constants@0.19.3
|
|
10
|
-
- @lynx-js/web-mainthread-apis@0.19.3
|
|
8
|
+
- @lynx-js/web-worker-rpc@0.19.3
|
|
9
|
+
- @lynx-js/web-constants@0.19.3
|
|
10
|
+
- @lynx-js/web-mainthread-apis@0.19.3
|
|
11
11
|
|
|
12
12
|
## 0.19.2
|
|
13
13
|
|
|
@@ -262,14 +262,14 @@
|
|
|
262
262
|
Usage:
|
|
263
263
|
|
|
264
264
|
```ts
|
|
265
|
-
import { pluginWebPlatform } from
|
|
266
|
-
import { defineConfig } from
|
|
265
|
+
import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
|
|
266
|
+
import { defineConfig } from '@rsbuild/core';
|
|
267
267
|
|
|
268
268
|
export default defineConfig({
|
|
269
269
|
plugins: [
|
|
270
270
|
pluginWebPlatform({
|
|
271
271
|
// replace with your actual napi-modules file path
|
|
272
|
-
napiModulesPath: path.resolve(__dirname,
|
|
272
|
+
napiModulesPath: path.resolve(__dirname, './index.napi-modules.ts'),
|
|
273
273
|
}),
|
|
274
274
|
],
|
|
275
275
|
});
|
|
@@ -280,10 +280,10 @@
|
|
|
280
280
|
```ts
|
|
281
281
|
// index.napi-modules.ts
|
|
282
282
|
export default {
|
|
283
|
-
custom_module: function
|
|
283
|
+
custom_module: function(NapiModules, NapiModulesCall) {
|
|
284
284
|
return {
|
|
285
285
|
async test(name) {
|
|
286
|
-
console.log(
|
|
286
|
+
console.log('CustomModule', NapiModules, NapiModulesCall);
|
|
287
287
|
},
|
|
288
288
|
};
|
|
289
289
|
},
|
|
@@ -335,25 +335,25 @@
|
|
|
335
335
|
lynxView.initI18nResources = [
|
|
336
336
|
{
|
|
337
337
|
options: {
|
|
338
|
-
locale:
|
|
339
|
-
channel:
|
|
340
|
-
fallback_url:
|
|
338
|
+
locale: 'en',
|
|
339
|
+
channel: '1',
|
|
340
|
+
fallback_url: '',
|
|
341
341
|
},
|
|
342
342
|
resource: {
|
|
343
|
-
hello:
|
|
344
|
-
lynx:
|
|
343
|
+
hello: 'hello',
|
|
344
|
+
lynx: 'lynx web platform1',
|
|
345
345
|
},
|
|
346
346
|
},
|
|
347
347
|
];
|
|
348
|
-
lynxView.addEventListener(
|
|
348
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
349
349
|
console.log(e);
|
|
350
350
|
});
|
|
351
351
|
|
|
352
352
|
// mts
|
|
353
353
|
_I18nResourceTranslation({
|
|
354
|
-
locale:
|
|
355
|
-
channel:
|
|
356
|
-
fallback_url:
|
|
354
|
+
locale: 'en',
|
|
355
|
+
channel: '1',
|
|
356
|
+
fallback_url: '',
|
|
357
357
|
});
|
|
358
358
|
```
|
|
359
359
|
|
|
@@ -603,8 +603,8 @@
|
|
|
603
603
|
}
|
|
604
604
|
};`,
|
|
605
605
|
],
|
|
606
|
-
{ type:
|
|
607
|
-
)
|
|
606
|
+
{ type: 'text/javascript' },
|
|
607
|
+
),
|
|
608
608
|
),
|
|
609
609
|
};
|
|
610
610
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -694,8 +694,8 @@
|
|
|
694
694
|
};
|
|
695
695
|
};`,
|
|
696
696
|
],
|
|
697
|
-
{ type:
|
|
698
|
-
)
|
|
697
|
+
{ type: 'text/javascript' },
|
|
698
|
+
),
|
|
699
699
|
);
|
|
700
700
|
|
|
701
701
|
const color_methods = URL.createObjectURL(
|
|
@@ -710,8 +710,8 @@
|
|
|
710
710
|
};
|
|
711
711
|
};`,
|
|
712
712
|
],
|
|
713
|
-
{ type:
|
|
714
|
-
)
|
|
713
|
+
{ type: 'text/javascript' },
|
|
714
|
+
),
|
|
715
715
|
);
|
|
716
716
|
|
|
717
717
|
lynxView.napiModuleMap = {
|
|
@@ -728,7 +728,7 @@
|
|
|
728
728
|
|
|
729
729
|
```js
|
|
730
730
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
731
|
-
if (name ===
|
|
731
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
732
732
|
return data.color;
|
|
733
733
|
}
|
|
734
734
|
};
|
|
@@ -783,8 +783,8 @@
|
|
|
783
783
|
}
|
|
784
784
|
};`,
|
|
785
785
|
],
|
|
786
|
-
{ type:
|
|
787
|
-
)
|
|
786
|
+
{ type: 'text/javascript' },
|
|
787
|
+
),
|
|
788
788
|
);
|
|
789
789
|
```
|
|
790
790
|
|
|
@@ -796,7 +796,7 @@
|
|
|
796
796
|
|
|
797
797
|
```js
|
|
798
798
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
799
|
-
if (name ===
|
|
799
|
+
if (name === 'getColor') {
|
|
800
800
|
callback(data.color);
|
|
801
801
|
}
|
|
802
802
|
};
|
|
@@ -806,7 +806,7 @@
|
|
|
806
806
|
|
|
807
807
|
```js
|
|
808
808
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
809
|
-
if (name ===
|
|
809
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
810
810
|
return data.color;
|
|
811
811
|
}
|
|
812
812
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.19.3
|
|
3
|
+
"version": "0.19.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.4",
|
|
26
|
-
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.3
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.3
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.3
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.3",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.3",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|