@lynx-js/web-worker-runtime-canary 0.15.4-canary-20250801-d2961703 → 0.15.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,15 +1,15 @@
|
|
|
1
1
|
# @lynx-js/web-worker-runtime
|
|
2
2
|
|
|
3
|
-
## 0.15.4
|
|
3
|
+
## 0.15.4
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- optimize IO for all-on-ui: make startMainThreadWorker async and defer import ([#1385](https://github.com/lynx-family/lynx-stack/pull/1385))
|
|
8
8
|
|
|
9
9
|
- Updated dependencies [[`22ca433`](https://github.com/lynx-family/lynx-stack/commit/22ca433eb96b39724c6eb47ce0a938d291bbdef2), [`143e481`](https://github.com/lynx-family/lynx-stack/commit/143e481b4353b3c3d2e8d9cc4f201442ca56f097)]:
|
|
10
|
-
- @lynx-js/web-mainthread-apis@0.15.4
|
|
11
|
-
- @lynx-js/web-constants@0.15.4
|
|
12
|
-
- @lynx-js/web-worker-rpc@0.15.4
|
|
10
|
+
- @lynx-js/web-mainthread-apis@0.15.4
|
|
11
|
+
- @lynx-js/web-constants@0.15.4
|
|
12
|
+
- @lynx-js/web-worker-rpc@0.15.4
|
|
13
13
|
|
|
14
14
|
## 0.15.3
|
|
15
15
|
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
Usage:
|
|
64
64
|
|
|
65
65
|
```ts
|
|
66
|
-
import { pluginWebPlatform } from
|
|
67
|
-
import { defineConfig } from
|
|
66
|
+
import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
|
|
67
|
+
import { defineConfig } from '@rsbuild/core';
|
|
68
68
|
|
|
69
69
|
export default defineConfig({
|
|
70
70
|
plugins: [
|
|
71
71
|
pluginWebPlatform({
|
|
72
72
|
// replace with your actual napi-modules file path
|
|
73
|
-
napiModulesPath: path.resolve(__dirname,
|
|
73
|
+
napiModulesPath: path.resolve(__dirname, './index.napi-modules.ts'),
|
|
74
74
|
}),
|
|
75
75
|
],
|
|
76
76
|
});
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
```ts
|
|
82
82
|
// index.napi-modules.ts
|
|
83
83
|
export default {
|
|
84
|
-
custom_module: function
|
|
84
|
+
custom_module: function(NapiModules, NapiModulesCall) {
|
|
85
85
|
return {
|
|
86
86
|
async test(name) {
|
|
87
|
-
console.log(
|
|
87
|
+
console.log('CustomModule', NapiModules, NapiModulesCall);
|
|
88
88
|
},
|
|
89
89
|
};
|
|
90
90
|
},
|
|
@@ -136,25 +136,25 @@
|
|
|
136
136
|
lynxView.initI18nResources = [
|
|
137
137
|
{
|
|
138
138
|
options: {
|
|
139
|
-
locale:
|
|
140
|
-
channel:
|
|
141
|
-
fallback_url:
|
|
139
|
+
locale: 'en',
|
|
140
|
+
channel: '1',
|
|
141
|
+
fallback_url: '',
|
|
142
142
|
},
|
|
143
143
|
resource: {
|
|
144
|
-
hello:
|
|
145
|
-
lynx:
|
|
144
|
+
hello: 'hello',
|
|
145
|
+
lynx: 'lynx web platform1',
|
|
146
146
|
},
|
|
147
147
|
},
|
|
148
148
|
];
|
|
149
|
-
lynxView.addEventListener(
|
|
149
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
150
150
|
console.log(e);
|
|
151
151
|
});
|
|
152
152
|
|
|
153
153
|
// mts
|
|
154
154
|
_I18nResourceTranslation({
|
|
155
|
-
locale:
|
|
156
|
-
channel:
|
|
157
|
-
fallback_url:
|
|
155
|
+
locale: 'en',
|
|
156
|
+
channel: '1',
|
|
157
|
+
fallback_url: '',
|
|
158
158
|
});
|
|
159
159
|
```
|
|
160
160
|
|
|
@@ -404,8 +404,8 @@
|
|
|
404
404
|
}
|
|
405
405
|
};`,
|
|
406
406
|
],
|
|
407
|
-
{ type:
|
|
408
|
-
)
|
|
407
|
+
{ type: 'text/javascript' },
|
|
408
|
+
),
|
|
409
409
|
),
|
|
410
410
|
};
|
|
411
411
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -495,8 +495,8 @@
|
|
|
495
495
|
};
|
|
496
496
|
};`,
|
|
497
497
|
],
|
|
498
|
-
{ type:
|
|
499
|
-
)
|
|
498
|
+
{ type: 'text/javascript' },
|
|
499
|
+
),
|
|
500
500
|
);
|
|
501
501
|
|
|
502
502
|
const color_methods = URL.createObjectURL(
|
|
@@ -511,8 +511,8 @@
|
|
|
511
511
|
};
|
|
512
512
|
};`,
|
|
513
513
|
],
|
|
514
|
-
{ type:
|
|
515
|
-
)
|
|
514
|
+
{ type: 'text/javascript' },
|
|
515
|
+
),
|
|
516
516
|
);
|
|
517
517
|
|
|
518
518
|
lynxView.napiModuleMap = {
|
|
@@ -529,7 +529,7 @@
|
|
|
529
529
|
|
|
530
530
|
```js
|
|
531
531
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
532
|
-
if (name ===
|
|
532
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
533
533
|
return data.color;
|
|
534
534
|
}
|
|
535
535
|
};
|
|
@@ -584,8 +584,8 @@
|
|
|
584
584
|
}
|
|
585
585
|
};`,
|
|
586
586
|
],
|
|
587
|
-
{ type:
|
|
588
|
-
)
|
|
587
|
+
{ type: 'text/javascript' },
|
|
588
|
+
),
|
|
589
589
|
);
|
|
590
590
|
```
|
|
591
591
|
|
|
@@ -597,7 +597,7 @@
|
|
|
597
597
|
|
|
598
598
|
```js
|
|
599
599
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
600
|
-
if (name ===
|
|
600
|
+
if (name === 'getColor') {
|
|
601
601
|
callback(data.color);
|
|
602
602
|
}
|
|
603
603
|
};
|
|
@@ -607,7 +607,7 @@
|
|
|
607
607
|
|
|
608
608
|
```js
|
|
609
609
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
610
|
-
if (name ===
|
|
610
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
611
611
|
return data.color;
|
|
612
612
|
}
|
|
613
613
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.15.4
|
|
3
|
+
"version": "0.15.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.3",
|
|
26
|
-
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.15.4
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.4
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.4
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.15.4",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.4",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.4"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.2"
|