@lynx-js/web-worker-runtime-canary 0.17.2-canary-20251001-4e011e08 → 0.17.2
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.17.2
|
|
3
|
+
## 0.17.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
- support to add a breakpoint in chrome after reloading the web page
|
|
13
13
|
|
|
14
14
|
- Updated dependencies [[`a35a245`](https://github.com/lynx-family/lynx-stack/commit/a35a2452e5355bda3c475f9a750a86085e0cf56a)]:
|
|
15
|
-
- @lynx-js/web-constants@0.17.2
|
|
16
|
-
- @lynx-js/web-mainthread-apis@0.17.2
|
|
17
|
-
- @lynx-js/web-worker-rpc@0.17.2
|
|
15
|
+
- @lynx-js/web-constants@0.17.2
|
|
16
|
+
- @lynx-js/web-mainthread-apis@0.17.2
|
|
17
|
+
- @lynx-js/web-worker-rpc@0.17.2
|
|
18
18
|
|
|
19
19
|
## 0.17.1
|
|
20
20
|
|
|
@@ -167,14 +167,14 @@
|
|
|
167
167
|
Usage:
|
|
168
168
|
|
|
169
169
|
```ts
|
|
170
|
-
import { pluginWebPlatform } from
|
|
171
|
-
import { defineConfig } from
|
|
170
|
+
import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
|
|
171
|
+
import { defineConfig } from '@rsbuild/core';
|
|
172
172
|
|
|
173
173
|
export default defineConfig({
|
|
174
174
|
plugins: [
|
|
175
175
|
pluginWebPlatform({
|
|
176
176
|
// replace with your actual napi-modules file path
|
|
177
|
-
napiModulesPath: path.resolve(__dirname,
|
|
177
|
+
napiModulesPath: path.resolve(__dirname, './index.napi-modules.ts'),
|
|
178
178
|
}),
|
|
179
179
|
],
|
|
180
180
|
});
|
|
@@ -185,10 +185,10 @@
|
|
|
185
185
|
```ts
|
|
186
186
|
// index.napi-modules.ts
|
|
187
187
|
export default {
|
|
188
|
-
custom_module: function
|
|
188
|
+
custom_module: function(NapiModules, NapiModulesCall) {
|
|
189
189
|
return {
|
|
190
190
|
async test(name) {
|
|
191
|
-
console.log(
|
|
191
|
+
console.log('CustomModule', NapiModules, NapiModulesCall);
|
|
192
192
|
},
|
|
193
193
|
};
|
|
194
194
|
},
|
|
@@ -240,25 +240,25 @@
|
|
|
240
240
|
lynxView.initI18nResources = [
|
|
241
241
|
{
|
|
242
242
|
options: {
|
|
243
|
-
locale:
|
|
244
|
-
channel:
|
|
245
|
-
fallback_url:
|
|
243
|
+
locale: 'en',
|
|
244
|
+
channel: '1',
|
|
245
|
+
fallback_url: '',
|
|
246
246
|
},
|
|
247
247
|
resource: {
|
|
248
|
-
hello:
|
|
249
|
-
lynx:
|
|
248
|
+
hello: 'hello',
|
|
249
|
+
lynx: 'lynx web platform1',
|
|
250
250
|
},
|
|
251
251
|
},
|
|
252
252
|
];
|
|
253
|
-
lynxView.addEventListener(
|
|
253
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
254
254
|
console.log(e);
|
|
255
255
|
});
|
|
256
256
|
|
|
257
257
|
// mts
|
|
258
258
|
_I18nResourceTranslation({
|
|
259
|
-
locale:
|
|
260
|
-
channel:
|
|
261
|
-
fallback_url:
|
|
259
|
+
locale: 'en',
|
|
260
|
+
channel: '1',
|
|
261
|
+
fallback_url: '',
|
|
262
262
|
});
|
|
263
263
|
```
|
|
264
264
|
|
|
@@ -508,8 +508,8 @@
|
|
|
508
508
|
}
|
|
509
509
|
};`,
|
|
510
510
|
],
|
|
511
|
-
{ type:
|
|
512
|
-
)
|
|
511
|
+
{ type: 'text/javascript' },
|
|
512
|
+
),
|
|
513
513
|
),
|
|
514
514
|
};
|
|
515
515
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -599,8 +599,8 @@
|
|
|
599
599
|
};
|
|
600
600
|
};`,
|
|
601
601
|
],
|
|
602
|
-
{ type:
|
|
603
|
-
)
|
|
602
|
+
{ type: 'text/javascript' },
|
|
603
|
+
),
|
|
604
604
|
);
|
|
605
605
|
|
|
606
606
|
const color_methods = URL.createObjectURL(
|
|
@@ -615,8 +615,8 @@
|
|
|
615
615
|
};
|
|
616
616
|
};`,
|
|
617
617
|
],
|
|
618
|
-
{ type:
|
|
619
|
-
)
|
|
618
|
+
{ type: 'text/javascript' },
|
|
619
|
+
),
|
|
620
620
|
);
|
|
621
621
|
|
|
622
622
|
lynxView.napiModuleMap = {
|
|
@@ -633,7 +633,7 @@
|
|
|
633
633
|
|
|
634
634
|
```js
|
|
635
635
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
636
|
-
if (name ===
|
|
636
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
637
637
|
return data.color;
|
|
638
638
|
}
|
|
639
639
|
};
|
|
@@ -688,8 +688,8 @@
|
|
|
688
688
|
}
|
|
689
689
|
};`,
|
|
690
690
|
],
|
|
691
|
-
{ type:
|
|
692
|
-
)
|
|
691
|
+
{ type: 'text/javascript' },
|
|
692
|
+
),
|
|
693
693
|
);
|
|
694
694
|
```
|
|
695
695
|
|
|
@@ -701,7 +701,7 @@
|
|
|
701
701
|
|
|
702
702
|
```js
|
|
703
703
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
704
|
-
if (name ===
|
|
704
|
+
if (name === 'getColor') {
|
|
705
705
|
callback(data.color);
|
|
706
706
|
}
|
|
707
707
|
};
|
|
@@ -711,7 +711,7 @@
|
|
|
711
711
|
|
|
712
712
|
```js
|
|
713
713
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
714
|
-
if (name ===
|
|
714
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
715
715
|
return data.color;
|
|
716
716
|
}
|
|
717
717
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.17.2
|
|
3
|
+
"version": "0.17.2",
|
|
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.2
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.17.2
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.17.2
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.17.2",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.17.2",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.17.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|