@lynx-js/web-core-canary 0.19.2-canary-20251222-4d689a71 → 0.19.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 +41 -31
- package/dist/apis/LynxView.d.ts +1 -1
- package/dist/apis/LynxView.js +4 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
# @lynx-js/web-core
|
|
2
2
|
|
|
3
|
-
## 0.19.2
|
|
3
|
+
## 0.19.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- chore: mark the "multi-thread" deprecated ([#2030](https://github.com/lynx-family/lynx-stack/pull/2030))
|
|
8
|
+
|
|
9
|
+
**NOTICE This will be a breaking change in the future**
|
|
10
|
+
|
|
11
|
+
mark the thread strategy "multi-thread" as deprecated.
|
|
12
|
+
|
|
13
|
+
Please use "all-on-ui" instead. If you still want to use multi-thread mode, please try to use a cross-origin isolated iframe.
|
|
14
|
+
|
|
15
|
+
A console warning will be printed if `thread-strategy` is set to `multi-thread`.
|
|
16
|
+
|
|
7
17
|
- fix csp issue for mts realm ([#1998](https://github.com/lynx-family/lynx-stack/pull/1998))
|
|
8
18
|
|
|
9
19
|
- Updated dependencies []:
|
|
10
|
-
- @lynx-js/web-constants@0.19.2
|
|
11
|
-
- @lynx-js/web-mainthread-apis@0.19.2
|
|
12
|
-
- @lynx-js/web-worker-rpc@0.19.2
|
|
13
|
-
- @lynx-js/web-worker-runtime@0.19.2
|
|
20
|
+
- @lynx-js/web-constants@0.19.2
|
|
21
|
+
- @lynx-js/web-mainthread-apis@0.19.2
|
|
22
|
+
- @lynx-js/web-worker-rpc@0.19.2
|
|
23
|
+
- @lynx-js/web-worker-runtime@0.19.2
|
|
14
24
|
|
|
15
25
|
## 0.19.1
|
|
16
26
|
|
|
@@ -440,25 +450,25 @@
|
|
|
440
450
|
lynxView.initI18nResources = [
|
|
441
451
|
{
|
|
442
452
|
options: {
|
|
443
|
-
locale:
|
|
444
|
-
channel:
|
|
445
|
-
fallback_url:
|
|
453
|
+
locale: 'en',
|
|
454
|
+
channel: '1',
|
|
455
|
+
fallback_url: '',
|
|
446
456
|
},
|
|
447
457
|
resource: {
|
|
448
|
-
hello:
|
|
449
|
-
lynx:
|
|
458
|
+
hello: 'hello',
|
|
459
|
+
lynx: 'lynx web platform1',
|
|
450
460
|
},
|
|
451
461
|
},
|
|
452
462
|
];
|
|
453
|
-
lynxView.addEventListener(
|
|
463
|
+
lynxView.addEventListener('i18nResourceMissed', (e) => {
|
|
454
464
|
console.log(e);
|
|
455
465
|
});
|
|
456
466
|
|
|
457
467
|
// mts
|
|
458
468
|
_I18nResourceTranslation({
|
|
459
|
-
locale:
|
|
460
|
-
channel:
|
|
461
|
-
fallback_url:
|
|
469
|
+
locale: 'en',
|
|
470
|
+
channel: '1',
|
|
471
|
+
fallback_url: '',
|
|
462
472
|
});
|
|
463
473
|
```
|
|
464
474
|
|
|
@@ -866,8 +876,8 @@
|
|
|
866
876
|
}
|
|
867
877
|
};`,
|
|
868
878
|
],
|
|
869
|
-
{ type:
|
|
870
|
-
)
|
|
879
|
+
{ type: 'text/javascript' },
|
|
880
|
+
),
|
|
871
881
|
),
|
|
872
882
|
};
|
|
873
883
|
lynxView.nativeModulesMap = nativeModulesMap;
|
|
@@ -982,8 +992,8 @@
|
|
|
982
992
|
};
|
|
983
993
|
};`,
|
|
984
994
|
],
|
|
985
|
-
{ type:
|
|
986
|
-
)
|
|
995
|
+
{ type: 'text/javascript' },
|
|
996
|
+
),
|
|
987
997
|
);
|
|
988
998
|
|
|
989
999
|
const color_methods = URL.createObjectURL(
|
|
@@ -998,8 +1008,8 @@
|
|
|
998
1008
|
};
|
|
999
1009
|
};`,
|
|
1000
1010
|
],
|
|
1001
|
-
{ type:
|
|
1002
|
-
)
|
|
1011
|
+
{ type: 'text/javascript' },
|
|
1012
|
+
),
|
|
1003
1013
|
);
|
|
1004
1014
|
|
|
1005
1015
|
lynxView.napiModuleMap = {
|
|
@@ -1016,7 +1026,7 @@
|
|
|
1016
1026
|
|
|
1017
1027
|
```js
|
|
1018
1028
|
lynxView.onNapiModulesCall = (name, data, moduleName) => {
|
|
1019
|
-
if (name ===
|
|
1029
|
+
if (name === 'getColor' && moduleName === 'color_methods') {
|
|
1020
1030
|
return data.color;
|
|
1021
1031
|
}
|
|
1022
1032
|
};
|
|
@@ -1095,8 +1105,8 @@
|
|
|
1095
1105
|
}
|
|
1096
1106
|
};`,
|
|
1097
1107
|
],
|
|
1098
|
-
{ type:
|
|
1099
|
-
)
|
|
1108
|
+
{ type: 'text/javascript' },
|
|
1109
|
+
),
|
|
1100
1110
|
);
|
|
1101
1111
|
```
|
|
1102
1112
|
|
|
@@ -1108,7 +1118,7 @@
|
|
|
1108
1118
|
|
|
1109
1119
|
```js
|
|
1110
1120
|
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
1111
|
-
if (name ===
|
|
1121
|
+
if (name === 'getColor') {
|
|
1112
1122
|
callback(data.color);
|
|
1113
1123
|
}
|
|
1114
1124
|
};
|
|
@@ -1118,7 +1128,7 @@
|
|
|
1118
1128
|
|
|
1119
1129
|
```js
|
|
1120
1130
|
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
1121
|
-
if (name ===
|
|
1131
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
1122
1132
|
return data.color;
|
|
1123
1133
|
}
|
|
1124
1134
|
};
|
|
@@ -1476,7 +1486,7 @@
|
|
|
1476
1486
|
This flag changes the behaviour of cascading. It provide a way to do this
|
|
1477
1487
|
|
|
1478
1488
|
```jsx
|
|
1479
|
-
<view class=
|
|
1489
|
+
<view class='class-a class-b' />;
|
|
1480
1490
|
```
|
|
1481
1491
|
|
|
1482
1492
|
The class-b will override (cascading) styles of class-a.
|
|
@@ -1576,11 +1586,11 @@
|
|
|
1576
1586
|
There is also a simple way to use this feature
|
|
1577
1587
|
|
|
1578
1588
|
```javascript
|
|
1579
|
-
import { LynxCard } from
|
|
1580
|
-
import { loadElement } from
|
|
1581
|
-
import
|
|
1582
|
-
import
|
|
1583
|
-
import
|
|
1589
|
+
import { LynxCard } from '@lynx-js/web-core';
|
|
1590
|
+
import { loadElement } from '@lynx-js/web-elements/lazy';
|
|
1591
|
+
import '@lynx-js/web-elements/index.css';
|
|
1592
|
+
import '@lynx-js/web-core/index.css';
|
|
1593
|
+
import './index.css';
|
|
1584
1594
|
|
|
1585
1595
|
const lynxcard = new LynxCard({
|
|
1586
1596
|
...beforeConfigs,
|
package/dist/apis/LynxView.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export type INapiModulesCall = (name: string, data: any, moduleName: string, lyn
|
|
|
23
23
|
* @property {"false" | "true" | null} injectHeadLinks [optional] (attribute: "inject-head-links") @default true set it to "false" to disable injecting the <link href="" ref="stylesheet"> styles into shadowroot
|
|
24
24
|
* @property {string[]} injectStyleRules [optional] the css rules which will be injected into shadowroot. Each items will be inserted by `insertRule` method. @see https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/insertRule
|
|
25
25
|
* @property {number} lynxGroupId [optional] (attribute: "lynx-group-id") the background shared context id, which is used to share webworker between different lynx cards
|
|
26
|
-
* @property {"all-on-ui" | "multi-thread"} threadStrategy [optional] @default "multi-thread" (attribute: "thread-strategy") controls the thread strategy for current lynx view
|
|
27
26
|
* @property {(string)=>Promise<LynxTemplate>} customTemplateLoader [optional] the custom template loader, which is used to load the template
|
|
28
27
|
* @property {InitI18nResources} initI18nResources [optional] (attribute: "init-i18n-resources") the complete set of i18nResources that on the container side, which can be obtained synchronously by _I18nResourceTranslation
|
|
29
28
|
*
|
|
@@ -165,6 +164,7 @@ export declare class LynxView extends HTMLElement {
|
|
|
165
164
|
/**
|
|
166
165
|
* @param
|
|
167
166
|
* @property
|
|
167
|
+
* @deprecated multi-thread is deprecated, please use "all-on-ui" instead. If you still want to use multi-thread mode, please try to use a cross-origin isolated iframe.
|
|
168
168
|
*/
|
|
169
169
|
get threadStrategy(): 'all-on-ui' | 'multi-thread';
|
|
170
170
|
set threadStrategy(val: 'all-on-ui' | 'multi-thread');
|
package/dist/apis/LynxView.js
CHANGED
|
@@ -20,7 +20,6 @@ import { inShadowRootStyles, lynxDisposedAttribute, lynxTagAttribute, } from '@l
|
|
|
20
20
|
* @property {"false" | "true" | null} injectHeadLinks [optional] (attribute: "inject-head-links") @default true set it to "false" to disable injecting the <link href="" ref="stylesheet"> styles into shadowroot
|
|
21
21
|
* @property {string[]} injectStyleRules [optional] the css rules which will be injected into shadowroot. Each items will be inserted by `insertRule` method. @see https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/insertRule
|
|
22
22
|
* @property {number} lynxGroupId [optional] (attribute: "lynx-group-id") the background shared context id, which is used to share webworker between different lynx cards
|
|
23
|
-
* @property {"all-on-ui" | "multi-thread"} threadStrategy [optional] @default "multi-thread" (attribute: "thread-strategy") controls the thread strategy for current lynx view
|
|
24
23
|
* @property {(string)=>Promise<LynxTemplate>} customTemplateLoader [optional] the custom template loader, which is used to load the template
|
|
25
24
|
* @property {InitI18nResources} initI18nResources [optional] (attribute: "init-i18n-resources") the complete set of i18nResources that on the container side, which can be obtained synchronously by _I18nResourceTranslation
|
|
26
25
|
*
|
|
@@ -284,6 +283,7 @@ export class LynxView extends HTMLElement {
|
|
|
284
283
|
/**
|
|
285
284
|
* @param
|
|
286
285
|
* @property
|
|
286
|
+
* @deprecated multi-thread is deprecated, please use "all-on-ui" instead. If you still want to use multi-thread mode, please try to use a cross-origin isolated iframe.
|
|
287
287
|
*/
|
|
288
288
|
get threadStrategy() {
|
|
289
289
|
// @ts-expect-error
|
|
@@ -362,6 +362,9 @@ export class LynxView extends HTMLElement {
|
|
|
362
362
|
}
|
|
363
363
|
const lynxGroupId = this.lynxGroupId;
|
|
364
364
|
const threadStrategy = (this.threadStrategy ?? 'all-on-ui');
|
|
365
|
+
if (threadStrategy === 'multi-thread') {
|
|
366
|
+
console.warn(`[LynxView] multi-thread strategy is deprecated, please use "all-on-ui" instead. If you still want to use multi-thread mode, please try to use a cross-origin isolated iframe.`);
|
|
367
|
+
}
|
|
365
368
|
const lynxView = createLynxView({
|
|
366
369
|
threadStrategy,
|
|
367
370
|
tagMap,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-core-canary",
|
|
3
|
-
"version": "0.19.2
|
|
3
|
+
"version": "0.19.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.4",
|
|
28
|
-
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.2
|
|
29
|
-
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.2
|
|
30
|
-
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.2
|
|
31
|
-
"@lynx-js/web-worker-runtime": "npm:@lynx-js/web-worker-runtime-canary@0.19.2
|
|
28
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.2",
|
|
29
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.2",
|
|
30
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.2",
|
|
31
|
+
"@lynx-js/web-worker-runtime": "npm:@lynx-js/web-worker-runtime-canary@0.19.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@lynx-js/lynx-core": "0.1.3",
|