jsf.js_next_gen 4.1.0-beta.20 → 4.1.0-beta.21

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/README.md CHANGED
@@ -281,6 +281,16 @@ Tests
281
281
  - Added tests for HiddenInputBuilder, Lang, and async queue
282
282
 
283
283
 
284
+ ## 4.1.0-beta.21
285
+
286
+ - Performance improvements on DOM operations
287
+ - Faster deep element lookups on large pages: shadow-root collection in `mona-dish`
288
+ now iterates the raw `NodeList` directly instead of materializing every element of
289
+ the page into intermediate arrays, avoiding several full-page-size array copies per
290
+ deep search (relevant for partial updates replacing very large DOM trees).
291
+ - Dependency update
292
+ - Updated `mona-dish` to `0.50.0-beta.8`
293
+
284
294
  ## 4.1.0-beta.20
285
295
 
286
296
  - Bugfix: focus bug in the new refocus code of `mona-dish`
@@ -249,6 +249,40 @@ enqueues on separate instances to cancel each other's debounce window</li>
249
249
  <li>Added tests for ExtDomQuery (nonce DOM fallback, runHeadInserts text-node path) and ExtConfig (append, appendIf, deepCopy)</li>
250
250
  <li>Added tests for HiddenInputBuilder, Lang, and async queue</li>
251
251
  </ul>
252
+ <h2 id="410-beta20" class="tsd-anchor-link">4.1.0-beta.20<a href="#410-beta20" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
253
+ <ul>
254
+ <li>Bugfix: focus bug in the new refocus code of <code>mona-dish</code>
255
+ <ul>
256
+ <li>Fixed upstream in <code>mona-dish</code> <code>0.50.0-beta.6</code>; the bundles are rebuilt against that version.</li>
257
+ </ul>
258
+ </li>
259
+ <li>Dependency update
260
+ <ul>
261
+ <li>Updated <code>mona-dish</code> to <code>0.50.0-beta.6</code></li>
262
+ </ul>
263
+ </li>
264
+ </ul>
265
+ <h2 id="410-beta19" class="tsd-anchor-link">4.1.0-beta.19<a href="#410-beta19" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
266
+ <ul>
267
+ <li>Bugfix: Chromium error on huge DOM replacements
268
+ <ul>
269
+ <li>Partial responses replacing very large DOM trees (~150,000 nodes) failed on Chromium-based
270
+ browsers because unchunked large arrays were passed in a single <code>push(...array)</code> /
271
+ constructor-spread call, exceeding the engine's argument-count limit. <code>mona-dish</code> now
272
+ appends in chunks of 30,000 elements (<code>pushChunked</code> / <code>Es2019ArrayFrom</code>), and all
273
+ <code>DomQuery</code> node-list paths go through the chunk-safe code.</li>
274
+ </ul>
275
+ </li>
276
+ <li>Dependency update
277
+ <ul>
278
+ <li>Updated <code>mona-dish</code> to <code>0.50.0-beta.5</code></li>
279
+ </ul>
280
+ </li>
281
+ </ul>
282
+ <h2 id="410-beta18" class="tsd-anchor-link">4.1.0-beta.18<a href="#410-beta18" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
283
+ <ul>
284
+ <li>Added missing ASL2 license headers</li>
285
+ </ul>
252
286
  <h2 id="410-beta17" class="tsd-anchor-link">4.1.0-beta.17<a href="#410-beta17" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
253
287
  <ul>
254
288
  <li>Bugfix: caret position regression on partial updates
@@ -330,4 +364,4 @@ itself.</li>
330
364
  generative AI Tooling, as per <a href="https://www.apache.org/legal/generative-tooling.html">https://www.apache.org/legal/generative-tooling.html</a>
331
365
  disclosures now are added!
332
366
  See AI_CONTRIBUTIONS.md for full disclosure</p>
