@lynx-js/web-core-server-canary 0.19.0 → 0.19.1-canary-20251210-47cc2bc6

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,7 @@
1
1
  # @lynx-js/web-core-server
2
2
 
3
+ ## 0.19.1-canary-20251210073827-47cc2bc694d0da12b41d55e459c4e78338e8b77a
4
+
3
5
  ## 0.19.0
4
6
 
5
7
  ## 0.18.4
@@ -133,25 +135,25 @@
133
135
  lynxView.initI18nResources = [
134
136
  {
135
137
  options: {
136
- locale: 'en',
137
- channel: '1',
138
- fallback_url: '',
138
+ locale: "en",
139
+ channel: "1",
140
+ fallback_url: "",
139
141
  },
140
142
  resource: {
141
- hello: 'hello',
142
- lynx: 'lynx web platform1',
143
+ hello: "hello",
144
+ lynx: "lynx web platform1",
143
145
  },
144
146
  },
145
147
  ];
146
- lynxView.addEventListener('i18nResourceMissed', (e) => {
148
+ lynxView.addEventListener("i18nResourceMissed", (e) => {
147
149
  console.log(e);
148
150
  });
149
151
 
150
152
  // mts
151
153
  _I18nResourceTranslation({
152
- locale: 'en',
153
- channel: '1',
154
- fallback_url: '',
154
+ locale: "en",
155
+ channel: "1",
156
+ fallback_url: "",
155
157
  });
156
158
  ```
157
159
 
package/dist/27.js CHANGED
@@ -795,7 +795,7 @@ export const __webpack_modules__ = {
795
795
  _createMainThreadGlobalThis_js__rspack_import_3
796
796
  ]);
797
797
  [_utils_processStyleInfo_js__rspack_import_5, _createMainThreadGlobalThis_js__rspack_import_3] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__;
798
- function prepareMainThreadAPIs(backgroundThreadRpc, rootDom, document, mtsRealmPromise, commitDocument, markTimingInternal, flushMarkTimingInternal, reportError, triggerI18nResourceFallback, initialI18nResources, loadTemplate, ssrHooks) {
798
+ function prepareMainThreadAPIs(backgroundThreadRpc, rootDom, document, mtsRealmPromise, commitDocument, markTimingInternal, flushMarkTimingInternal, reportError, triggerI18nResourceFallback, initialI18nResources, loadTemplate, ssrHooks, allOnUI) {
799
799
  const postTimingFlags = backgroundThreadRpc.createCall(_lynx_js_web_constants__rspack_import_0.F6);
800
800
  const backgroundStart = backgroundThreadRpc.createCall(_lynx_js_web_constants__rspack_import_0.a$);
801
801
  const publishEvent = backgroundThreadRpc.createCall(_lynx_js_web_constants__rspack_import_0.JW);
@@ -816,7 +816,7 @@ export const __webpack_modules__ = {
816
816
  sendEventEndpoint: _lynx_js_web_constants__rspack_import_0.jK
817
817
  });
818
818
  const i18nResources = initialI18nResources(initI18nResources);
819
- const { updateCssOGStyle, updateLazyComponentStyle } = (0, _utils_processStyleInfo_js__rspack_import_5.c6)(styleInfo, pageConfig, rootDom, document, ssrHydrateInfo);
819
+ const { updateCssOGStyle, updateLazyComponentStyle } = (0, _utils_processStyleInfo_js__rspack_import_5.c6)(styleInfo, pageConfig, rootDom, document, ssrHydrateInfo, allOnUI);
820
820
  const mtsGlobalThisRef = {
821
821
  mtsGlobalThis: void 0
822
822
  };
@@ -1609,15 +1609,23 @@ export const __webpack_modules__ = {
1609
1609
  }
1610
1610
  return cssIdToImportBy;
1611
1611
  }
1612
- function flattenStyleInfo(styleInfo) {
1612
+ function flattenStyleInfo(styleInfo, cloneDeep) {
1613
1613
  const sortedCssIds = topologicalSort(styleInfo);
1614
1614
  const cssIdToImportBy = generateImportByMap(styleInfo, sortedCssIds);
1615
1615
  sortedCssIds.reverse();
1616
1616
  return sortedCssIds.map((cssId)=>{
1617
1617
  const oneInfo = styleInfo[cssId];
1618
1618
  const flattenedInfo = oneInfo ? {
1619
- content: oneInfo.content,
1620
- rules: oneInfo.rules,
1619
+ content: cloneDeep ? oneInfo.content ? [
1620
+ ...oneInfo.content
1621
+ ] : [] : oneInfo.content ?? [],
1622
+ rules: cloneDeep ? oneInfo.rules ? oneInfo.rules.map((rule)=>({
1623
+ sel: rule.sel.map((selectors)=>selectors.map((arr)=>arr.slice())),
1624
+ decl: rule.decl.map(([k, v])=>[
1625
+ k,
1626
+ v
1627
+ ])
1628
+ })) : [] : oneInfo.rules ?? [],
1621
1629
  importBy: Array.from(cssIdToImportBy.get(cssId) ?? [
1622
1630
  cssId
1623
1631
  ])
@@ -1691,9 +1699,9 @@ export const __webpack_modules__ = {
1691
1699
  });
1692
1700
  return cssOGInfo;
1693
1701
  }
1694
- function appendStyleElement(styleInfo, pageConfig, rootDom, document, ssrHydrateInfo) {
1702
+ function appendStyleElement(styleInfo, pageConfig, rootDom, document, ssrHydrateInfo, allOnUI) {
1695
1703
  const lynxUniqueIdToStyleRulesIndex = ssrHydrateInfo?.lynxUniqueIdToStyleRulesIndex ?? [];
1696
- const flattenedStyleInfo = flattenStyleInfo(styleInfo);
1704
+ const flattenedStyleInfo = flattenStyleInfo(styleInfo, !!allOnUI);
1697
1705
  transformToWebCss(flattenedStyleInfo);
1698
1706
  const cssOGInfo = pageConfig.enableCSSSelector ? {} : genCssOGInfo(flattenedStyleInfo);
1699
1707
  const lazyCSSOGInfo = {};
@@ -1717,7 +1725,7 @@ export const __webpack_modules__ = {
1717
1725
  }
1718
1726
  };
1719
1727
  const updateLazyComponentStyle = (styleInfo, entryName)=>{
1720
- const flattenedStyleInfo = flattenStyleInfo(styleInfo);
1728
+ const flattenedStyleInfo = flattenStyleInfo(styleInfo, !!allOnUI);
1721
1729
  transformToWebCss(flattenedStyleInfo);
1722
1730
  if (!pageConfig.enableCSSSelector) lazyCSSOGInfo[entryName] = genCssOGInfo(flattenedStyleInfo);
1723
1731
  const newStyleSheet = genCssContent(flattenedStyleInfo, pageConfig, entryName);
package/dist/index.js CHANGED
@@ -1436,7 +1436,7 @@ async function createLynxView(config) {
1436
1436
  eventOptions
1437
1437
  ]);
1438
1438
  }
1439
- });
1439
+ }, 'all-on-ui' === threadStrategy);
1440
1440
  await startMainThread({
1441
1441
  template,
1442
1442
  initData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-core-server-canary",
3
- "version": "0.19.0",
3
+ "version": "0.19.1-canary-20251210-47cc2bc6",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -25,11 +25,11 @@
25
25
  "devDependencies": {
26
26
  "rsbuild-plugin-arethetypeswrong": "0.1.1",
27
27
  "rsbuild-plugin-publint": "0.3.3",
28
- "@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.0",
29
- "@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.4",
30
- "@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.0",
28
+ "@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.1-canary-20251210-47cc2bc6",
29
+ "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.1-canary-20251210-47cc2bc6",
31
30
  "@lynx-js/web-elements-template": "npm:@lynx-js/web-elements-template-canary@0.9.0",
32
- "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.0"
31
+ "@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.4",
32
+ "@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.1-canary-20251210-47cc2bc6"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "rslib build",