@lynx-js/web-worker-runtime-canary 0.19.4-canary-20260104-f4b90f3a → 0.19.4
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.4
|
|
3
|
+
## 0.19.4
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies [[`bba05e2`](https://github.com/lynx-family/lynx-stack/commit/bba05e2ed06cca8009ad415fd9777e8334a0887a)]:
|
|
8
|
-
- @lynx-js/web-worker-rpc@0.19.4
|
|
9
|
-
- @lynx-js/web-constants@0.19.4
|
|
10
|
-
- @lynx-js/web-mainthread-apis@0.19.4
|
|
8
|
+
- @lynx-js/web-worker-rpc@0.19.4
|
|
9
|
+
- @lynx-js/web-constants@0.19.4
|
|
10
|
+
- @lynx-js/web-mainthread-apis@0.19.4
|
|
11
11
|
|
|
12
12
|
## 0.19.3
|
|
13
13
|
|
|
@@ -271,14 +271,14 @@
|
|
|
271
271
|
Usage:
|
|
272
272
|
|
|
273
273
|
```ts
|
|
274
|
-
import { pluginWebPlatform } from
|
|
275
|
-
import { defineConfig } from
|
|
274
|
+
import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
|
|
275
|
+
import { defineConfig } from '@rsbuild/core';
|
|
276
276
|
|
|
277
277
|
export default defineConfig({
|
|
278
278
|
plugins: [
|
|
279
279
|
pluginWebPlatform({
|
|
280
280
|
// replace with your actual napi-modules file path
|
|
281
|
-
napiModulesPath: path.resolve(__dirname,
|
|
281
|
+
napiModulesPath: path.resolve(__dirname, './index.napi-modules.ts'),
|
|
282
282
|
}),
|
|
283
283
|
],
|
|
284
284
|
});
|
|
@@ -289,10 +289,10 @@
|
|
|
289
289
|
```ts
|
|
290
290
|
// index.napi-modules.ts
|
|
291
291
|
export default {
|
|
292
|
-
custom_module: function
|
|
292
|
+
custom_module: function(NapiModules, NapiModulesCall) {
|
|
293
293
|
return {
|
|
294
294
|
async test(name) {
|
|
295
|
-
console.log(
|
|
295
|
+
console.log('CustomModule', NapiModules, NapiModulesCall);
|
|
296
296
|
},
|
|
297
297
|
};
|
|
298
298
|
},
|
|
@@ -344,25 +344,25 @@
|
|
|
344
344
|
lynxView.initI18nResources = [
|
|
345
345
|
{
|
|
346
346
|
options: {
|
|
347
|
-
locale:
|
|
348
|
-
channel:
|
|
349
|
-
fallback_url:
|
|
347
|
+
locale: 'en',
|
|
348
|
+
channel: '1',
|
|
349
|
+
fallback_url: '',
|
|
350
350
|
},
|
|
351
351
|
resource: {
|
|
352
|
-
hello:
|
|
353
|
-
lynx:
|
|
352
|
+
hello: 'hello',
|
|
353
|
+
lynx: 'lynx web platform1',
|
|
354
354
|
},
|
|
355
355
|
},
|
|
356
356
|
];
|
|
357
|
-
lynxView.addEventListener(
|
|
357
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
358
358
|
console.log(e);
|
|
359
359
|
});
|
|
360
360
|
|
|
361
361
|
// mts
|
|
362
362
|
_I18nResourceTranslation({
|
|
363
|
-
locale:
|
|
364
|
-
channel:
|
|
365
|
-
fallback_url:
|
|
363
|
+
locale: 'en',
|
|
364
|
+
channel: '1',
|
|
365
|
+
fallback_url: '',
|
|
366
366
|
});
|
|
367
367
|
```
|
|
368
368
|
|
|
@@ -612,8 +612,8 @@
|
|
|
612
612
|
}
|
|
613
613
|
};`,
|
|
614
614
|
],
|
|
615
|
-
{ type:
|
|
616
|
-
)
|
|
615
|
+
{ type: 'text/javascript' },
|
|
616
|
+
),
|
|
617
617
|
),
|
|
618
618
|
};
|
|
619
619
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -703,8 +703,8 @@
|
|
|
703
703
|
};
|
|
704
704
|
};`,
|
|
705
705
|
],
|
|
706
|
-
{ type:
|
|
707
|
-
)
|
|
706
|
+
{ type: 'text/javascript' },
|
|
707
|
+
),
|
|
708
708
|
);
|
|
709
709
|
|
|
710
710
|
const color_methods = URL.createObjectURL(
|
|
@@ -719,8 +719,8 @@
|
|
|
719
719
|
};
|
|
720
720
|
};`,
|
|
721
721
|
],
|
|
722
|
-
{ type:
|
|
723
|
-
)
|
|
722
|
+
{ type: 'text/javascript' },
|
|
723
|
+
),
|
|
724
724
|
);
|
|
725
725
|
|
|
726
726
|
lynxView.napiModuleMap = {
|
|
@@ -737,7 +737,7 @@
|
|
|
737
737
|
|
|
738
738
|
```js
|
|
739
739
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
740
|
-
if (name ===
|
|
740
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
741
741
|
return data.color;
|
|
742
742
|
}
|
|
743
743
|
};
|
|
@@ -792,8 +792,8 @@
|
|
|
792
792
|
}
|
|
793
793
|
};`,
|
|
794
794
|
],
|
|
795
|
-
{ type:
|
|
796
|
-
)
|
|
795
|
+
{ type: 'text/javascript' },
|
|
796
|
+
),
|
|
797
797
|
);
|
|
798
798
|
```
|
|
799
799
|
|
|
@@ -805,7 +805,7 @@
|
|
|
805
805
|
|
|
806
806
|
```js
|
|
807
807
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
808
|
-
if (name ===
|
|
808
|
+
if (name === 'getColor') {
|
|
809
809
|
callback(data.color);
|
|
810
810
|
}
|
|
811
811
|
};
|
|
@@ -815,7 +815,7 @@
|
|
|
815
815
|
|
|
816
816
|
```js
|
|
817
817
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
818
|
-
if (name ===
|
|
818
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
819
819
|
return data.color;
|
|
820
820
|
}
|
|
821
821
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.19.4
|
|
3
|
+
"version": "0.19.4",
|
|
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.4
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.4
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.4
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.4",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.4",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.4"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|