@lynx-js/web-worker-runtime-canary 0.18.2-canary-20251030-53eed0a5 → 0.18.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.18.2
|
|
3
|
+
## 0.18.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies []:
|
|
8
|
-
- @lynx-js/web-constants@0.18.2
|
|
9
|
-
- @lynx-js/web-mainthread-apis@0.18.2
|
|
10
|
-
- @lynx-js/web-worker-rpc@0.18.2
|
|
8
|
+
- @lynx-js/web-constants@0.18.2
|
|
9
|
+
- @lynx-js/web-mainthread-apis@0.18.2
|
|
10
|
+
- @lynx-js/web-worker-rpc@0.18.2
|
|
11
11
|
|
|
12
12
|
## 0.18.1
|
|
13
13
|
|
|
@@ -204,14 +204,14 @@
|
|
|
204
204
|
Usage:
|
|
205
205
|
|
|
206
206
|
```ts
|
|
207
|
-
import { pluginWebPlatform } from
|
|
208
|
-
import { defineConfig } from
|
|
207
|
+
import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
|
|
208
|
+
import { defineConfig } from '@rsbuild/core';
|
|
209
209
|
|
|
210
210
|
export default defineConfig({
|
|
211
211
|
plugins: [
|
|
212
212
|
pluginWebPlatform({
|
|
213
213
|
// replace with your actual napi-modules file path
|
|
214
|
-
napiModulesPath: path.resolve(__dirname,
|
|
214
|
+
napiModulesPath: path.resolve(__dirname, './index.napi-modules.ts'),
|
|
215
215
|
}),
|
|
216
216
|
],
|
|
217
217
|
});
|
|
@@ -222,10 +222,10 @@
|
|
|
222
222
|
```ts
|
|
223
223
|
// index.napi-modules.ts
|
|
224
224
|
export default {
|
|
225
|
-
custom_module: function
|
|
225
|
+
custom_module: function(NapiModules, NapiModulesCall) {
|
|
226
226
|
return {
|
|
227
227
|
async test(name) {
|
|
228
|
-
console.log(
|
|
228
|
+
console.log('CustomModule', NapiModules, NapiModulesCall);
|
|
229
229
|
},
|
|
230
230
|
};
|
|
231
231
|
},
|
|
@@ -277,25 +277,25 @@
|
|
|
277
277
|
lynxView.initI18nResources = [
|
|
278
278
|
{
|
|
279
279
|
options: {
|
|
280
|
-
locale:
|
|
281
|
-
channel:
|
|
282
|
-
fallback_url:
|
|
280
|
+
locale: 'en',
|
|
281
|
+
channel: '1',
|
|
282
|
+
fallback_url: '',
|
|
283
283
|
},
|
|
284
284
|
resource: {
|
|
285
|
-
hello:
|
|
286
|
-
lynx:
|
|
285
|
+
hello: 'hello',
|
|
286
|
+
lynx: 'lynx web platform1',
|
|
287
287
|
},
|
|
288
288
|
},
|
|
289
289
|
];
|
|
290
|
-
lynxView.addEventListener(
|
|
290
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
291
291
|
console.log(e);
|
|
292
292
|
});
|
|
293
293
|
|
|
294
294
|
// mts
|
|
295
295
|
_I18nResourceTranslation({
|
|
296
|
-
locale:
|
|
297
|
-
channel:
|
|
298
|
-
fallback_url:
|
|
296
|
+
locale: 'en',
|
|
297
|
+
channel: '1',
|
|
298
|
+
fallback_url: '',
|
|
299
299
|
});
|
|
300
300
|
```
|
|
301
301
|
|
|
@@ -545,8 +545,8 @@
|
|
|
545
545
|
}
|
|
546
546
|
};`,
|
|
547
547
|
],
|
|
548
|
-
{ type:
|
|
549
|
-
)
|
|
548
|
+
{ type: 'text/javascript' },
|
|
549
|
+
),
|
|
550
550
|
),
|
|
551
551
|
};
|
|
552
552
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -636,8 +636,8 @@
|
|
|
636
636
|
};
|
|
637
637
|
};`,
|
|
638
638
|
],
|
|
639
|
-
{ type:
|
|
640
|
-
)
|
|
639
|
+
{ type: 'text/javascript' },
|
|
640
|
+
),
|
|
641
641
|
);
|
|
642
642
|
|
|
643
643
|
const color_methods = URL.createObjectURL(
|
|
@@ -652,8 +652,8 @@
|
|
|
652
652
|
};
|
|
653
653
|
};`,
|
|
654
654
|
],
|
|
655
|
-
{ type:
|
|
656
|
-
)
|
|
655
|
+
{ type: 'text/javascript' },
|
|
656
|
+
),
|
|
657
657
|
);
|
|
658
658
|
|
|
659
659
|
lynxView.napiModuleMap = {
|
|
@@ -670,7 +670,7 @@
|
|
|
670
670
|
|
|
671
671
|
```js
|
|
672
672
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
673
|
-
if (name ===
|
|
673
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
674
674
|
return data.color;
|
|
675
675
|
}
|
|
676
676
|
};
|
|
@@ -725,8 +725,8 @@
|
|
|
725
725
|
}
|
|
726
726
|
};`,
|
|
727
727
|
],
|
|
728
|
-
{ type:
|
|
729
|
-
)
|
|
728
|
+
{ type: 'text/javascript' },
|
|
729
|
+
),
|
|
730
730
|
);
|
|
731
731
|
```
|
|
732
732
|
|
|
@@ -738,7 +738,7 @@
|
|
|
738
738
|
|
|
739
739
|
```js
|
|
740
740
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
741
|
-
if (name ===
|
|
741
|
+
if (name === 'getColor') {
|
|
742
742
|
callback(data.color);
|
|
743
743
|
}
|
|
744
744
|
};
|
|
@@ -748,7 +748,7 @@
|
|
|
748
748
|
|
|
749
749
|
```js
|
|
750
750
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
751
|
-
if (name ===
|
|
751
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
752
752
|
return data.color;
|
|
753
753
|
}
|
|
754
754
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-worker-runtime-canary",
|
|
3
|
-
"version": "0.18.2
|
|
3
|
+
"version": "0.18.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.18.2
|
|
27
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.18.2
|
|
28
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.2
|
|
26
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.18.2",
|
|
27
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.18.2",
|
|
28
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@lynx-js/lynx-core": "0.1.3"
|