333
- </div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#🚀-scratchpad-for-the-typescript-based-reimplementation-of-jsfjs"><span>🚀 <wbr/>Scratchpad for the <wbr/>Type<wbr/>Script-<wbr/>based reimplementation of jsf.js</span></a><ul><li><a href="#what-is-this"><span>What is this?</span></a></li><li><a href="#status"><span>Status</span></a></li><li><ul><li><a href="#special-info"><span>Special <wbr/>Info</span></a></li><li><a href="#general-build"><span>General <wbr/>Build</span></a></li><li><ul><li><a href="#on-windows"><span>On <wbr/>Windows</span></a></li></ul></li><li><a href="#tests"><span>Tests</span></a></li><li><a href="#test-coverage"><span>Test <wbr/>Coverage</span></a></li><li><a href="#changelist-compared-to-the-original-implementation"><span>Changelist compared to the original implementation</span></a></li></ul></li><li><a href="#upload-support"><span>Upload <wbr/>Support</span></a></li><li><a href="#changes-since-40"><span>Changes since 4.0</span></a></li><li><a href="#changes-since-410-beta-10"><span>Changes since 4.1.0-<wbr/>beta-<wbr/>10</span></a></li><li><a href="#410-beta17"><span>4.1.0-<wbr/>beta.17</span></a></li><li><a href="#410-beta16"><span>4.1.0-<wbr/>beta.16</span></a></li><li><a href="#410-beta15"><span>4.1.0-<wbr/>beta.15</span></a></li><li><a href="#410-beta13-410-beta14"><span>4.1.0-<wbr/>beta.13 / 4.1.0-<wbr/>beta.14</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">jsf.js_next_gen</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
367
+ </div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#🚀-scratchpad-for-the-typescript-based-reimplementation-of-jsfjs"><span>🚀 <wbr/>Scratchpad for the <wbr/>Type<wbr/>Script-<wbr/>based reimplementation of jsf.js</span></a><ul><li><a href="#what-is-this"><span>What is this?</span></a></li><li><a href="#status"><span>Status</span></a></li><li><ul><li><a href="#special-info"><span>Special <wbr/>Info</span></a></li><li><a href="#general-build"><span>General <wbr/>Build</span></a></li><li><ul><li><a href="#on-windows"><span>On <wbr/>Windows</span></a></li></ul></li><li><a href="#tests"><span>Tests</span></a></li><li><a href="#test-coverage"><span>Test <wbr/>Coverage</span></a></li><li><a href="#changelist-compared-to-the-original-implementation"><span>Changelist compared to the original implementation</span></a></li></ul></li><li><a href="#upload-support"><span>Upload <wbr/>Support</span></a></li><li><a href="#changes-since-40"><span>Changes since 4.0</span></a></li><li><a href="#changes-since-410-beta-10"><span>Changes since 4.1.0-<wbr/>beta-<wbr/>10</span></a></li><li><a href="#410-beta20"><span>4.1.0-<wbr/>beta.20</span></a></li><li><a href="#410-beta19"><span>4.1.0-<wbr/>beta.19</span></a></li><li><a href="#410-beta18"><span>4.1.0-<wbr/>beta.18</span></a></li><li><a href="#410-beta17"><span>4.1.0-<wbr/>beta.17</span></a></li><li><a href="#410-beta16"><span>4.1.0-<wbr/>beta.16</span></a></li><li><a href="#410-beta15"><span>4.1.0-<wbr/>beta.15</span></a></li><li><a href="#410-beta13-410-beta14"><span>4.1.0-<wbr/>beta.13 / 4.1.0-<wbr/>beta.14</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">jsf.js_next_gen</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
@@ -1055,15 +1055,46 @@ class DomQuery {
1055
1055
  if (queryRes.length) {
1056
1056
  found.push(queryRes);
1057
1057
  }
1058
- let shadowRoots = this.querySelectorAll("*").shadowRoot;
1058
+ let shadowRoots = this._collectShadowRoots();
1059
1059
  if (shadowRoots.length) {
1060
- let shadowRes = shadowRoots.querySelectorAllDeep(queryStr);
1060
+ let shadowRes = new DomQuery(shadowRoots).querySelectorAllDeep(queryStr);
1061
1061
  if (shadowRes.length) {
1062
1062
  found.push(shadowRes);
1063
1063
  }
1064
1064
  }
1065
1065
  return new DomQuery(found);
1066
1066
  }
