@lynx-js/web-core-server-canary 0.16.0 → 0.16.1-canary-20250910-c24b6021

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,11 @@
1
1
  # @lynx-js/web-core-server
2
2
 
3
+ ## 0.16.1-canary-20250910033502-c24b60214bbb194adfd96985f3f80d1e0f5a0e08
4
+
5
+ ### Patch Changes
6
+
7
+ - refactor: improve chunk loading ([#1703](https://github.com/lynx-family/lynx-stack/pull/1703))
8
+
3
9
  ## 0.16.0
4
10
 
5
11
  ### Minor Changes
@@ -95,25 +101,25 @@
95
101
  lynxView.initI18nResources = [
96
102
  {
97
103
  options: {
98
- locale: 'en',
99
- channel: '1',
100
- fallback_url: '',
104
+ locale: "en",
105
+ channel: "1",
106
+ fallback_url: "",
101
107
  },
102
108
  resource: {
103
- hello: 'hello',
104
- lynx: 'lynx web platform1',
109
+ hello: "hello",
110
+ lynx: "lynx web platform1",
105
111
  },
106
112
  },
107
113
  ];
108
- lynxView.addEventListener('i18nResourceMissed', (e) => {
114
+ lynxView.addEventListener("i18nResourceMissed", (e) => {
109
115
  console.log(e);
110
116
  });
111
117
 
112
118
  // mts
113
119
  _I18nResourceTranslation({
114
- locale: 'en',
115
- channel: '1',
116
- fallback_url: '',
120
+ locale: "en",
121
+ channel: "1",
122
+ fallback_url: "",
117
123
  });
118
124
  ```
119
125
 
package/dist/index.js CHANGED
@@ -4,17 +4,17 @@ import node_path from "node:path";
4
4
  import node_vm from "node:vm";
5
5
  import node_fs from "node:fs";
6
6
  var __webpack_modules__ = {
7
- "../web-style-transformer/dist/standard.js": function(module, __webpack_exports__, __webpack_require__) {
8
- __webpack_require__.a(module, async function(__webpack_handle_async_dependencies__, __webpack_async_result__) {
7
+ "../web-style-transformer/dist/standard.js": function(__webpack_module__, __webpack_exports__, __webpack_require__) {
8
+ __webpack_require__.a(__webpack_module__, async function(__webpack_handle_async_dependencies__, __webpack_async_result__) {
9
9
  try {
10
10
  __webpack_require__.d(__webpack_exports__, {
11
- M2: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.M2,
11
+ Fz: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.Fz,
12
12
  Qn: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.Qn,
13
13
  aC: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.aC,
14
14
  bL: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.bL,
15
15
  iG: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.iG,
16
16
  lI: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.lI,
17
- tZ: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.tZ,
17
+ qB: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.qB,
18
18
  yc: ()=>_standard_bg_js__WEBPACK_IMPORTED_MODULE_0__.yc
19
19
  });
20
20
  var _standard_bg_wasm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../web-style-transformer/dist/standard_bg.wasm");
@@ -31,40 +31,53 @@ var __webpack_modules__ = {
31
31
  }
32
32
  });
33
33
  },
34
- "../web-style-transformer/dist/standard_bg.js": function(module, __webpack_exports__, __webpack_require__) {
34
+ "../web-style-transformer/dist/standard_bg.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
35
35
  __webpack_require__.d(__webpack_exports__, {
36
- M2: ()=>__wbg_new_78feb108b6472713,
36
+ Fz: ()=>__wbg_new_58353953ad2097cc,
37
37
  Qn: ()=>__wbindgen_throw,
38
38
  aC: ()=>transform_raw_u16_inline_style_ptr,
39
39
  bL: ()=>__wbindgen_init_externref_table,
40
40
  iG: ()=>transform_raw_u16_inline_style_ptr_parsed,
41
41
  lI: ()=>__wbg_set_wasm,
42
- tZ: ()=>__wbg_push_737cfc8c1432c2c6,
42
+ qB: ()=>__wbg_push_73fd7b5550ebf707,
43
43
  yc: ()=>__wbindgen_string_new
44
44
  });
45
- module = __webpack_require__.hmd(module);
46
45
  let wasm;
47
46
  function __wbg_set_wasm(val) {
48
47
  wasm = val;
49
48
  }
49
+ let cachedUint8ArrayMemory0 = null;
50
+ function getUint8ArrayMemory0() {
51
+ if (null === cachedUint8ArrayMemory0 || 0 === cachedUint8ArrayMemory0.byteLength) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
52
+ return cachedUint8ArrayMemory0;
53
+ }
50
54
  const lTextDecoder = 'undefined' == typeof TextDecoder ? (0, module.require)('util').TextDecoder : TextDecoder;
51
55
  let cachedTextDecoder = new lTextDecoder('utf-8', {
52
56
  ignoreBOM: true,
53
57
  fatal: true
54
58
  });
55
59
  cachedTextDecoder.decode();
56
- let cachedUint8ArrayMemory0 = null;
57
- function getUint8ArrayMemory0() {
58
- if (null === cachedUint8ArrayMemory0 || 0 === cachedUint8ArrayMemory0.byteLength) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
59
- return cachedUint8ArrayMemory0;
60
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
61
+ let numBytesDecoded = 0;
62
+ function decodeText(ptr, len) {
63
+ numBytesDecoded += len;
64
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
65
+ cachedTextDecoder = new lTextDecoder('utf-8', {
66
+ ignoreBOM: true,
67
+ fatal: true
68
+ });
69
+ cachedTextDecoder.decode();
70
+ numBytesDecoded = len;
71
+ }
72
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
60
73
  }
61
74
  function getStringFromWasm0(ptr, len) {
62
75
  ptr >>>= 0;
63
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
76
+ return decodeText(ptr, len);
64
77
  }
65
78
  let WASM_VECTOR_LEN = 0;
66
79
  const lTextEncoder = 'undefined' == typeof TextEncoder ? (0, module.require)('util').TextEncoder : TextEncoder;
67
- let cachedTextEncoder = new lTextEncoder('utf-8');
80
+ const cachedTextEncoder = new lTextEncoder('utf-8');
68
81
  const encodeString = 'function' == typeof cachedTextEncoder.encodeInto ? function(arg, view) {
69
82
  return cachedTextEncoder.encodeInto(arg, view);
70
83
  } : function(arg, view) {
@@ -122,11 +135,11 @@ var __webpack_modules__ = {
122
135
  const ret = wasm.transform_raw_u16_inline_style_ptr_parsed(ptr0, len0, ptr1, len1);
123
136
  return ret;
124
137
  }
125
- function __wbg_new_78feb108b6472713() {
138
+ function __wbg_new_58353953ad2097cc() {
126
139
  const ret = new Array();
127
140
  return ret;
128
141
  }
129
- function __wbg_push_737cfc8c1432c2c6(arg0, arg1) {
142
+ function __wbg_push_73fd7b5550ebf707(arg0, arg1) {
130
143
  const ret = arg0.push(arg1);
131
144
  return ret;
132
145
  }
@@ -147,13 +160,13 @@ var __webpack_modules__ = {
147
160
  throw new Error(getStringFromWasm0(arg0, arg1));
148
161
  }
149
162
  },
150
- "../web-style-transformer/standard.js": function(module, __webpack_exports__, __webpack_require__) {
151
- __webpack_require__.a(module, async function(__webpack_handle_async_dependencies__, __webpack_async_result__) {
163
+ "../web-style-transformer/standard.js": function(__webpack_module__, __webpack_exports__, __webpack_require__) {
164
+ __webpack_require__.a(__webpack_module__, async function(__webpack_handle_async_dependencies__, __webpack_async_result__) {
152
165
  try {
153
166
  __webpack_require__.r(__webpack_exports__);
154
167
  __webpack_require__.d(__webpack_exports__, {
155
- __wbg_new_78feb108b6472713: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.M2,
156
- __wbg_push_737cfc8c1432c2c6: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.tZ,
168
+ __wbg_new_58353953ad2097cc: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.Fz,
169
+ __wbg_push_73fd7b5550ebf707: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.qB,
157
170
  __wbg_set_wasm: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.lI,
158
171
  __wbindgen_init_externref_table: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.bL,
159
172
  __wbindgen_string_new: ()=>_dist_standard_js__WEBPACK_IMPORTED_MODULE_0__.yc,
@@ -172,13 +185,13 @@ var __webpack_modules__ = {
172
185
  }
173
186
  });
174
187
  },
175
- "../web-style-transformer/dist/standard_bg.wasm": function(module, exports, __webpack_require__) {
188
+ "../web-style-transformer/dist/standard_bg.wasm": function(module1, exports, __webpack_require__) {
176
189
  var WEBPACK_IMPORTED_MODULE_0 = __webpack_require__("../web-style-transformer/dist/standard_bg.js");
177
- module.exports = __webpack_require__.v(exports, module.id, "431436911960378f", {
190
+ module1.exports = __webpack_require__.v(exports, module1.id, "17b28b9ab851fb78", {
178
191
  "./standard_bg.js": {
179
- __wbg_new_78feb108b6472713: WEBPACK_IMPORTED_MODULE_0.M2,
192
+ __wbg_new_58353953ad2097cc: WEBPACK_IMPORTED_MODULE_0.Fz,
180
193
  __wbindgen_string_new: WEBPACK_IMPORTED_MODULE_0.yc,
181
- __wbg_push_737cfc8c1432c2c6: WEBPACK_IMPORTED_MODULE_0.tZ,
194
+ __wbg_push_73fd7b5550ebf707: WEBPACK_IMPORTED_MODULE_0.qB,
182
195
  __wbindgen_throw: WEBPACK_IMPORTED_MODULE_0.Qn,
183
196
  __wbindgen_init_externref_table: WEBPACK_IMPORTED_MODULE_0.bL
184
197
  }
@@ -189,14 +202,12 @@ var __webpack_module_cache__ = {};
189
202
  function __webpack_require__(moduleId) {
190
203
  var cachedModule = __webpack_module_cache__[moduleId];
191
204
  if (void 0 !== cachedModule) return cachedModule.exports;
192
- var module = __webpack_module_cache__[moduleId] = {
205
+ var module1 = __webpack_module_cache__[moduleId] = {
193
206
  id: moduleId,
194
- loaded: false,
195
207
  exports: {}
196
208
  };
197
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
198
- module.loaded = true;
199
- return module.exports;
209
+ __webpack_modules__[moduleId](module1, module1.exports, __webpack_require__);
210
+ return module1.exports;
200
211
  }
201
212
  __webpack_require__.m = __webpack_modules__;
202
213
  (()=>{
@@ -233,11 +244,11 @@ __webpack_require__.m = __webpack_modules__;
233
244
  ret[webpackExports] = dep;
234
245
  return ret;
235
246
  });
236
- __webpack_require__.a = (module, body, hasAwait)=>{
247
+ __webpack_require__.a = (module1, body, hasAwait)=>{
237
248
  var queue;
238
249
  hasAwait && ((queue = []).d = -1);
239
250
  var depQueues = new Set();
240
- var exports = module.exports;
251
+ var exports = module1.exports;
241
252
  var currentDeps;
242
253
  var outerResolve;
243
254
  var reject;
@@ -249,7 +260,7 @@ __webpack_require__.m = __webpack_modules__;
249
260
  promise[webpackQueues] = (fn)=>{
250
261
  queue && fn(queue), depQueues.forEach(fn), promise["catch"](function() {});
251
262
  };
252
- module.exports = promise;
263
+ module1.exports = promise;
253
264
  body((deps)=>{
254
265
  currentDeps = wrapDeps(deps);
255
266
  var fn;
@@ -283,19 +294,6 @@ __webpack_require__.m = __webpack_modules__;
283
294
  return promises;
284
295
  }, []));
285
296
  })();
286
- (()=>{
287
- __webpack_require__.hmd = (module)=>{
288
- module = Object.create(module);
289
- if (!module.children) module.children = [];
290
- Object.defineProperty(module, 'exports', {
291
- enumerable: true,
292
- set: ()=>{
293
- throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
294
- }
295
- });
296
- return module;
297
- };
298
- })();
299
297
  (()=>{
300
298
  __webpack_require__.u = (chunkId)=>"legacy-wasm-chunk.js";
301
299
  })();
@@ -389,17 +387,14 @@ __webpack_require__.m = __webpack_modules__;
389
387
  }
390
388
  };
391
389
  })();
392
- const lynxUniqueIdAttribute = 'l-uid';
393
390
  const cssIdAttribute = 'l-css-id';
394
391
  const componentIdAttribute = 'l-comp-id';
395
392
  const parentComponentUniqueIdAttribute = 'l-p-comp-uid';
396
393
  const lynxEntryNameAttribute = 'l-e-name';
397
394
  const lynxTagAttribute = 'lynx-tag';
398
- const lynxDatasetAttribute = 'l-dset';
399
395
  const lynxComponentConfigAttribute = 'l-comp-cfg';
400
396
  const lynxDisposedAttribute = 'l-disposed';
401
397
  const lynxElementTemplateMarkerAttribute = 'l-template';
402
- const lynxPartIdAttribute = 'l-part';
403
398
  const lynxDefaultDisplayLinearAttribute = 'lynx-default-display-linear';
404
399
  const __lynx_timing_flag = '__lynx_timing_flag';
405
400
  const systemInfo = {
@@ -742,9 +737,10 @@ const globalDisallowedVars = [
742
737
  const templateUpgraders = [
743
738
  (template)=>{
744
739
  const defaultInjectStr = "Card,setTimeout,setInterval,clearInterval,clearTimeout,NativeModules,Component,ReactLynx,nativeAppId,Behavior,LynxJSBI,lynx,window,document,frames,location,navigator,localStorage,history,Caches,screen,alert,confirm,prompt,fetch,XMLHttpRequest,__WebSocket__,webkit,Reporter,print,global,requestAnimationFrame,cancelAnimationFrame";
740
+ template.appType = template.lepusCode.root.startsWith('(function (globDynamicComponentEntry') ? 'lazy' : 'card';
745
741
  template.manifest = Object.fromEntries(Object.entries(template.manifest).map(([key, value])=>[
746
742
  key,
747
- `{init: (lynxCoreInject) => { var {${defaultInjectStr}} = lynxCoreInject.tt; var module = {exports:null}; ${value}\n return module.exports; } }`
743
+ `module.exports={init: (lynxCoreInject) => { var {${defaultInjectStr}} = lynxCoreInject.tt; var module = {exports:null}; ${value}\n return module.exports; } }`
748
744
  ]));
749
745
  template.lepusCode = Object.fromEntries(Object.entries(template.lepusCode).map(([key, value])=>[
750
746
  key,
@@ -754,17 +750,18 @@ const templateUpgraders = [
754
750
  return template;
755
751
  }
756
752
  ];
757
- const generateModuleContent = (content)=>[
758
- '//# allFunctionsCalledOnLoad\n',
759
- '"use strict";\n',
760
- `(() => {const ${globalDisallowedVars.join('=void 0,')}=void 0;module.exports = `,
753
+ const generateModuleContent = (content, eager)=>[
754
+ eager ? '//# allFunctionsCalledOnLoad' : '',
755
+ '\n(function() { "use strict"; const ',
756
+ globalDisallowedVars.join('=void 0,'),
757
+ '=void 0;\n',
761
758
  content,
762
759
  '\n})()'
763
760
  ].join('');
764
- async function generateJavascriptUrl(obj, createJsModuleUrl, templateName) {
761
+ async function generateJavascriptUrl(obj, createJsModuleUrl, eager, templateName) {
765
762
  const processEntry = async ([name, content])=>[
766
763
  name,
767
- await createJsModuleUrl(generateModuleContent(content), `${templateName}-${name.replaceAll('/', '')}.js`)
764
+ await createJsModuleUrl(generateModuleContent(content, eager), `${templateName}-${name.replaceAll('/', '')}.js`)
768
765
  ];
769
766
  return Promise.all(Object.entries(obj).filter(([_, content])=>'string' == typeof content).map(processEntry)).then(Object.fromEntries);
770
767
  }
@@ -775,8 +772,8 @@ async function generateTemplate(template, createJsModuleUrl, templateName) {
775
772
  while(template.version < currentSupportedTemplateVersion && (upgrader = templateUpgraders[template.version - 1]))template = upgrader(template);
776
773
  return {
777
774
  ...template,
778
- lepusCode: await generateJavascriptUrl(template.lepusCode, createJsModuleUrl, templateName),
779
- manifest: await generateJavascriptUrl(template.manifest, createJsModuleUrl, templateName)
775
+ lepusCode: await generateJavascriptUrl(template.lepusCode, createJsModuleUrl, true, templateName),
776
+ manifest: await generateJavascriptUrl(template.manifest, createJsModuleUrl, false, templateName)
780
777
  };
781
778
  }
782
779
  function registerCallLepusMethodHandler(rpc, runtime) {
@@ -1159,11 +1156,11 @@ const __AddConfig = /*#__PURE__*/ (element, type, value)=>{
1159
1156
  const __AddDataset = /*#__PURE__*/ (element, key, value)=>{
1160
1157
  const currentDataset = __GetDataset(element);
1161
1158
  currentDataset[key] = value;
1162
- element.setAttribute(lynxDatasetAttribute, encodeURIComponent(JSON.stringify(currentDataset)));
1159
+ element.setAttribute("l-dset", encodeURIComponent(JSON.stringify(currentDataset)));
1163
1160
  value ? element.setAttribute('data-' + key, value.toString()) : element.removeAttribute('data-' + key);
1164
1161
  };
1165
1162
  const __GetDataset = /*#__PURE__*/ (element)=>{
1166
- const datasetString = element.getAttribute(lynxDatasetAttribute);
1163
+ const datasetString = element.getAttribute("l-dset");
1167
1164
  const currentDataset = datasetString ? JSON.parse(decodeURIComponent(datasetString)) : {};
1168
1165
  return currentDataset;
1169
1166
  };
@@ -1181,7 +1178,7 @@ const __GetElementConfig = /*#__PURE__*/ (element)=>{
1181
1178
  return currentComponentConfigString ? JSON.parse(decodeURIComponent(currentComponentConfigString)) : {};
1182
1179
  };
1183
1180
  const __GetAttributeByName = /*#__PURE__*/ (element, name)=>element.getAttribute(name);
1184
- const __GetElementUniqueID = /*#__PURE__*/ (element)=>element && element.getAttribute ? Number(element.getAttribute(lynxUniqueIdAttribute)) : -1;
1181
+ const __GetElementUniqueID = /*#__PURE__*/ (element)=>element && element.getAttribute ? Number(element.getAttribute("l-uid")) : -1;
1185
1182
  const __GetID = /*#__PURE__*/ (element)=>element.getAttribute('id');
1186
1183
  const __SetID = /*#__PURE__*/ (element, id)=>id ? element.setAttribute('id', id) : element.removeAttribute('id');
1187
1184
  const __GetTag = /*#__PURE__*/ (element)=>element.getAttribute(lynxTagAttribute);
@@ -1189,7 +1186,7 @@ const __SetConfig = /*#__PURE__*/ (element, config)=>{
1189
1186
  element.setAttribute(lynxComponentConfigAttribute, encodeURIComponent(JSON.stringify(config)));
1190
1187
  };
1191
1188
  const __SetDataset = /*#__PURE__*/ (element, dataset)=>{
1192
- element.setAttribute(lynxDatasetAttribute, encodeURIComponent(JSON.stringify(dataset)));
1189
+ element.setAttribute("l-dset", encodeURIComponent(JSON.stringify(dataset)));
1193
1190
  for (const [key, value] of Object.entries(dataset))element.setAttribute('data-' + key, value.toString());
1194
1191
  };
1195
1192
  const __UpdateComponentID = /*#__PURE__*/ (element, componentID)=>element.setAttribute(componentIdAttribute, componentID);
@@ -1244,9 +1241,9 @@ const __GetTemplateParts = (templateElement)=>{
1244
1241
  if (!isTemplate) return {};
1245
1242
  const templateUniqueId = __GetElementUniqueID(templateElement);
1246
1243
  const parts = {};
1247
- const partElements = templateElement.querySelectorAll(`[${lynxUniqueIdAttribute}="${templateUniqueId}"] [${lynxPartIdAttribute}]:not([${lynxUniqueIdAttribute}="${templateUniqueId}"] [${lynxElementTemplateMarkerAttribute}] [${lynxPartIdAttribute}])`);
1244
+ const partElements = templateElement.querySelectorAll(`[l-uid="${templateUniqueId}"] [l-part]:not([l-uid="${templateUniqueId}"] [${lynxElementTemplateMarkerAttribute}] [l-part])`);
1248
1245
  for (const partElement of partElements){
1249
- const partId = partElement.getAttribute(lynxPartIdAttribute);
1246
+ const partId = partElement.getAttribute("l-part");
1250
1247
  if (partId) parts[partId] = partElement;
1251
1248
  }
1252
1249
  return parts;
@@ -1255,7 +1252,7 @@ const __MarkTemplateElement = (element)=>{
1255
1252
  element.setAttribute(lynxElementTemplateMarkerAttribute, '');
1256
1253
  };
1257
1254
  const __MarkPartElement = (element, partId)=>{
1258
- element.setAttribute(lynxPartIdAttribute, partId);
1255
+ element.setAttribute("l-part", partId);
1259
1256
  };
1260
1257
  function toCloneableObject(obj) {
1261
1258
  const cloneableObj = {};
@@ -1299,9 +1296,9 @@ function createCrossThreadEvent(domEvent, eventName) {
1299
1296
  changedTouches: isTrusted ? changedTouches.map(toCloneableObject) : changedTouches
1300
1297
  });
1301
1298
  }
1302
- const currentTargetDatasetString = currentTargetElement?.getAttribute(lynxDatasetAttribute);
1299
+ const currentTargetDatasetString = currentTargetElement?.getAttribute("l-dset");
1303
1300
  const currentTargetDataset = currentTargetDatasetString ? JSON.parse(decodeURIComponent(currentTargetDatasetString)) : {};
1304
- const targetDatasetString = targetElement.getAttribute(lynxDatasetAttribute);
1301
+ const targetDatasetString = targetElement.getAttribute("l-dset");
1305
1302
  const targetDataset = targetDatasetString ? JSON.parse(decodeURIComponent(targetDatasetString)) : {};
1306
1303
  return {
1307
1304
  type: eventName,
@@ -1309,12 +1306,12 @@ function createCrossThreadEvent(domEvent, eventName) {
1309
1306
  target: {
1310
1307
  id: targetElement.getAttribute('id'),
1311
1308
  dataset: targetDataset,
1312
- uniqueId: Number(targetElement.getAttribute(lynxUniqueIdAttribute))
1309
+ uniqueId: Number(targetElement.getAttribute("l-uid"))
1313
1310
  },
1314
1311
  currentTarget: currentTargetElement ? {
1315
1312
  id: currentTargetElement.getAttribute('id'),
1316
1313
  dataset: currentTargetDataset,
1317
- uniqueId: Number(currentTargetElement.getAttribute(lynxUniqueIdAttribute))
1314
+ uniqueId: Number(currentTargetElement.getAttribute("l-uid"))
1318
1315
  } : null,
1319
1316
  detail: domEvent.detail ?? {},
1320
1317
  params,
@@ -1451,7 +1448,7 @@ function createMainThreadGlobalThis(config) {
1451
1448
  const parentComponentCssID = lynxUniqueIdToElement[parentComponentUniqueId]?.deref()?.getAttribute(cssIdAttribute);
1452
1449
  parentComponentCssID && '0' !== parentComponentCssID && element.setAttribute(cssIdAttribute, parentComponentCssID);
1453
1450
  element.setAttribute(lynxTagAttribute, tag);
1454
- element.setAttribute(lynxUniqueIdAttribute, uniqueId + '');
1451
+ element.setAttribute("l-uid", uniqueId + '');
1455
1452
  element.setAttribute(parentComponentUniqueIdAttribute, parentComponentUniqueId + '');
1456
1453
  return element;
1457
1454
  };
@@ -1543,13 +1540,13 @@ function createMainThreadGlobalThis(config) {
1543
1540
  const newClassName = ((element.getAttribute('class') ?? '') + ' ' + className).trim();
1544
1541
  element.setAttribute('class', newClassName);
1545
1542
  const cssId = element.getAttribute(cssIdAttribute);
1546
- const uniqueId = Number(element.getAttribute(lynxUniqueIdAttribute));
1543
+ const uniqueId = Number(element.getAttribute("l-uid"));
1547
1544
  callbacks.updateCssOGStyle(uniqueId, newClassName, cssId);
1548
1545
  };
1549
1546
  const __SetClassesForCSSOG = (element, classNames)=>{
1550
1547
  __SetClasses(element, classNames);
1551
1548
  const cssId = element.getAttribute(cssIdAttribute);
1552
- const uniqueId = Number(element.getAttribute(lynxUniqueIdAttribute));
1549
+ const uniqueId = Number(element.getAttribute("l-uid"));
1553
1550
  callbacks.updateCssOGStyle(uniqueId, classNames ?? '', cssId);
1554
1551
  };
1555
1552
  const __LoadLepusChunk = (path)=>{
@@ -1587,7 +1584,7 @@ function createMainThreadGlobalThis(config) {
1587
1584
  };
1588
1585
  const applyEventsForElementTemplate = (data, element)=>{
1589
1586
  const uniqueId = uniqueIdInc++;
1590
- element.setAttribute(lynxUniqueIdAttribute, uniqueId + '');
1587
+ element.setAttribute("l-uid", uniqueId + '');
1591
1588
  for (const event of data.events || []){
1592
1589
  const { type, name, value } = event;
1593
1590
  __AddEvent(element, type, name, value);
@@ -1720,7 +1717,7 @@ function createExposureService(rootDom, postExposure) {
1720
1717
  const onScreen = new Map();
1721
1718
  function exposureEventHandler(ev) {
1722
1719
  const exposureEvent = createCrossThreadEvent(ev, ev.type);
1723
- exposureEvent.detail['unique-id'] = parseFloat(ev.target.getAttribute(lynxUniqueIdAttribute));
1720
+ exposureEvent.detail['unique-id'] = parseFloat(ev.target.getAttribute("l-uid"));
1724
1721
  const exposureID = exposureEvent.detail.exposureID;
1725
1722
  if ('exposure' === ev.type) {
1726
1723
  exposureCache.push(exposureEvent);
@@ -1882,7 +1879,7 @@ function appendStyleElement(styleInfo, pageConfig, rootDom, document, entryName,
1882
1879
  const rule = cardStyleElementSheet.cssRules[lynxUniqueIdToStyleRulesIndex[uniqueId]];
1883
1880
  rule.style.cssText = newStyles;
1884
1881
  } else {
1885
- const index = cardStyleElementSheet.insertRule(`[${lynxUniqueIdAttribute}="${uniqueId}"]{${newStyles}}`, cardStyleElementSheet.cssRules.length);
1882
+ const index = cardStyleElementSheet.insertRule(`[l-uid="${uniqueId}"]{${newStyles}}`, cardStyleElementSheet.cssRules.length);
1886
1883
  lynxUniqueIdToStyleRulesIndex[uniqueId] = index;
1887
1884
  }
1888
1885
  };
@@ -2654,8 +2651,8 @@ function getTextContentImpl(buffer, element, shadowrootTemplates) {
2654
2651
  buffer.push('"');
2655
2652
  }
2656
2653
  }
2657
- const partId = element[_attributes].get(lynxPartIdAttribute) ?? element[_attributes].get(lynxUniqueIdAttribute);
2658
- buffer.push(' ', lynxPartIdAttribute, '="', partId, '"');
2654
+ const partId = element[_attributes].get("l-part") ?? element[_attributes].get("l-uid");
2655
+ buffer.push(' ', "l-part", '="', partId, '"');
2659
2656
  buffer.push('>');
2660
2657
  const templateImpl = shadowrootTemplates[localName];
2661
2658
  if (templateImpl) {
@@ -2697,7 +2694,7 @@ const builtinTagTransformMap = {
2697
2694
  };
2698
2695
  OffscreenElement.prototype.toJSON = function() {
2699
2696
  return {
2700
- ssrID: this[_attributes].get(lynxPartIdAttribute) ?? this[_attributes].get(lynxUniqueIdAttribute)
2697
+ ssrID: this[_attributes].get("l-part") ?? this[_attributes].get("l-uid")
2701
2698
  };
2702
2699
  };
2703
2700
  async function createLynxView(config) {
@@ -2723,7 +2720,15 @@ async function createLynxView(config) {
2723
2720
  const script = new node_vm.Script(scriptContent.toString(), {
2724
2721
  filename: url
2725
2722
  });
2726
- return script.runInContext(mtsVMContext);
2723
+ mtsVMContext.module = {
2724
+ exports: null
2725
+ };
2726
+ script.runInContext(mtsVMContext);
2727
+ const ret = mtsVMContext.module.exports;
2728
+ mtsVMContext.module = {
2729
+ exports: null
2730
+ };
2731
+ return ret;
2727
2732
  };
2728
2733
  const loadScript = async (url)=>new Promise((resolve, reject)=>{
2729
2734
  node_fs.readFile(url, (err, data)=>{
@@ -2732,8 +2737,15 @@ async function createLynxView(config) {
2732
2737
  const script = new node_vm.Script(data.toString(), {
2733
2738
  filename: url
2734
2739
  });
2735
- const result = script.runInContext(mtsVMContext);
2736
- resolve(result);
2740
+ mtsVMContext.module = {
2741
+ exports: null
2742
+ };
2743
+ script.runInContext(mtsVMContext);
2744
+ const ret = mtsVMContext.module.exports;
2745
+ mtsVMContext.module = {
2746
+ exports: null
2747
+ };
2748
+ resolve(ret);
2737
2749
  } catch (e) {
2738
2750
  reject(e);
2739
2751
  }
@@ -2751,7 +2763,7 @@ async function createLynxView(config) {
2751
2763
  }, {
2752
2764
  __AddEvent (element, eventName, eventData, eventOptions) {
2753
2765
  events.push([
2754
- Number(element.getAttribute(lynxUniqueIdAttribute)),
2766
+ Number(element.getAttribute("l-uid")),
2755
2767
  eventName,
2756
2768
  eventData,
2757
2769
  eventOptions
@@ -3,17 +3,17 @@ export const __webpack_ids__ = [
3
3
  "8"
4
4
  ];
5
5
  export const __webpack_modules__ = {
6
- "../web-style-transformer/dist/legacy.js": function(module, __webpack_exports__, __webpack_require__) {
7
- __webpack_require__.a(module, async function(__webpack_handle_async_dependencies__, __webpack_async_result__) {
6
+ "../web-style-transformer/dist/legacy.js": function(__webpack_module__, __webpack_exports__, __webpack_require__) {
7
+ __webpack_require__.a(__webpack_module__, async function(__webpack_handle_async_dependencies__, __webpack_async_result__) {
8
8
  try {
9
9
  __webpack_require__.d(__webpack_exports__, {
10
- M2: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.M2,
10
+ Fz: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.Fz,
11
11
  Qn: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.Qn,
12
12
  aC: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.aC,
13
13
  bk: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.bk,
14
14
  iG: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.iG,
15
15
  lI: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.lI,
16
- tZ: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.tZ,
16
+ qB: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.qB,
17
17
  yc: ()=>_legacy_bg_js__WEBPACK_IMPORTED_MODULE_0__.yc
18
18
  });
19
19
  var _legacy_bg_wasm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../web-style-transformer/dist/legacy_bg.wasm");
@@ -29,18 +29,17 @@ export const __webpack_modules__ = {
29
29
  }
30
30
  });
31
31
  },
32
- "../web-style-transformer/dist/legacy_bg.js": function(module, __webpack_exports__, __webpack_require__) {
32
+ "../web-style-transformer/dist/legacy_bg.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
33
33
  __webpack_require__.d(__webpack_exports__, {
34
- M2: ()=>__wbg_new_78feb108b6472713,
34
+ Fz: ()=>__wbg_new_58353953ad2097cc,
35
35
  Qn: ()=>__wbindgen_throw,
36
36
  aC: ()=>transform_raw_u16_inline_style_ptr,
37
37
  bk: ()=>__wbindgen_object_drop_ref,
38
38
  iG: ()=>transform_raw_u16_inline_style_ptr_parsed,
39
39
  lI: ()=>__wbg_set_wasm,
40
- tZ: ()=>__wbg_push_737cfc8c1432c2c6,
40
+ qB: ()=>__wbg_push_73fd7b5550ebf707,
41
41
  yc: ()=>__wbindgen_string_new
42
42
  });
43
- module = __webpack_require__.hmd(module);
44
43
  let wasm;
45
44
  function __wbg_set_wasm(val) {
46
45
  wasm = val;
@@ -68,24 +67,38 @@ export const __webpack_modules__ = {
68
67
  dropObject(idx);
69
68
  return ret;
70
69
  }
70
+ let cachedUint8ArrayMemory0 = null;
71
+ function getUint8ArrayMemory0() {
72
+ if (null === cachedUint8ArrayMemory0 || 0 === cachedUint8ArrayMemory0.byteLength) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
73
+ return cachedUint8ArrayMemory0;
74
+ }
71
75
  const lTextDecoder = 'undefined' == typeof TextDecoder ? (0, module.require)('util').TextDecoder : TextDecoder;
72
76
  let cachedTextDecoder = new lTextDecoder('utf-8', {
73
77
  ignoreBOM: true,
74
78
  fatal: true
75
79
  });
76
80
  cachedTextDecoder.decode();
77
- let cachedUint8ArrayMemory0 = null;
78
- function getUint8ArrayMemory0() {
79
- if (null === cachedUint8ArrayMemory0 || 0 === cachedUint8ArrayMemory0.byteLength) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
80
- return cachedUint8ArrayMemory0;
81
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
82
+ let numBytesDecoded = 0;
83
+ function decodeText(ptr, len) {
84
+ numBytesDecoded += len;
85
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
86
+ cachedTextDecoder = new lTextDecoder('utf-8', {
87
+ ignoreBOM: true,
88
+ fatal: true
89
+ });
90
+ cachedTextDecoder.decode();
91
+ numBytesDecoded = len;
92
+ }
93
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
81
94
  }
82
95
  function getStringFromWasm0(ptr, len) {
83
96
  ptr >>>= 0;
84
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
97
+ return decodeText(ptr, len);
85
98
  }
86
99
  let WASM_VECTOR_LEN = 0;
87
100
  const lTextEncoder = 'undefined' == typeof TextEncoder ? (0, module.require)('util').TextEncoder : TextEncoder;
88
- let cachedTextEncoder = new lTextEncoder('utf-8');
101
+ const cachedTextEncoder = new lTextEncoder('utf-8');
89
102
  const encodeString = 'function' == typeof cachedTextEncoder.encodeInto ? function(arg, view) {
90
103
  return cachedTextEncoder.encodeInto(arg, view);
91
104
  } : function(arg, view) {
@@ -155,11 +168,11 @@ export const __webpack_modules__ = {
155
168
  const ret = wasm.transform_raw_u16_inline_style_ptr_parsed(ptr0, len0, ptr1, len1);
156
169
  return takeObject(ret);
157
170
  }
158
- function __wbg_new_78feb108b6472713() {
171
+ function __wbg_new_58353953ad2097cc() {
159
172
  const ret = new Array();
160
173
  return addHeapObject(ret);
161
174
  }
162
- function __wbg_push_737cfc8c1432c2c6(arg0, arg1) {
175
+ function __wbg_push_73fd7b5550ebf707(arg0, arg1) {
163
176
  const ret = getObject(arg0).push(getObject(arg1));
164
177
  return ret;
165
178
  }
@@ -174,13 +187,13 @@ export const __webpack_modules__ = {
174
187
  throw new Error(getStringFromWasm0(arg0, arg1));
175
188
  }
176
189
  },
177
- "../web-style-transformer/legacy.js": function(module, __webpack_exports__, __webpack_require__) {
178
- __webpack_require__.a(module, async function(__webpack_handle_async_dependencies__, __webpack_async_result__) {
190
+ "../web-style-transformer/legacy.js": function(__webpack_module__, __webpack_exports__, __webpack_require__) {
191
+ __webpack_require__.a(__webpack_module__, async function(__webpack_handle_async_dependencies__, __webpack_async_result__) {
179
192
  try {
180
193
  __webpack_require__.r(__webpack_exports__);
181
194
  __webpack_require__.d(__webpack_exports__, {
182
- __wbg_new_78feb108b6472713: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.M2,
183
- __wbg_push_737cfc8c1432c2c6: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.tZ,
195
+ __wbg_new_58353953ad2097cc: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.Fz,
196
+ __wbg_push_73fd7b5550ebf707: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.qB,
184
197
  __wbg_set_wasm: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.lI,
185
198
  __wbindgen_object_drop_ref: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.bk,
186
199
  __wbindgen_string_new: ()=>_dist_legacy_js__WEBPACK_IMPORTED_MODULE_0__.yc,
@@ -202,13 +215,13 @@ export const __webpack_modules__ = {
202
215
  }
203
216
  });
204
217
  },
205
- "../web-style-transformer/dist/legacy_bg.wasm": function(module, exports, __webpack_require__) {
218
+ "../web-style-transformer/dist/legacy_bg.wasm": function(module1, exports, __webpack_require__) {
206
219
  var WEBPACK_IMPORTED_MODULE_0 = __webpack_require__("../web-style-transformer/dist/legacy_bg.js");
207
- module.exports = __webpack_require__.v(exports, module.id, "578076972e1e5ffd", {
220
+ module1.exports = __webpack_require__.v(exports, module1.id, "92aacec2bdee2fc5", {
208
221
  "./legacy_bg.js": {
209
- __wbg_new_78feb108b6472713: WEBPACK_IMPORTED_MODULE_0.M2,
222
+ __wbg_new_58353953ad2097cc: WEBPACK_IMPORTED_MODULE_0.Fz,
210
223
  __wbindgen_string_new: WEBPACK_IMPORTED_MODULE_0.yc,
211
- __wbg_push_737cfc8c1432c2c6: WEBPACK_IMPORTED_MODULE_0.tZ,
224
+ __wbg_push_73fd7b5550ebf707: WEBPACK_IMPORTED_MODULE_0.qB,
212
225
  __wbindgen_object_drop_ref: WEBPACK_IMPORTED_MODULE_0.bk,
213
226
  __wbindgen_throw: WEBPACK_IMPORTED_MODULE_0.Qn
214
227
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-core-server-canary",
3
- "version": "0.16.0",
3
+ "version": "0.16.1-canary-20250910-c24b6021",
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-constants": "npm:@lynx-js/web-constants-canary@0.16.0",
30
- "@lynx-js/web-elements-template": "npm:@lynx-js/web-elements-template-canary@0.8.4",
31
- "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.16.0",
32
- "@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.16.0"
29
+ "@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.16.1-canary-20250910-c24b6021",
30
+ "@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.16.1-canary-20250910-c24b6021",
31
+ "@lynx-js/web-elements-template": "npm:@lynx-js/web-elements-template-canary@0.8.5",
32
+ "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.16.1-canary-20250910-c24b6021"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "rslib build",