@lynx-js/web-mainthread-apis 0.14.1 → 0.14.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
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @lynx-js/web-mainthread-apis
|
|
2
2
|
|
|
3
|
+
## 0.14.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: merge multiple markTiming RPC communication events together and send them together, which can effectively reduce the number of RPC communications. ([#1178](https://github.com/lynx-family/lynx-stack/pull/1178))
|
|
8
|
+
|
|
9
|
+
- fix: correctly handle with CSS compound-selector, such as `.a.b`, which will be processed as `.a .b` incorrectly. ([#1187](https://github.com/lynx-family/lynx-stack/pull/1187))
|
|
10
|
+
|
|
11
|
+
This problem also occurs when used in combination with other selectors, here are some ways to write styles that worked incorrectly before this commit:
|
|
12
|
+
|
|
13
|
+
- `.a.b { }`
|
|
14
|
+
- `.a.b view { }`
|
|
15
|
+
- `.a.b:not(.c) { }`
|
|
16
|
+
- `.a.b::placeholder { }`
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`e44b146`](https://github.com/lynx-family/lynx-stack/commit/e44b146b1bc2b58c0347af7fb4e4157688e07e36), [`6ca5b91`](https://github.com/lynx-family/lynx-stack/commit/6ca5b9106aade393dfac88914b160960a61a82f2)]:
|
|
19
|
+
- @lynx-js/web-constants@0.14.2
|
|
20
|
+
|
|
3
21
|
## 0.14.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Rpc, type StartMainThreadContextConfig, type RpcCallType, type reportErrorEndpoint, type MainThreadGlobalThis, type I18nResourceTranslationOptions, type InitI18nResources, type I18nResources } from '@lynx-js/web-constants';
|
|
2
|
-
export declare function prepareMainThreadAPIs(backgroundThreadRpc: Rpc, rootDom: Document | ShadowRoot, createElement: Document['createElement'], commitDocument: () => Promise<void> | void, markTimingInternal: (timingKey: string, pipelineId?: string) => void, reportError: RpcCallType<typeof reportErrorEndpoint>, triggerI18nResourceFallback: (options: I18nResourceTranslationOptions) => void, initialI18nResources: (data: InitI18nResources) => I18nResources): {
|
|
2
|
+
export declare function prepareMainThreadAPIs(backgroundThreadRpc: Rpc, rootDom: Document | ShadowRoot, createElement: Document['createElement'], commitDocument: () => Promise<void> | void, markTimingInternal: (timingKey: string, pipelineId?: string) => void, flushMarkTimingInternal: () => void, reportError: RpcCallType<typeof reportErrorEndpoint>, triggerI18nResourceFallback: (options: I18nResourceTranslationOptions) => void, initialI18nResources: (data: InitI18nResources) => I18nResources): {
|
|
3
3
|
startMainThread: (config: StartMainThreadContextConfig) => Promise<MainThreadGlobalThis>;
|
|
4
4
|
};
|
|
@@ -7,7 +7,7 @@ import { registerGetCustomSectionHandler } from './crossThreadHandlers/registerG
|
|
|
7
7
|
import { createMainThreadGlobalThis } from './createMainThreadGlobalThis.js';
|
|
8
8
|
import { createExposureService } from './utils/createExposureService.js';
|
|
9
9
|
const moduleCache = {};
|
|
10
|
-
export function prepareMainThreadAPIs(backgroundThreadRpc, rootDom, createElement, commitDocument, markTimingInternal, reportError, triggerI18nResourceFallback, initialI18nResources) {
|
|
10
|
+
export function prepareMainThreadAPIs(backgroundThreadRpc, rootDom, createElement, commitDocument, markTimingInternal, flushMarkTimingInternal, reportError, triggerI18nResourceFallback, initialI18nResources) {
|
|
11
11
|
const postTimingFlags = backgroundThreadRpc.createCall(postTimingFlagsEndpoint);
|
|
12
12
|
const backgroundStart = backgroundThreadRpc.createCall(BackgroundThreadStartEndpoint);
|
|
13
13
|
const publishEvent = backgroundThreadRpc.createCall(publishEventEndpoint);
|
|
@@ -94,6 +94,7 @@ export function prepareMainThreadAPIs(backgroundThreadRpc, rootDom, createElemen
|
|
|
94
94
|
markTimingInternal('ui_operation_flush_end', pipelineId);
|
|
95
95
|
markTimingInternal('layout_end', pipelineId);
|
|
96
96
|
markTimingInternal('dispatch_end', pipelineId);
|
|
97
|
+
flushMarkTimingInternal();
|
|
97
98
|
requestAnimationFrame(() => {
|
|
98
99
|
postTimingFlags(timingFlags, pipelineId);
|
|
99
100
|
});
|
|
@@ -75,7 +75,7 @@ export function genCssContent(styleInfo, pageConfig) {
|
|
|
75
75
|
const { sel: selectorList, decl: declarations } = rule;
|
|
76
76
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice
|
|
77
77
|
const selectorString = selectorList.map((selectors) => {
|
|
78
|
-
return selectors.toSpliced(-4, 0, [suffix]).join('');
|
|
78
|
+
return selectors.toSpliced(-4, 0, [suffix]).flat().join('');
|
|
79
79
|
}).join(',');
|
|
80
80
|
const declarationString = declarations.map(([k, v]) => `${k}:${v};`).join('');
|
|
81
81
|
return `${selectorString}{${declarationString}}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-mainthread-apis",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"css-tree": "^3.1.0",
|
|
27
27
|
"hyphenate-style-name": "^1.1.0",
|
|
28
|
-
"@lynx-js/web-constants": "0.14.
|
|
28
|
+
"@lynx-js/web-constants": "0.14.2",
|
|
29
29
|
"@lynx-js/web-style-transformer": "0.3.1"
|
|
30
30
|
}
|
|
31
31
|
}
|