@lynx-js/web-core-server-canary 0.17.0-canary-20250918-db58f3c8 → 0.17.0-canary-20250919-d150ed44
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 +1 -1
- package/dist/index.js +15 -9
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1532,9 +1532,10 @@ function createMainThreadGlobalThis(config) {
|
|
|
1532
1532
|
childB.replaceWith(childA);
|
|
1533
1533
|
temp.replaceWith(childB);
|
|
1534
1534
|
};
|
|
1535
|
-
const __SetCSSIdForCSSOG = (elements, cssId)=>{
|
|
1535
|
+
const __SetCSSIdForCSSOG = (elements, cssId, entryName)=>{
|
|
1536
1536
|
for (const element of elements){
|
|
1537
1537
|
element.setAttribute(cssIdAttribute, cssId + '');
|
|
1538
|
+
entryName && element.setAttribute(lynxEntryNameAttribute, entryName);
|
|
1538
1539
|
const cls = element.getAttribute('class');
|
|
1539
1540
|
cls && __SetClassesForCSSOG(element, cls);
|
|
1540
1541
|
}
|
|
@@ -1544,13 +1545,15 @@ function createMainThreadGlobalThis(config) {
|
|
|
1544
1545
|
element.setAttribute('class', newClassName);
|
|
1545
1546
|
const cssId = element.getAttribute(cssIdAttribute);
|
|
1546
1547
|
const uniqueId = Number(element.getAttribute("l-uid"));
|
|
1547
|
-
|
|
1548
|
+
const entryName = element.getAttribute(lynxEntryNameAttribute);
|
|
1549
|
+
callbacks.updateCssOGStyle(uniqueId, newClassName, cssId, entryName);
|
|
1548
1550
|
};
|
|
1549
1551
|
const __SetClassesForCSSOG = (element, classNames)=>{
|
|
1550
1552
|
__SetClasses(element, classNames);
|
|
1551
1553
|
const cssId = element.getAttribute(cssIdAttribute);
|
|
1552
1554
|
const uniqueId = Number(element.getAttribute("l-uid"));
|
|
1553
|
-
|
|
1555
|
+
const entryName = element.getAttribute(lynxEntryNameAttribute);
|
|
1556
|
+
callbacks.updateCssOGStyle(uniqueId, classNames ?? '', cssId, entryName);
|
|
1554
1557
|
};
|
|
1555
1558
|
const __LoadLepusChunk = (path)=>{
|
|
1556
1559
|
try {
|
|
@@ -1908,21 +1911,23 @@ function genCssOGInfo(styleInfo) {
|
|
|
1908
1911
|
});
|
|
1909
1912
|
return cssOGInfo;
|
|
1910
1913
|
}
|
|
1911
|
-
function appendStyleElement(styleInfo, pageConfig, rootDom, document,
|
|
1914
|
+
function appendStyleElement(styleInfo, pageConfig, rootDom, document, ssrHydrateInfo) {
|
|
1912
1915
|
const lynxUniqueIdToStyleRulesIndex = ssrHydrateInfo?.lynxUniqueIdToStyleRulesIndex ?? [];
|
|
1913
1916
|
const flattenedStyleInfo = flattenStyleInfo(styleInfo);
|
|
1914
1917
|
transformToWebCss(flattenedStyleInfo);
|
|
1915
1918
|
const cssOGInfo = pageConfig.enableCSSSelector ? {} : genCssOGInfo(flattenedStyleInfo);
|
|
1919
|
+
const lazyCSSOGInfo = {};
|
|
1916
1920
|
let cardStyleElement;
|
|
1917
1921
|
if (ssrHydrateInfo?.cardStyleElement) cardStyleElement = ssrHydrateInfo.cardStyleElement;
|
|
1918
1922
|
else {
|
|
1919
1923
|
cardStyleElement = document.createElement('style');
|
|
1920
|
-
cardStyleElement.textContent = genCssContent(flattenedStyleInfo, pageConfig,
|
|
1924
|
+
cardStyleElement.textContent = genCssContent(flattenedStyleInfo, pageConfig, void 0);
|
|
1921
1925
|
rootDom.appendChild(cardStyleElement);
|
|
1922
1926
|
}
|
|
1923
|
-
const
|
|
1924
|
-
|
|
1925
|
-
const
|
|
1927
|
+
const updateCssOGStyle = (uniqueId, newClassName, cssID, entryName)=>{
|
|
1928
|
+
const cardStyleElementSheet = cardStyleElement.sheet;
|
|
1929
|
+
const styleMap = entryName && lazyCSSOGInfo[entryName] ? lazyCSSOGInfo[entryName] : cssOGInfo;
|
|
1930
|
+
const newStyles = decodeCssOG(newClassName, styleMap, cssID);
|
|
1926
1931
|
if (void 0 !== lynxUniqueIdToStyleRulesIndex[uniqueId]) {
|
|
1927
1932
|
const rule = cardStyleElementSheet.cssRules[lynxUniqueIdToStyleRulesIndex[uniqueId]];
|
|
1928
1933
|
rule.style.cssText = newStyles;
|
|
@@ -1934,6 +1939,7 @@ function appendStyleElement(styleInfo, pageConfig, rootDom, document, entryName,
|
|
|
1934
1939
|
const updateLazyComponentStyle = (styleInfo, entryName)=>{
|
|
1935
1940
|
const flattenedStyleInfo = flattenStyleInfo(styleInfo);
|
|
1936
1941
|
transformToWebCss(flattenedStyleInfo);
|
|
1942
|
+
if (!pageConfig.enableCSSSelector) lazyCSSOGInfo[entryName] = genCssOGInfo(flattenedStyleInfo);
|
|
1937
1943
|
const newStyleSheet = genCssContent(flattenedStyleInfo, pageConfig, entryName);
|
|
1938
1944
|
cardStyleElement.textContent += newStyleSheet;
|
|
1939
1945
|
};
|
|
@@ -2014,7 +2020,7 @@ function prepareMainThreadAPIs(backgroundThreadRpc, rootDom, document, mtsRealm,
|
|
|
2014
2020
|
sendEventEndpoint: dispatchCoreContextOnBackgroundEndpoint
|
|
2015
2021
|
});
|
|
2016
2022
|
const i18nResources = initialI18nResources(initI18nResources);
|
|
2017
|
-
const { updateCssOGStyle, updateLazyComponentStyle } = appendStyleElement(styleInfo, pageConfig, rootDom, document,
|
|
2023
|
+
const { updateCssOGStyle, updateLazyComponentStyle } = appendStyleElement(styleInfo, pageConfig, rootDom, document, ssrHydrateInfo);
|
|
2018
2024
|
const mtsGlobalThisRef = {
|
|
2019
2025
|
mtsGlobalThis: void 0
|
|
2020
2026
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-core-server-canary",
|
|
3
|
-
"version": "0.17.0-canary-
|
|
3
|
+
"version": "0.17.0-canary-20250919-d150ed44",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"rsbuild-plugin-arethetypeswrong": "0.1.1",
|
|
27
27
|
"rsbuild-plugin-publint": "0.3.3",
|
|
28
28
|
"@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.4",
|
|
29
|
-
"@lynx-js/web-
|
|
30
|
-
"@lynx-js/web-
|
|
31
|
-
"@lynx-js/web-
|
|
32
|
-
"@lynx-js/web-
|
|
29
|
+
"@lynx-js/web-elements-template": "npm:@lynx-js/web-elements-template-canary@0.8.7-canary-20250919-d150ed44",
|
|
30
|
+
"@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.17.0-canary-20250919-d150ed44",
|
|
31
|
+
"@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.17.0-canary-20250919-d150ed44",
|
|
32
|
+
"@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.17.0-canary-20250919-d150ed44"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "rslib build",
|