@rindo/core 4.19.1 → 4.20.0

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.
Files changed (67) hide show
  1. package/cli/index.cjs +1 -1
  2. package/cli/index.js +1 -1
  3. package/cli/package.json +1 -1
  4. package/compiler/lib.dom.asynciterable.d.ts +5 -0
  5. package/compiler/lib.dom.d.ts +211 -33
  6. package/compiler/lib.dom.iterable.d.ts +8 -0
  7. package/compiler/lib.es2015.core.d.ts +40 -0
  8. package/compiler/lib.es2018.intl.d.ts +16 -4
  9. package/compiler/lib.es2019.intl.d.ts +1 -1
  10. package/compiler/lib.es2020.bigint.d.ts +2 -3
  11. package/compiler/lib.es2020.intl.d.ts +32 -7
  12. package/compiler/lib.es2021.weakref.d.ts +1 -1
  13. package/compiler/lib.es2022.regexp.d.ts +1 -1
  14. package/compiler/lib.es2023.d.ts +1 -0
  15. package/compiler/lib.es2023.intl.d.ts +56 -0
  16. package/compiler/lib.es5.d.ts +31 -9
  17. package/compiler/lib.esnext.array.d.ts +35 -0
  18. package/compiler/lib.esnext.collection.d.ts +77 -0
  19. package/compiler/lib.esnext.d.ts +3 -0
  20. package/compiler/lib.esnext.intl.d.ts +1 -8
  21. package/compiler/lib.esnext.regexp.d.ts +25 -0
  22. package/compiler/lib.esnext.string.d.ts +29 -0
  23. package/compiler/lib.webworker.asynciterable.d.ts +5 -0
  24. package/compiler/lib.webworker.d.ts +20 -6
  25. package/compiler/lib.webworker.iterable.d.ts +5 -0
  26. package/compiler/package.json +1 -1
  27. package/compiler/rindo.js +212817 -210315
  28. package/dev-server/client/index.js +1 -1
  29. package/dev-server/client/package.json +1 -1
  30. package/dev-server/connector.html +2 -2
  31. package/dev-server/index.js +1 -1
  32. package/dev-server/package.json +1 -1
  33. package/dev-server/server-process.js +2 -2
  34. package/internal/app-data/package.json +1 -1
  35. package/internal/client/index.js +53 -37
  36. package/internal/client/package.json +1 -1
  37. package/internal/client/patch-browser.js +1 -1
  38. package/internal/client/shadow-css.js +6 -30
  39. package/internal/hydrate/index.js +57 -43
  40. package/internal/hydrate/package.json +1 -1
  41. package/internal/hydrate/runner.js +7 -7
  42. package/internal/package.json +1 -1
  43. package/internal/rindo-private.d.ts +0 -1
  44. package/internal/rindo-public-compiler.d.ts +8 -5
  45. package/internal/testing/index.js +52 -36
  46. package/internal/testing/package.json +1 -1
  47. package/mock-doc/index.cjs +3 -3
  48. package/mock-doc/index.d.ts +1 -1
  49. package/mock-doc/index.js +3 -3
  50. package/mock-doc/package.json +1 -1
  51. package/package.json +26 -7
  52. package/screenshot/index.js +1 -1
  53. package/screenshot/package.json +1 -1
  54. package/screenshot/pixel-match.js +1 -1
  55. package/screenshot/screenshot-compare.d.ts +1 -2
  56. package/screenshot/screenshot-fs.d.ts +0 -1
  57. package/sys/node/index.js +6 -6
  58. package/sys/node/package.json +1 -1
  59. package/sys/node/worker.js +1 -1
  60. package/testing/index.js +31 -2
  61. package/testing/jest/jest-27-and-under/jest-facade.d.ts +41 -41
  62. package/testing/jest/jest-28/jest-facade.d.ts +35 -53
  63. package/testing/jest/jest-29/jest-facade.d.ts +36 -55
  64. package/testing/package.json +1 -1
  65. package/testing/puppeteer/puppeteer-declarations.d.ts +0 -1
  66. package/testing/puppeteer/puppeteer-screenshot.d.ts +1 -1
  67. package/testing/testing-utils.d.ts +0 -1
@@ -274,14 +274,14 @@ var scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) =>
274
274
  }
275
275
  }).join(", ");
276
276
  };
