@lynx-js/web-worker-runtime-canary 0.17.0-canary-20250921-d0ef559f → 0.17.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,13 +1,13 @@
|
|
|
1
1
|
# @lynx-js/web-worker-runtime
|
|
2
2
|
|
|
3
|
-
## 0.17.0
|
|
3
|
+
## 0.17.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies [[`721635d`](https://github.com/lynx-family/lynx-stack/commit/721635de6c1d2d617c7cbaa86e7d816c42d62930), [`93d707b`](https://github.com/lynx-family/lynx-stack/commit/93d707b82a59f7256952e21da6dcad2999f8233d), [`d150ed4`](https://github.com/lynx-family/lynx-stack/commit/d150ed440a4f1e9d9a3a2911adf6e6fa39a0c589)]:
|
|
8
|
-
- @lynx-js/web-mainthread-apis@0.17.0
|
|
9
|
-
- @lynx-js/web-constants@0.17.0
|
|
10
|
-
- @lynx-js/web-worker-rpc@0.17.0
|
|
8
|
+
- @lynx-js/web-mainthread-apis@0.17.0
|
|
9
|
+
- @lynx-js/web-constants@0.17.0
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.17.0
|
|
11
11
|
|
|
12
12
|
## 0.16.1
|
|
13
13
|
|
|
@@ -142,14 +142,14 @@
|
|
|
142
142
|
Usage:
|
|
143
143
|
|
|
144
144
|
```ts
|
|
145
|
-
import { pluginWebPlatform } from
|
|
146
|
-
import { defineConfig } from
|
|
145
|
+
import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
|
|
146
|
+
import { defineConfig } from '@rsbuild/core';
|
|
147
147
|
|
|
148
148
|
export default defineConfig({
|
|
149
149
|
plugins: [
|
|
150
150
|
pluginWebPlatform({
|
|
151
151
|
// replace with your actual napi-modules file path
|
|
152
|
-
napiModulesPath: path.resolve(__dirname,
|
|
152
|
+
napiModulesPath: path.resolve(__dirname, './index.napi-modules.ts'),
|
|
153
153
|
}),
|
|
154
154
|
],
|
|
155
155
|
});
|
|
@@ -160,10 +160,10 @@
|
|
|
160
160
|
```ts
|
|
161
161
|
// index.napi-modules.ts
|
|
162
162
|
export default {
|
|
163
|
-
custom_module: function
|
|
163
|
+
custom_module: function(NapiModules, NapiModulesCall) {
|
|
164
164
|
return {
|
|
165
165
|
async test(name) {
|
|
166
|
-
console.log(
|
|
166
|
+
console.log('CustomModule', NapiModules, NapiModulesCall);
|
|
167
167
|
},
|
|
168
168
|
};
|
|
169
169
|
},
|
|
@@ -215,25 +215,25 @@
|
|
|
215
215
|
lynxView.initI18nResources = [
|
|
216
216
|
{
|
|
217
217
|
options: {
|
|
218
|
-
locale:
|
|
219
|
-
channel:
|
|
220
|
-
fallback_url:
|
|
218
|
+
locale: 'en',
|
|
219
|
+
channel: '1',
|
|
220
|
+
fallback_url: '',
|
|
221
221
|
},
|
|
222
222
|
resource: {
|
|
223
|
-
hello:
|
|
224
|
-
lynx:
|
|
223
|
+
hello: 'hello',
|
|
224
|
+
lynx: 'lynx web platform1',
|
|
225
225
|
},
|
|
226
226
|
},
|
|
227
227
|
];
|
|
228
|
-
lynxView.addEventListener(
|
|
228
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
229
229
|
console.log(e);
|
|
230
230
|
});
|
|
231
231
|
|
|
232
232
|
// mts
|
|
233
233
|
_I18nResourceTranslation({
|
|
234
|
-
locale:
|
|
235
|
-
channel:
|
|
236
|
-
fallback_url:
|
|
234
|
+
locale: 'en',
|
|
235
|
+
channel: '1',
|
|
236
|
+
fallback_url: '',
|
|
237
237
|
});
|
|
238
238
|
```
|
|
239
239
|
|
|
@@ -483,8 +483,8 @@
|
|
|
483
483
|
}
|
|
484
484
|
};`,
|
|
485
485
|
],
|
|
486
|
-
{ type:
|
|
487
|
-
)
|
|
486
|
+
{ type: 'text/javascript' },
|
|
487
|
+
),
|
|
488
488
|
),
|
|
489
489
|
};
|
|
490
490
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -574,8 +574,8 @@
|
|
|
574
574
|
};
|
|
575
575
|
};`,
|
|
576
576
|
],
|
|
577
|
-
{ type:
|
|
578
|
-
)
|
|
577
|
+
{ type: 'text/javascript' },
|
|
578
|
+
),
|
|
579
579
|
);
|
|
580
580
|
|
|
581
581
|
const color_methods = URL.createObjectURL(
|
|
@@ -590,8 +590,8 @@
|
|
|
590
590
|
};
|
|
591
591
|
};`,
|
|
592
592
|
],
|
|
593
|
-
{ type:
|
|
594
|
-
)
|
|
593
|
+
{ type: 'text/javascript' },
|
|
594
|
+
),
|
|
595
595
|
);
|
|
596
596
|
|
|
597
597
|
lynxView.napiModuleMap = {
|
|
@@ -608,7 +608,7 @@
|
|
|
608
608
|
|
|
609
609
|
```js
|
|
610
610
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
611
|
-
if (name ===
|
|
611
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
612
612
|
return data.color;
|
|
613
613
|
}
|
|
614
614
|
};
|
|
@@ -663,8 +663,8 @@
|
|
|
663
663
|
}
|
|
664
664
|
};`,
|
|
665
665
|
],
|
|
666
|
-
{ type:
|
|
667
|
-
)
|
|
666
|
+
{ type: 'text/javascript' },
|
|
667
|
+
),
|
|
668
668
|
);
|
|
669
669
|
```
|
|
670
670
|
|
|
@@ -676,7 +676,7 @@
|
|
|
676
676
|
|
|
677
677
|
```js
|
|
678
678
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
679
|
-
if (name ===
|
|
679
|
+
if (name === 'getColor') {
|
|
680
680
|
callback(data.color);
|
|
681
681
|
}
|
|
682
682
|
};
|
|
@@ -686,7 +686,7 @@
|
|
|
686
686
|
|
|
687
687
|
```js
|
|
688
688
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
689
|
-
if (name ===
|
|
689
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
690
690
|
return data.color;
|
|
691
691
|
}
|
|
692
692
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.17.0
|
|
3
|
+
"version": "0.17.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.17.0
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.17.0
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.17.0
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.17.0",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.17.0",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.17.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|