@lynx-js/web-worker-runtime-canary 0.15.2-canary-20250719-fb2ed8d0 → 0.15.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,13 +1,13 @@
|
|
|
1
1
|
# @lynx-js/web-worker-runtime
|
|
2
2
|
|
|
3
|
-
## 0.15.2
|
|
3
|
+
## 0.15.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies [[`cebda59`](https://github.com/lynx-family/lynx-stack/commit/cebda592ac5c7d152c877c2ac5ec403d477077e1), [`1443e46`](https://github.com/lynx-family/lynx-stack/commit/1443e468a353363e29aab0d90cd8b91c232a5525), [`5062128`](https://github.com/lynx-family/lynx-stack/commit/5062128c68e21abcf276ebcb40d7cc8f6e54244b), [`f656b7f`](https://github.com/lynx-family/lynx-stack/commit/f656b7f0d390d69c0da0d11a6c9b3f66ae877ac8)]:
|
|
8
|
-
- @lynx-js/web-mainthread-apis@0.15.2
|
|
9
|
-
- @lynx-js/web-constants@0.15.2
|
|
10
|
-
- @lynx-js/web-worker-rpc@0.15.2
|
|
8
|
+
- @lynx-js/web-mainthread-apis@0.15.2
|
|
9
|
+
- @lynx-js/web-constants@0.15.2
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.15.2
|
|
11
11
|
|
|
12
12
|
## 0.15.1
|
|
13
13
|
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
Usage:
|
|
44
44
|
|
|
45
45
|
```ts
|
|
46
|
-
import { pluginWebPlatform } from
|
|
47
|
-
import { defineConfig } from
|
|
46
|
+
import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
|
|
47
|
+
import { defineConfig } from '@rsbuild/core';
|
|
48
48
|
|
|
49
49
|
export default defineConfig({
|
|
50
50
|
plugins: [
|
|
51
51
|
pluginWebPlatform({
|
|
52
52
|
// replace with your actual napi-modules file path
|
|
53
|
-
napiModulesPath: path.resolve(__dirname,
|
|
53
|
+
napiModulesPath: path.resolve(__dirname, './index.napi-modules.ts'),
|
|
54
54
|
}),
|
|
55
55
|
],
|
|
56
56
|
});
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
```ts
|
|
62
62
|
// index.napi-modules.ts
|
|
63
63
|
export default {
|
|
64
|
-
custom_module: function
|
|
64
|
+
custom_module: function(NapiModules, NapiModulesCall) {
|
|
65
65
|
return {
|
|
66
66
|
async test(name) {
|
|
67
|
-
console.log(
|
|
67
|
+
console.log('CustomModule', NapiModules, NapiModulesCall);
|
|
68
68
|
},
|
|
69
69
|
};
|
|
70
70
|
},
|
|
@@ -116,25 +116,25 @@
|
|
|
116
116
|
lynxView.initI18nResources = [
|
|
117
117
|
{
|
|
118
118
|
options: {
|
|
119
|
-
locale:
|
|
120
|
-
channel:
|
|
121
|
-
fallback_url:
|
|
119
|
+
locale: 'en',
|
|
120
|
+
channel: '1',
|
|
121
|
+
fallback_url: '',
|
|
122
122
|
},
|
|
123
123
|
resource: {
|
|
124
|
-
hello:
|
|
125
|
-
lynx:
|
|
124
|
+
hello: 'hello',
|
|
125
|
+
lynx: 'lynx web platform1',
|
|
126
126
|
},
|
|
127
127
|
},
|
|
128
128
|
];
|
|
129
|
-
lynxView.addEventListener(
|
|
129
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
130
130
|
console.log(e);
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
// mts
|
|
134
134
|
_I18nResourceTranslation({
|
|
135
|
-
locale:
|
|
136
|
-
channel:
|
|
137
|
-
fallback_url:
|
|
135
|
+
locale: 'en',
|
|
136
|
+
channel: '1',
|
|
137
|
+
fallback_url: '',
|
|
138
138
|
});
|
|
139
139
|
```
|
|
140
140
|
|
|
@@ -384,8 +384,8 @@
|
|
|
384
384
|
}
|
|
385
385
|
};`,
|
|
386
386
|
],
|
|
387
|
-
{ type:
|
|
388
|
-
)
|
|
387
|
+
{ type: 'text/javascript' },
|
|
388
|
+
),
|
|
389
389
|
),
|
|
390
390
|
};
|
|
391
391
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -475,8 +475,8 @@
|
|
|
475
475
|
};
|
|
476
476
|
};`,
|
|
477
477
|
],
|
|
478
|
-
{ type:
|
|
479
|
-
)
|
|
478
|
+
{ type: 'text/javascript' },
|
|
479
|
+
),
|
|
480
480
|
);
|
|
481
481
|
|
|
482
482
|
const color_methods = URL.createObjectURL(
|
|
@@ -491,8 +491,8 @@
|
|
|
491
491
|
};
|
|
492
492
|
};`,
|
|
493
493
|
],
|
|
494
|
-
{ type:
|
|
495
|
-
)
|
|
494
|
+
{ type: 'text/javascript' },
|
|
495
|
+
),
|
|
496
496
|
);
|
|
497
497
|
|
|
498
498
|
lynxView.napiModuleMap = {
|
|
@@ -509,7 +509,7 @@
|
|
|
509
509
|
|
|
510
510
|
```js
|
|
511
511
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
512
|
-
if (name ===
|
|
512
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
513
513
|
return data.color;
|
|
514
514
|
}
|
|
515
515
|
};
|
|
@@ -564,8 +564,8 @@
|
|
|
564
564
|
}
|
|
565
565
|
};`,
|
|
566
566
|
],
|
|
567
|
-
{ type:
|
|
568
|
-
)
|
|
567
|
+
{ type: 'text/javascript' },
|
|
568
|
+
),
|
|
569
569
|
);
|
|
570
570
|
```
|
|
571
571
|
|
|
@@ -577,7 +577,7 @@
|
|
|
577
577
|
|
|
578
578
|
```js
|
|
579
579
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
580
|
-
if (name ===
|
|
580
|
+
if (name === 'getColor') {
|
|
581
581
|
callback(data.color);
|
|
582
582
|
}
|
|
583
583
|
};
|
|
@@ -587,7 +587,7 @@
|
|
|
587
587
|
|
|
588
588
|
```js
|
|
589
589
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
590
|
-
if (name ===
|
|
590
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
591
591
|
return data.color;
|
|
592
592
|
}
|
|
593
593
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.15.2
|
|
3
|
+
"version": "0.15.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.3",
|
|
26
|
-
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.15.2
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.2
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.2
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.15.2",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.15.2",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.15.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.2"
|