277
- var scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
277
+ var scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector) => {
278
278
  return processRules(cssText, (rule) => {
279
279
  let selector = rule.selector;
280
280
  let content = rule.content;
281
281
  if (rule.selector[0] !== "@") {
282
282
  selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
283
283
  } else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@page") || rule.selector.startsWith("@document")) {
284
- content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector);
284
+ content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
285
285
  }
286
286
  const cssRule = {
287
287
  selector: selector.replace(/\s{2,}/g, " ").trim(),
@@ -290,7 +290,7 @@ var scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, co
290
290
  return cssRule;
291
291
  });
292
292
  };
293
- var scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
293
+ var scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId) => {
294
294
  cssText = insertPolyfillHostInCssText(cssText);
295
295
  cssText = convertColonHost(cssText);
296
296
  cssText = convertColonHostContext(cssText);
@@ -298,7 +298,7 @@ var scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalS
298
298
  cssText = slotted.cssText;
299
299
  cssText = convertShadowDOMSelectors(cssText);
300
300
  if (scopeId) {
301
- cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector);
301
+ cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
302
302
  }
303
303
  cssText = replaceShadowCssHost(cssText, hostScopeId);
304
304
  cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, " $1 ");
@@ -315,37 +315,13 @@ var scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalS
315
315
  var replaceShadowCssHost = (cssText, hostScopeId) => {
316
316
  return cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
317
317
  };
318
- var scopeCss = (cssText, scopeId, commentOriginalSelector) => {
318
+ var scopeCss = (cssText, scopeId) => {
319
319
  const hostScopeId = scopeId + "-h";
320
320
  const slotScopeId = scopeId + "-s";
321
321
  const commentsWithHash = extractCommentsWithHash(cssText);
322
322
  cssText = stripComments(cssText);
323
- const orgSelectors = [];
324
- if (commentOriginalSelector) {
325
- const processCommentedSelector = (rule) => {
326
- const placeholder = `/*!@___${orgSelectors.length}___*/`;
327
- const comment = `/*!@${rule.selector}*/`;
328
- orgSelectors.push({ placeholder, comment });
329
- rule.selector = placeholder + rule.selector;
330
- return rule;
331
- };
332
- cssText = processRules(cssText, (rule) => {
333
- if (rule.selector[0] !== "@") {
334
- return processCommentedSelector(rule);
335
- } else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@page") || rule.selector.startsWith("@document")) {
336
- rule.content = processRules(rule.content, processCommentedSelector);
337
- return rule;
338
- }
339
- return rule;
340
- });
341
- }
342
- const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector);
323
+ const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
343
324
  cssText = [scoped.cssText, ...commentsWithHash].join("\n");
344
- if (commentOriginalSelector) {
345
- orgSelectors.forEach(({ placeholder, comment }) => {
346
- cssText = cssText.replace(placeholder, comment);
347
- });
348
- }
349
325
  scoped.slottedSelectors.forEach((slottedSelector) => {
350
326
  const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), "g");
351
327
  cssText = cssText.replace(regex, slottedSelector.updatedSelector);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Hydrate Platform v4.19.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Hydrate Platform v4.20.0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -412,17 +412,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
412
412
  }
413
413
  }
414
414
  }
415
- for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) {
416
- clientHydrate(
417
- parentVNode,
418
- childRenderNodes,
419
- slotNodes,
420
- shadowRootNodes,
421
- hostElm,
422
- node.childNodes[i2],
423
- hostId
424
- );
425
- }
426
415
  if (node.shadowRoot) {
427
416
  for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
428
417
  clientHydrate(
@@ -436,6 +425,17 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
436
425
  );
437
426
  }
438
427
  }