1067
+ /**
1068
+ * Collects the shadow roots hosted by the light-DOM descendants of each root
1069
+ * node in a single pass.
1070
+ *
1071
+ * This replaces the prior `querySelectorAll("*").shadowRoot`, which
1072
+ * materialized a DomQuery wrapping every element on the page and then walked
1073
+ * that throwaway collection a second time through the shadowRoot getter. We
1074
+ * still have to inspect every element - there is no CSS selector for "has a
1075
+ * shadow root", so the cost stays O(number of elements) - but we drop the
1076
+ * intermediate all-elements DomQuery and the redundant second traversal.
1077
+ *
1078
+ * @private
1079
+ */
1080
+ _collectShadowRoots() {
1081
+ var _a, _b;
1082
+ let shadowRoots = [];
1083
+ for (let cnt = 0; cnt < ((_b = (_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0); cnt++) {
1084
+ let root = this.rootNode[cnt];
1085
+ if (!(root === null || root === void 0 ? void 0 : root.querySelectorAll)) {
1086
+ continue;
1087
+ }
1088
+ let all = root.querySelectorAll("*");
1089
+ for (let i = 0, len = all.length; i < len; i++) {
1090
+ let shadowRoot = all[i].shadowRoot;
1091
+ if (shadowRoot) {
1092
+ shadowRoots.push(shadowRoot);
1093
+ }
1094
+ }
1095
+ }
1096
+ return shadowRoots;
1097
+ }
1067
1098
  /**
1068
1099
  * disabled flag
1069
1100
  */
@@ -1085,7 +1116,11 @@ class DomQuery {
1085
1116
  get childNodes() {
1086
1117
  let childNodeArr = [];
1087
1118
  this.eachElem((item) => {
1088
- childNodeArr = childNodeArr.concat(objToArray(item.childNodes));
1119
+ // push the live childNodes list straight into the single target in
1120
+ // chunks instead of concat(objToArray(...)) per root, which both
1121
+ // copied each child list and reallocated the growing accumulator
1122
+ // (O(roots * total children))
1123
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(childNodeArr, item.childNodes);
1089
1124
  });
1090
1125
  return new DomQuery(childNodeArr);
1091
1126
  }
@@ -1339,6 +1374,11 @@ class DomQuery {
1339
1374
  .filter(item => id == item.id)
1340
1375
  .map(item => new DomQuery(item)));
1341
1376
  }
1377
+ // a "deep" id search must collect matches across every scope: ids are
1378
+ // unique only within a single node-tree, so the same id may legitimately
1379
+ // exist in the light DOM and inside one or more shadow roots at once.
1380
+ // We therefore cannot short-circuit on a light-DOM hit and must run the
1381
+ // full deep search.
1342
1382
  let subItems = this.querySelectorAllDeep(`[id="${id}"]`);
1343
1383
  if (subItems.length) {
1344
1384
  res.push(subItems);
@@ -1355,9 +1395,12 @@ class DomQuery {
1355
1395
  var _a;
1356
1396
  let res = [];
1357
1397
  if (includeRoot) {
1358
- res = (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)((_a = this === null || this === void 0 ? void 0 : this.rootNode) !== null && _a !== void 0 ? _a : [])
1359
- .filter(element => (element === null || element === void 0 ? void 0 : element.tagName) == tagName)
1360
- .reduce((reduction, item) => reduction.concat([item]), res);
1398
+ // append the matching roots in a single pass; the prior
1399
+ // reduce(reduction.concat([item])) reallocated the accumulator on
1400
+ // every match (O(matches^2))
1401
+ let matchingRoots = (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.Es2019ArrayFrom)((_a = this === null || this === void 0 ? void 0 : this.rootNode) !== null && _a !== void 0 ? _a : [])
1402
+ .filter(element => (element === null || element === void 0 ? void 0 : element.tagName) == tagName);
1403
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(res, matchingRoots);
1361
1404
  }
1362
1405
  (deep) ? res.push(this.querySelectorAllDeep(tagName)) : res.push(this.querySelectorAll(tagName));
1363
1406
  return new DomQuery(res);
@@ -2457,7 +2500,11 @@ class DomQuery {
2457
2500
  continue;
2458
2501
  }
2459
2502
  let res = this.rootNode[cnt].querySelectorAll(selector);
2460
- nodes = nodes.concat(objToArray(res));
2503
+ // push the NodeList straight into the single target array in
2504
+ // argument-stack-safe chunks; this avoids the objToArray copy plus
2505
+ // the concat reallocation, which doubled a large result set (e.g. the
2506
+ // querySelectorAll("*") shadow scan) on every root iteration
2507
+ (0,_Es2019Array__WEBPACK_IMPORTED_MODULE_4__.pushChunked)(nodes, res);
2461
2508
  }
2462
2509
  return new DomQuery(nodes);
2463
2510
  }