428
+ for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) {
429
+ clientHydrate(
430
+ parentVNode,
431
+ childRenderNodes,
432
+ slotNodes,
433
+ shadowRootNodes,
434
+ hostElm,
435
+ node.childNodes[i2],
436
+ hostId
437
+ );
438
+ }
439
439
  } else if (node.nodeType === 8 /* CommentNode */) {
440
440
  childIdSplt = node.nodeValue.split(".");
441
441
  if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
@@ -513,14 +513,14 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
513
513
  var initializeDocumentHydrate = (node, orgLocNodes) => {
514
514
  if (node.nodeType === 1 /* ElementNode */) {
515
515
  let i2 = 0;
516
- for (; i2 < node.childNodes.length; i2++) {
517
- initializeDocumentHydrate(node.childNodes[i2], orgLocNodes);
518
- }
519
516
  if (node.shadowRoot) {
520
- for (i2 = 0; i2 < node.shadowRoot.childNodes.length; i2++) {
517
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
521
518
  initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
522
519
  }
523
520
  }
521
+ for (i2 = 0; i2 < node.childNodes.length; i2++) {
522
+ initializeDocumentHydrate(node.childNodes[i2], orgLocNodes);
523
+ }
524
524
  } else if (node.nodeType === 8 /* CommentNode */) {
525
525
  const childIdSplt = node.nodeValue.split(".");
526
526
  if (childIdSplt[0] === ORG_LOCATION_ID) {
@@ -615,8 +615,6 @@ var registerStyle = (scopeId2, cssText, allowCS) => {
615
615
  };
616
616
  var addStyle = (styleContainerNode, cmpMeta, mode) => {
617
617
  var _a;
618
- const styleContainerDocument = styleContainerNode;
619
- const styleContainerShadowRoot = styleContainerNode;
620
618
  const scopeId2 = getScopeId(cmpMeta, mode);
621
619
  const style = styles.get(scopeId2);
622
620
  if (!BUILD7.attachStyles) {
@@ -625,14 +623,14 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
625
623
  styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
626
624
  if (style) {
627
625
  if (typeof style === "string") {
628
- styleContainerNode = styleContainerDocument.head || styleContainerNode;
626
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
629
627
  let appliedStyles = rootAppliedStyles.get(styleContainerNode);
630
628
  let styleElm;
631
629
  if (!appliedStyles) {
632
630
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
633
631
  }
634
632
  if (!appliedStyles.has(scopeId2)) {
635
- if (BUILD7.hydrateClientSide && styleContainerShadowRoot.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
633
+ if (BUILD7.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
636
634
  styleElm.innerHTML = style;
637
635
  } else {
638
636
  styleElm = doc.createElement("style");
@@ -641,10 +639,21 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
641
639
  if (nonce != null) {
642
640
  styleElm.setAttribute("nonce", nonce);
643
641
  }
644
- if (BUILD7.hydrateServerSide || BUILD7.hotModuleReplacement) {
642
+ if ((BUILD7.hydrateServerSide || BUILD7.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
645
643
  styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
646
644
  }
647
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
645
+ const injectStyle = (
646
+ /**
647
+ * we render a scoped component
648
+ */
649
+ !(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) || /**
650
+ * we are using shadow dom and render the style tag within the shadowRoot
651
+ */
652
+ cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD"
653
+ );
654
+ if (injectStyle) {
655
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
656
+ }
648
657
  }
649
658
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
650
659
  styleElm.innerHTML += SLOT_FB_CSS;
@@ -653,8 +662,8 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
653
662
  appliedStyles.add(scopeId2);
654
663
  }
655
664
  }
656
- } else if (BUILD7.constructableCSS && !styleContainerDocument.adoptedStyleSheets.includes(style)) {
657
- styleContainerDocument.adoptedStyleSheets = [...styleContainerDocument.adoptedStyleSheets, style];
665
+ } else if (BUILD7.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
666
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
658
667
  }
659
668
  }
660
669
  return scopeId2;
@@ -669,7 +678,7 @@ var attachStyles = (hostRef) => {
669
678
  cmpMeta,
670
679
  hostRef.$modeName$
671
680
  );
672
- if ((BUILD7.shadowDom || BUILD7.scoped) && BUILD7.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
681
+ if ((BUILD7.shadowDom || BUILD7.scoped) && BUILD7.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
673
682
  elm["s-sc"] = scopeId2;
674
683
  elm.classList.add(scopeId2 + "-h");
675
684
  if (BUILD7.scoped && flags & 2 /* scopedCssEncapsulation */) {
@@ -679,7 +688,6 @@ var attachStyles = (hostRef) => {
679
688
  endAttachStyles();
680
689
  };
681
690
  var getScopeId = (cmp, mode) => "sc-" + (BUILD7.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
682
- var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
683
691
 
684
692
  // src/runtime/vdom/vdom-render.ts
685
693
  import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
@@ -875,7 +883,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
875
883
  if (BUILD10.vdomAttribute) {
876
884
  updateElement(null, newVNode2, isSvgMode);
877
885
  }
878
- if ((BUILD10.shadowDom || BUILD10.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) {
886
+ const rootNode = elm.getRootNode();
887
+ const isElementWithinShadowRoot = !rootNode.querySelector("body");
888
+ if (!isElementWithinShadowRoot && BUILD10.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
879
889
  elm.classList.add(elm["s-si"] = scopeId);
880
890
  }
881
891
  if (BUILD10.scoped) {
@@ -1089,6 +1099,15 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1089
1099
  var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1090
1100
  if (leftVNode.$tag$ === rightVNode.$tag$) {
1091
1101
  if (BUILD10.slotRelocation && leftVNode.$tag$ === "slot") {
1102
+ if (
1103
+ // The component gets hydrated and no VDOM has been initialized.
1104
+ // Here the comparison can't happen as $name$ property is not set for `leftNode`.
1105
+ "$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
1106
+ // hydration comments to be removed
1107
+ leftVNode.$elm$.nodeType !== 8
1108
+ ) {
1109
+ return false;
1110
+ }
1092
1111
  return leftVNode.$name$ === rightVNode.$name$;
1093
1112
  }
1094
1113
  if (BUILD10.vdomKey && !isInitialRender) {
@@ -1130,7 +1149,10 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1130
1149
  elm.textContent = "";
1131
1150
  }
1132
1151
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
1133
- } else if (BUILD10.updatable && oldChildren !== null) {
1152
+ } else if (
1153
+ // don't do this on initial render as it can cause non-hydrated content to be removed
1154
+ !isInitialRender && BUILD10.updatable && oldChildren !== null
1155
+ ) {
1134
1156
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
1135
1157
  }
1136
1158
  if (BUILD10.svg && isSvgMode && tag === "svg") {
@@ -1822,7 +1844,8 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
1822
1844
  if (this.hasOwnProperty(propName)) {
1823
1845
  newValue = this[propName];
1824
1846
  delete this[propName];
1825
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
1847
+ } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
1848
+ this[propName] == newValue) {
1826
1849
  return;
1827
1850
  } else if (propName == null) {
1828
1851
  const hostRef = getHostRef(this);
@@ -1929,7 +1952,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1929
1952
  const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
1930
1953
  if (!BUILD14.hydrateServerSide && BUILD14.shadowDom && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
1931
1954
  BUILD14.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
1932
- style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2, false));
1955
+ style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
1933
1956
  }
1934
1957
  registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1935
1958
  endRegisterStyles();
@@ -2498,10 +2521,8 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2498
2521
  const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
2499
2522
  const dataStyles = /* @__PURE__ */ doc.createElement("style");
2500
2523
  const deferredConnectedCallbacks = [];
2501
- const styles2 = /* @__PURE__ */ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2502
2524
  let appLoadFallback;
2503
2525
  let isBootstrapping = true;
2504
- let i2 = 0;
2505
2526
  Object.assign(plt, options);
2506
2527
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
2507
2528
  if (BUILD19.asyncQueue) {
@@ -2512,11 +2533,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2512
2533
  if (BUILD19.hydrateClientSide) {
2513
2534
  plt.$flags$ |= 2 /* appLoaded */;
2514
2535
  }
2515
- if (BUILD19.hydrateClientSide && BUILD19.shadowDom) {
2516
- for (; i2 < styles2.length; i2++) {
2517
- registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2518
- }
2519
- }
2520
2536
  let hasSlotRelocation = false;
2521
2537
  lazyBundles.map((lazyBundle) => {
2522
2538
  lazyBundle[1].map((compactMeta) => {
@@ -2883,7 +2899,7 @@ var globalScripts = (
2883
2899
 
2884
2900
  // src/hydrate/platform/proxy-host-element.ts
2885
2901
  import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
2886
- function proxyHostElement(elm, cmpMeta, opts) {
2902
+ function proxyHostElement(elm, cmpMeta) {
2887
2903
  if (typeof elm.componentOnReady !== "function") {
2888
2904
  elm.componentOnReady = componentOnReady;
2889
2905
  }
@@ -2896,10 +2912,8 @@ function proxyHostElement(elm, cmpMeta, opts) {
2896
2912
  mode: "open",
2897
2913
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2898
2914
  });
2899
- } else if (opts.serializeShadowRoot) {
2900
- elm.attachShadow({ mode: "open" });
2901
2915
  } else {
2902
- elm.shadowRoot = elm;
2916
+ elm.attachShadow({ mode: "open" });
2903
2917
  }
2904
2918
  }
2905
2919
  if (cmpMeta.$members$ != null) {
@@ -3012,7 +3026,7 @@ function hydrateApp(win2, opts, results, afterHydrate, resolve) {
3012
3026
  createdElements.add(elm);
3013
3027
  elm.connectedCallback = patchedConnectedCallback2;
3014
3028
  registerHost(elm, Cstr.cmpMeta);
3015
- proxyHostElement(elm, Cstr.cmpMeta, opts);
3029
+ proxyHostElement(elm, Cstr.cmpMeta);
3016
3030
  }
3017
3031
  }
3018
3032
  }
@@ -3029,7 +3043,7 @@ function hydrateApp(win2, opts, results, afterHydrate, resolve) {
3029
3043
  if (isValidComponent(elm, opts) && results.hydratedCount < opts.maxHydrateCount) {
3030
3044
  if (!connectedElements.has(elm) && shouldHydrate(elm)) {
3031
3045
  connectedElements.add(elm);
3032
- return hydrateComponent(win2, results, elm.nodeName, elm, waitingElements);
3046
+ return hydrateComponent.call(elm, win2, results, elm.nodeName, elm, waitingElements);
3033
3047
  }
3034
3048
  }
3035
3049
  return resolved2;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/hydrate",
3
- "version": "4.19.1",
3
+ "version": "4.20.0",
4
4
  "description": "Rindo internal hydrate platform to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Hydrate Runner v4.19.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Hydrate Runner v4.20.0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -10414,7 +10414,7 @@ function normalizeSerializationOptions(opts = {}) {
10414
10414
  removeAttributeQuotes: typeof opts.removeAttributeQuotes !== "boolean" ? false : opts.removeAttributeQuotes,
10415
10415
  removeBooleanAttributeQuotes: typeof opts.removeBooleanAttributeQuotes !== "boolean" ? false : opts.removeBooleanAttributeQuotes,
10416
10416
  removeHtmlComments: typeof opts.removeHtmlComments !== "boolean" ? false : opts.removeHtmlComments,
10417
- serializeShadowRoot: typeof opts.serializeShadowRoot !== "boolean" ? false : opts.serializeShadowRoot,
10417
+ serializeShadowRoot: typeof opts.serializeShadowRoot !== "boolean" ? true : opts.serializeShadowRoot,
10418
10418
  fullDocument: typeof opts.fullDocument !== "boolean" ? true : opts.fullDocument
10419
10419
  };
10420
10420
  }
@@ -10540,7 +10540,7 @@ style="${cssText}">`;
10540
10540
  }
10541
10541
  if (EMPTY_ELEMENTS.has(tagName) === false) {
10542
10542
  const shadowRoot = node.shadowRoot;
10543
- if (opts.serializeShadowRoot && shadowRoot != null) {
10543
+ if (shadowRoot != null && opts.serializeShadowRoot) {
10544
10544
  output.indent = output.indent + ((_c = opts.indentSpaces) != null ? _c : 0);
10545
10545
  yield* streamToHtml(shadowRoot, opts, output);
10546
10546
  output.indent = output.indent - ((_d = opts.indentSpaces) != null ? _d : 0);
@@ -14884,7 +14884,7 @@ var removeUnusedStyleText = (usedSelectors, diagnostics, styleElm) => {
14884
14884
 
14885
14885
  // src/hydrate/runner/inspect-element.ts
14886
14886
  function inspectElement(results, elm, depth) {
14887
- const children = elm.children;
14887
+ const children = [...Array.from(elm.children), ...Array.from(elm.shadowRoot ? elm.shadowRoot.children : [])];
14888
14888
  for (let i = 0, ii = children.length; i < ii; i++) {
14889
14889
  const childElm = children[i];
14890
14890
  const tagName = childElm.nodeName.toLowerCase();
@@ -15279,7 +15279,7 @@ function renderToString(html, options, asStream) {
15279
15279
  const opts = normalizeHydrateOptions(options);
15280
15280
  opts.serializeToHtml = true;
15281
15281
  opts.fullDocument = typeof opts.fullDocument === "boolean" ? opts.fullDocument : true;
15282
- opts.serializeShadowRoot = Boolean(opts.serializeShadowRoot);
15282
+ opts.serializeShadowRoot = typeof opts.serializeShadowRoot === "boolean" ? opts.serializeShadowRoot : true;
15283
15283
  opts.constrainTimeouts = false;
15284
15284
  return hydrateDocument(html, opts, asStream);
15285
15285
  }
@@ -15336,7 +15336,7 @@ async function render(win, opts, results) {
15336
15336
  });
15337
15337
  }
15338
15338
  initializeWindow(win, win.document, opts, results);
15339
- const beforeHydrateFn = typeof opts.beforeHydrate === "function" ? opts.beforeHydrate(win.document) : NOOP;
15339
+ const beforeHydrateFn = typeof opts.beforeHydrate === "function" ? opts.beforeHydrate : NOOP;
15340
15340
  try {
15341
15341
  await Promise.resolve(beforeHydrateFn(win.document));
15342
15342
  return new Promise((resolve) => hydrateFactory(win, opts, results, afterHydrate, resolve));
@@ -15353,7 +15353,7 @@ function renderStream(win, opts, results) {
15353
15353
  return Readable.from(processRender());
15354
15354
  }
15355
15355
  async function afterHydrate(win, opts, results, resolve) {
15356
- const afterHydrateFn = typeof opts.afterHydrate === "function" ? opts.afterHydrate(win.document) : NOOP;
15356
+ const afterHydrateFn = typeof opts.afterHydrate === "function" ? opts.afterHydrate : NOOP;
15357
15357
  try {
15358
15358
  await Promise.resolve(afterHydrateFn(win.document));
15359
15359
  return resolve(finalizeHydrate(win, win.document, opts, results));
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal",
3
- "version": "4.19.1",
3
+ "version": "4.20.0",
4
4
  "description": "Rindo internals only to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1690,7 +1690,6 @@ export interface TransformCssToEsmInput {
1690
1690
  * is not shared by multiple fields, nor is it a composite of multiple modes).
1691
1691
  */
1692
1692
  mode?: string;
1693
- commentOriginalSelector?: boolean;
1694
1693
  sourceMap?: boolean;
1695
1694
  minify?: boolean;
1696
1695
  docs?: boolean;
@@ -382,6 +382,7 @@ export interface Config extends RindoConfig {
382
382
  suppressLogs?: boolean;
383
383
  profile?: boolean;
384
384
  tsCompilerOptions?: any;
385
+ tsWatchOptions?: any;
385
386
  _isValidated?: boolean;
386
387
  _isTesting?: boolean;
387
388
  }
@@ -1612,6 +1613,8 @@ export interface Testing {
1612
1613
  run(opts: TestingRunOptions): Promise<boolean>;
1613
1614
  destroy(): Promise<void>;
1614
1615
  }
1616
+ export declare type Path = string;
1617
+ export declare type TransformerConfig = [string, Record<string, unknown>];
1615
1618
  /**
1616
1619
  * Options for initiating a run of Rindo tests (spec and/or end-to-end)
1617
1620
  */
@@ -1643,7 +1646,7 @@ export interface JestConfig {
1643
1646
  * By default, Jest runs all tests and produces all errors into the console upon completion.
1644
1647
  * The bail config option can be used here to have Jest stop running tests after the first failure. Default: false
1645
1648
  */
1646
- bail?: boolean;
1649
+ bail?: boolean | number;
1647
1650
  /**
1648
1651
  * The directory where Jest should store its cached dependency information. Jest attempts to scan your dependency tree once (up-front)
1649
1652
  * and cache it in order to ease some of the filesystem raking that needs to happen while running tests. This config option lets you
@@ -1717,8 +1720,8 @@ export interface JestConfig {
1717
1720
  reporters?: any;
1718
1721
  resetMocks?: boolean;
1719
1722
  resetModules?: boolean;
1720
- resolver?: string;
1721
- restoreMocks?: string;
1723
+ resolver?: Path | null;
1724
+ restoreMocks?: boolean;
1722
1725
  rootDir?: string;
1723
1726
  roots?: any[];
1724
1727
  runner?: string;
@@ -1735,13 +1738,13 @@ export interface JestConfig {
1735
1738
  testMatch?: string[];
1736
1739
  testPathIgnorePatterns?: string[];
1737
1740
  testPreset?: string;
1738
- testRegex?: string;
1741
+ testRegex?: string[];
1739
1742
  testResultsProcessor?: string;
1740
1743
  testRunner?: string;
1741
1744
  testURL?: string;
1742
1745
  timers?: string;
1743
1746
  transform?: {
1744
- [key: string]: string;
1747
+ [regex: string]: Path | TransformerConfig;
1745
1748
  };
1746
1749
  transformIgnorePatterns?: any[];
1747
1750
  unmockedModulePathPatterns?: any[];