@stencil/core 4.43.5 → 4.44.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 (39) 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/package.json +1 -1
  5. package/compiler/stencil.js +232 -128
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +2 -2
  12. package/internal/app-data/package.json +1 -1
  13. package/internal/app-globals/package.json +1 -1
  14. package/internal/client/index.js +61 -30
  15. package/internal/client/package.json +1 -1
  16. package/internal/client/patch-browser.js +1 -1
  17. package/internal/hydrate/index.js +44 -26
  18. package/internal/hydrate/package.json +1 -1
  19. package/internal/hydrate/runner.js +1 -1
  20. package/internal/package.json +1 -1
  21. package/internal/stencil-private.d.ts +7 -0
  22. package/internal/stencil-public-compiler.d.ts +4 -0
  23. package/internal/stencil-public-runtime.d.ts +11 -0
  24. package/internal/testing/index.js +43 -25
  25. package/internal/testing/package.json +1 -1
  26. package/mock-doc/index.cjs +1 -1
  27. package/mock-doc/index.js +1 -1
  28. package/mock-doc/package.json +1 -1
  29. package/package.json +1 -1
  30. package/readme.md +1 -1
  31. package/screenshot/index.js +1 -1
  32. package/screenshot/package.json +1 -1
  33. package/screenshot/pixel-match.js +1 -1
  34. package/sys/node/index.js +30 -30
  35. package/sys/node/package.json +1 -1
  36. package/sys/node/worker.js +1 -1
  37. package/testing/index.js +6 -1
  38. package/testing/package.json +1 -1
  39. /package/{LICENSE.md → LICENSE} +0 -0
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Platform v4.44.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/client/client-build.ts
@@ -150,8 +150,10 @@ var setErrorHandler = (handler) => customError = handler;
150
150
 
151
151
  // src/client/client-load-module.ts
152
152
  var cmpModules = /* @__PURE__ */ new Map();
153
+ var failedLoadAttempts = /* @__PURE__ */ new Map();
153
154
  var MODULE_IMPORT_PREFIX = "./";
154
155
  var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
156
+ var _a;
155
157
  const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
156
158
  const bundleId = cmpMeta.$lazyBundleId$;
157
159
  if (BUILD5.isDev && typeof bundleId !== "string") {
@@ -166,21 +168,28 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
166
168
  if (module) {
167
169
  return module[exportName];
168
170
  }
171
+ const retryCount = (_a = failedLoadAttempts.get(bundleId)) != null ? _a : 0;
172
+ const cacheBustParams = [
173
+ retryCount > 0 ? `s-retry=${retryCount}` : "",
174
+ BUILD5.hotModuleReplacement && hmrVersionId ? `s-hmr=${hmrVersionId}` : ""
175
+ ].filter(Boolean).join("&");
169
176
  /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
170
177
  return import(
171
178
  /* @vite-ignore */
172
179
  /* webpackInclude: /\.entry\.js$/ */
173
180
  /* webpackExclude: /\.system\.entry\.js$/ */
174
181
  /* webpackMode: "lazy" */
175
- `./${bundleId}.entry.js${BUILD5.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
182
+ `./${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`
176
183
  ).then(
177
184
  (importedModule) => {
178
185
  if (!BUILD5.hotModuleReplacement) {
186
+ failedLoadAttempts.delete(bundleId);
179
187
  cmpModules.set(bundleId, importedModule);
180
188
  }
181
189
  return importedModule[exportName];
182
190
  },
183
191
  (e) => {
192
+ failedLoadAttempts.set(bundleId, retryCount + 1);
184
193
  consoleError(e, hostRef.$hostElement$);
185
194
  }
186
195
  );
@@ -214,6 +223,8 @@ var DEFAULT_DOC_DATA = {
214
223
  };
215
224
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
216
225
  var XLINK_NS = "http://www.w3.org/1999/xlink";
226
+ var MAX_LAZY_LOAD_RETRIES = 3;
227
+ var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
217
228
  var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
218
229
  "formAssociatedCallback",
219
230
  "formResetCallback",
@@ -276,6 +287,10 @@ var queuePending = false;
276
287
  var queueDomReads = [];
277
288
  var queueDomWrites = [];
278
289
  var queueDomWritesLow = [];
290
+ var scheduleFlush = () => {
291
+ var _a;
292
+ return ((_a = win.document) == null ? void 0 : _a.hidden) ? nextTick(flush) : plt.raf(flush);
293
+ };
279
294
  var queueTask = (queue, write) => (cb) => {
280
295
  queue.push(cb);
281
296
  if (!queuePending) {
@@ -283,7 +298,7 @@ var queueTask = (queue, write) => (cb) => {
283
298
  if (write && plt.$flags$ & 4 /* queueSync */) {
284
299
  nextTick(flush);
285
300
  } else {
286
- plt.raf(flush);
301
+ scheduleFlush();
287
302
  }
288
303
  }
289
304
  };
@@ -327,14 +342,14 @@ var flush = () => {
327
342
  queueDomWrites.length = 0;
328
343
  }
329
344
  if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
330
- plt.raf(flush);
345
+ scheduleFlush();
331
346
  } else {
332
347
  queueCongestion = 0;
333
348
  }
334
349
  } else {
335
350
  consume(queueDomWrites);
336
351
  if (queuePending = queueDomReads.length > 0) {
337
- plt.raf(flush);
352
+ scheduleFlush();
338
353
  }
339
354
  }
340
355
  };
@@ -452,7 +467,7 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
452
467
  slottedNodes.push(childNode);
453
468
  if (typeof slotName !== "undefined") return slottedNodes;
454
469
  }
455
- slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
470
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(internalCall(childNode, "childNodes"), hostName, slotName)];
456
471
  }
457
472
  return slottedNodes;
458
473
  }
@@ -799,13 +814,13 @@ var patchChildSlotNodes = (elm) => {
799
814
  patchHostOriginalAccessor("firstChild", elm);
800
815
  Object.defineProperty(elm, "firstChild", {
801
816
  get() {
802
- return this.childNodes[0];
817
+ return this.childNodes[0] || null;
803
818
  }
804
819
  });
805
820
  patchHostOriginalAccessor("lastChild", elm);
806
821
  Object.defineProperty(elm, "lastChild", {
807
822
  get() {
808
- return this.childNodes[this.childNodes.length - 1];
823
+ return this.childNodes[this.childNodes.length - 1] || null;
809
824
  }
810
825
  });
811
826
  patchHostOriginalAccessor("childNodes", elm);
@@ -836,7 +851,7 @@ var patchNextSibling = (node) => {
836
851
  const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
837
852
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
838
853
  if (parentNodes && index > -1) {
839
- return parentNodes[index + 1];
854
+ return parentNodes[index + 1] || null;
840
855
  }
841
856
  return this.__nextSibling;
842
857
  }
@@ -851,7 +866,7 @@ var patchNextElementSibling = (element) => {
851
866
  const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
852
867
  const index = parentEles == null ? void 0 : parentEles.indexOf(this);
853
868
  if (parentEles && index > -1) {
854
- return parentEles[index + 1];
869
+ return parentEles[index + 1] || null;
855
870
  }
856
871
  return this.__nextElementSibling;
857
872
  }
@@ -866,7 +881,7 @@ var patchPreviousSibling = (node) => {
866
881
  const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
867
882
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
868
883
  if (parentNodes && index > -1) {
869
- return parentNodes[index - 1];
884
+ return parentNodes[index - 1] || null;
870
885
  }
871
886
  return this.__previousSibling;
872
887
  }
@@ -881,7 +896,7 @@ var patchPreviousElementSibling = (element) => {
881
896
  const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
882
897
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
883
898
  if (parentNodes && index > -1) {
884
- return parentNodes[index - 1];
899
+ return parentNodes[index - 1] || null;
885
900
  }
886
901
  return this.__previousElementSibling;
887
902
  }
@@ -1209,10 +1224,15 @@ var h = (nodeName, vnodeData, ...children) => {
1209
1224
  } else if (child != null && typeof child !== "boolean") {
1210
1225
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
1211
1226
  child = String(child);
1212
- } else if (BUILD13.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1213
- consoleDevError(`vNode passed as children has unexpected type.
1227
+ } else if (typeof nodeName !== "function" && child.$flags$ === void 0) {
1228
+ if (BUILD13.isDev) {
1229
+ consoleDevError(`vNode passed as children has unexpected type.
1214
1230
  Make sure it's using the correct h() function.
1215
1231
  Empty objects can also be the cause, look for JSX comments that became objects.`);
1232
+ } else {
1233
+ consoleError("Invalid vNode child");
1234
+ }
1235
+ continue;
1216
1236
  }
1217
1237
  if (simple && lastSimple) {
1218
1238
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -2941,7 +2961,10 @@ var markSlotContentForRelocation = (elm) => {
2941
2961
  const slotName = childNode["s-sn"];
2942
2962
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
2943
2963
  node = hostContentNodes[j];
2944
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
2964
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && // let an exact named-slot match override a stale default-slot claim. Skip this for
2965
+ // `slotName === ''` itself - a matched default node's cached `s-sn` is `''` too, which
2966
+ // would trivially "match" on every re-render and force pointless re-insertion.
2967
+ (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"] || slotName !== "" && getSlotName(node) === slotName)) {
2945
2968
  if (isNodeLocatedInSlot(node, slotName)) {
2946
2969
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
2947
2970
  checkSlotFallbackVisibility = true;
@@ -3217,7 +3240,7 @@ var attachToAncestor = (hostRef, ancestorComponent) => {
3217
3240
  }
3218
3241
  };
3219
3242
  var scheduleUpdate = (hostRef, isInitialLoad) => {
3220
- if (BUILD21.taskQueue && BUILD21.updatable) {
3243
+ if (BUILD21.updatable) {
3221
3244
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
3222
3245
  }
3223
3246
  if (BUILD21.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
@@ -3287,7 +3310,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
3287
3310
  }
3288
3311
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
3289
3312
  if (BUILD21.isDev) {
3290
- hostRef.$flags$ |= 1024 /* devOnRender */;
3313
+ hostRef.$flags$ |= 2048 /* devOnRender */;
3291
3314
  }
3292
3315
  if (BUILD21.hydrateServerSide) {
3293
3316
  await callRender(hostRef, instance, elm, isInitialLoad);
@@ -3296,7 +3319,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
3296
3319
  }
3297
3320
  if (BUILD21.isDev) {
3298
3321
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
3299
- hostRef.$flags$ &= ~1024 /* devOnRender */;
3322
+ hostRef.$flags$ &= ~2048 /* devOnRender */;
3300
3323
  }
3301
3324
  if (BUILD21.hydrateServerSide) {
3302
3325
  try {
@@ -3336,12 +3359,11 @@ var renderingRef = null;
3336
3359
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
3337
3360
  const allRenderFn = BUILD21.allRenderFn ? true : false;
3338
3361
  const lazyLoad = BUILD21.lazyLoad ? true : false;
3339
- const taskQueue = BUILD21.taskQueue ? true : false;
3340
3362
  const updatable = BUILD21.updatable ? true : false;
3341
3363
  try {
3342
3364
  renderingRef = instance;
3343
3365
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
3344
- if (updatable && taskQueue) {
3366
+ if (updatable) {
3345
3367
  hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
3346
3368
  }
3347
3369
  if (updatable || lazyLoad) {
@@ -3377,11 +3399,11 @@ var postUpdateComponent = (hostRef) => {
3377
3399
  const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : elm;
3378
3400
  const ancestorComponent = hostRef.$ancestorComponent$;
3379
3401
  if (BUILD21.isDev) {
3380
- hostRef.$flags$ |= 1024 /* devOnRender */;
3402
+ hostRef.$flags$ |= 2048 /* devOnRender */;
3381
3403
  }
3382
3404
  safeCall(instance, "componentDidRender", void 0, elm);
3383
3405
  if (BUILD21.isDev) {
3384
- hostRef.$flags$ &= ~1024 /* devOnRender */;
3406
+ hostRef.$flags$ &= ~2048 /* devOnRender */;
3385
3407
  }
3386
3408
  emitLifecycleEvent(elm, "componentDidRender");
3387
3409
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
@@ -3390,11 +3412,11 @@ var postUpdateComponent = (hostRef) => {
3390
3412
  addHydratedFlag(elm);
3391
3413
  }
3392
3414
  if (BUILD21.isDev) {
3393
- hostRef.$flags$ |= 2048 /* devOnDidLoad */;
3415
+ hostRef.$flags$ |= 4096 /* devOnDidLoad */;
3394
3416
  }
3395
3417
  safeCall(instance, "componentDidLoad", void 0, elm);
3396
3418
  if (BUILD21.isDev) {
3397
- hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
3419
+ hostRef.$flags$ &= ~4096 /* devOnDidLoad */;
3398
3420
  }
3399
3421
  emitLifecycleEvent(elm, "componentDidLoad");
3400
3422
  endPostUpdate();
@@ -3406,11 +3428,11 @@ var postUpdateComponent = (hostRef) => {
3406
3428
  }
3407
3429
  } else {
3408
3430
  if (BUILD21.isDev) {
3409
- hostRef.$flags$ |= 1024 /* devOnRender */;
3431
+ hostRef.$flags$ |= 2048 /* devOnRender */;
3410
3432
  }
3411
3433
  safeCall(instance, "componentDidUpdate", void 0, elm);
3412
3434
  if (BUILD21.isDev) {
3413
- hostRef.$flags$ &= ~1024 /* devOnRender */;
3435
+ hostRef.$flags$ &= ~2048 /* devOnRender */;
3414
3436
  }
3415
3437
  emitLifecycleEvent(elm, "componentDidUpdate");
3416
3438
  endPostUpdate();
@@ -3542,7 +3564,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3542
3564
  }
3543
3565
  }
3544
3566
  if (BUILD22.isDev) {
3545
- if (hostRef.$flags$ & 1024 /* devOnRender */) {
3567
+ if (hostRef.$flags$ & 2048 /* devOnRender */) {
3546
3568
  consoleDevWarn(
3547
3569
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
3548
3570
  "\nElement",
@@ -3552,7 +3574,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3552
3574
  "\nOld value",
3553
3575
  oldVal
3554
3576
  );
3555
- } else if (hostRef.$flags$ & 2048 /* devOnDidLoad */) {
3577
+ } else if (hostRef.$flags$ & 4096 /* devOnDidLoad */) {
3556
3578
  consoleDevWarn(
3557
3579
  `The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`,
3558
3580
  "\nElement",
@@ -3843,10 +3865,12 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3843
3865
 
3844
3866
  // src/runtime/initialize-component.ts
3845
3867
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3868
+ var _a;
3846
3869
  let Cstr;
3847
3870
  try {
3848
3871
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3849
3872
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3873
+ hostRef.$flags$ &= ~1024 /* hasFailedLoad */;
3850
3874
  const bundleId = cmpMeta.$lazyBundleId$;
3851
3875
  if (BUILD24.lazyLoad && bundleId) {
3852
3876
  const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
@@ -3861,6 +3885,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3861
3885
  Cstr = CstrImport;
3862
3886
  }
3863
3887
  if (!Cstr) {
3888
+ hostRef.$flags$ &= ~32 /* hasInitializedComponent */;
3889
+ hostRef.$loadRetryCount$ = ((_a = hostRef.$loadRetryCount$) != null ? _a : 0) + 1;
3890
+ if (hostRef.$loadRetryCount$ < MAX_LAZY_LOAD_RETRIES) {
3891
+ hostRef.$flags$ |= 1024 /* hasFailedLoad */;
3892
+ }
3864
3893
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3865
3894
  }
3866
3895
  if (BUILD24.member && !Cstr.isProxied) {
@@ -3940,7 +3969,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3940
3969
  hostRef.$onRenderResolve$();
3941
3970
  hostRef.$onRenderResolve$ = void 0;
3942
3971
  }
3943
- if (BUILD24.asyncLoading && hostRef.$onReadyResolve$) {
3972
+ if (BUILD24.asyncLoading && hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
3944
3973
  hostRef.$onReadyResolve$(elm);
3945
3974
  }
3946
3975
  }
@@ -4012,6 +4041,8 @@ var connectedCallback = (elm) => {
4012
4041
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
4013
4042
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
4014
4043
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
4044
+ } else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
4045
+ setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
4015
4046
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
4016
4047
  hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
4017
4048
  }
@@ -4315,7 +4346,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
4315
4346
  }
4316
4347
  disconnectedCallback() {
4317
4348
  plt.jmp(() => disconnectedCallback(this));
4318
- plt.raf(() => {
4349
+ nextTick(() => {
4319
4350
  var _a3;
4320
4351
  const hostRef = getHostRef(this);
4321
4352
  if (!hostRef) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/client",
3
- "version": "4.43.5",
3
+ "version": "4.44.0",
4
4
  "description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "exports": "./index.js",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Browser v4.43.5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Browser v4.44.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/client/client-patch-browser.ts
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Hydrate Platform v4.43.5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.44.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -356,6 +356,8 @@ var DEFAULT_DOC_DATA = {
356
356
  };
357
357
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
358
358
  var XLINK_NS = "http://www.w3.org/1999/xlink";
359
+ var MAX_LAZY_LOAD_RETRIES = 3;
360
+ var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
359
361
  var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
360
362
  "formAssociatedCallback",
361
363
  "formResetCallback",
@@ -456,7 +458,7 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
456
458
  slottedNodes.push(childNode);
457
459
  if (typeof slotName !== "undefined") return slottedNodes;
458
460
  }
459
- slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
461
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(internalCall(childNode, "childNodes"), hostName, slotName)];
460
462
  }
461
463
  return slottedNodes;
462
464
  }
@@ -803,13 +805,13 @@ var patchChildSlotNodes = (elm) => {
803
805
  patchHostOriginalAccessor("firstChild", elm);
804
806
  Object.defineProperty(elm, "firstChild", {
805
807
  get() {
806
- return this.childNodes[0];
808
+ return this.childNodes[0] || null;
807
809
  }
808
810
  });
809
811
  patchHostOriginalAccessor("lastChild", elm);
810
812
  Object.defineProperty(elm, "lastChild", {
811
813
  get() {
812
- return this.childNodes[this.childNodes.length - 1];
814
+ return this.childNodes[this.childNodes.length - 1] || null;
813
815
  }
814
816
  });
815
817
  patchHostOriginalAccessor("childNodes", elm);
@@ -840,7 +842,7 @@ var patchNextSibling = (node) => {
840
842
  const parentNodes = (_a2 = this["s-ol"]) == null ? void 0 : _a2.parentNode.childNodes;
841
843
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
842
844
  if (parentNodes && index > -1) {
843
- return parentNodes[index + 1];
845
+ return parentNodes[index + 1] || null;
844
846
  }
845
847
  return this.__nextSibling;
846
848
  }
@@ -855,7 +857,7 @@ var patchNextElementSibling = (element) => {
855
857
  const parentEles = (_a2 = this["s-ol"]) == null ? void 0 : _a2.parentNode.children;
856
858
  const index = parentEles == null ? void 0 : parentEles.indexOf(this);
857
859
  if (parentEles && index > -1) {
858
- return parentEles[index + 1];
860
+ return parentEles[index + 1] || null;
859
861
  }
860
862
  return this.__nextElementSibling;
861
863
  }
@@ -870,7 +872,7 @@ var patchPreviousSibling = (node) => {
870
872
  const parentNodes = (_a2 = this["s-ol"]) == null ? void 0 : _a2.parentNode.childNodes;
871
873
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
872
874
  if (parentNodes && index > -1) {
873
- return parentNodes[index - 1];
875
+ return parentNodes[index - 1] || null;
874
876
  }
875
877
  return this.__previousSibling;
876
878
  }
@@ -885,7 +887,7 @@ var patchPreviousElementSibling = (element) => {
885
887
  const parentNodes = (_a2 = this["s-ol"]) == null ? void 0 : _a2.parentNode.children;
886
888
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
887
889
  if (parentNodes && index > -1) {
888
- return parentNodes[index - 1];
890
+ return parentNodes[index - 1] || null;
889
891
  }
890
892
  return this.__previousElementSibling;
891
893
  }
@@ -1213,10 +1215,15 @@ var h = (nodeName, vnodeData, ...children) => {
1213
1215
  } else if (child != null && typeof child !== "boolean") {
1214
1216
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
1215
1217
  child = String(child);
1216
- } else if (BUILD7.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1217
- consoleDevError(`vNode passed as children has unexpected type.
1218
+ } else if (typeof nodeName !== "function" && child.$flags$ === void 0) {
1219
+ if (BUILD7.isDev) {
1220
+ consoleDevError(`vNode passed as children has unexpected type.
1218
1221
  Make sure it's using the correct h() function.
1219
1222
  Empty objects can also be the cause, look for JSX comments that became objects.`);
1223
+ } else {
1224
+ consoleError("Invalid vNode child");
1225
+ }
1226
+ continue;
1220
1227
  }
1221
1228
  if (simple && lastSimple) {
1222
1229
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -2945,7 +2952,10 @@ var markSlotContentForRelocation = (elm) => {
2945
2952
  const slotName = childNode["s-sn"];
2946
2953
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
2947
2954
  node = hostContentNodes[j];
2948
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
2955
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && // let an exact named-slot match override a stale default-slot claim. Skip this for
2956
+ // `slotName === ''` itself - a matched default node's cached `s-sn` is `''` too, which
2957
+ // would trivially "match" on every re-render and force pointless re-insertion.
2958
+ (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"] || slotName !== "" && getSlotName(node) === slotName)) {
2949
2959
  if (isNodeLocatedInSlot(node, slotName)) {
2950
2960
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
2951
2961
  checkSlotFallbackVisibility = true;
@@ -3221,7 +3231,7 @@ var attachToAncestor = (hostRef, ancestorComponent) => {
3221
3231
  }
3222
3232
  };
3223
3233
  var scheduleUpdate = (hostRef, isInitialLoad) => {
3224
- if (BUILD15.taskQueue && BUILD15.updatable) {
3234
+ if (BUILD15.updatable) {
3225
3235
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
3226
3236
  }
3227
3237
  if (BUILD15.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
@@ -3291,7 +3301,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
3291
3301
  }
3292
3302
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
3293
3303
  if (BUILD15.isDev) {
3294
- hostRef.$flags$ |= 1024 /* devOnRender */;
3304
+ hostRef.$flags$ |= 2048 /* devOnRender */;
3295
3305
  }
3296
3306
  if (BUILD15.hydrateServerSide) {
3297
3307
  await callRender(hostRef, instance, elm, isInitialLoad);
@@ -3300,7 +3310,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
3300
3310
  }
3301
3311
  if (BUILD15.isDev) {
3302
3312
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
3303
- hostRef.$flags$ &= ~1024 /* devOnRender */;
3313
+ hostRef.$flags$ &= ~2048 /* devOnRender */;
3304
3314
  }
3305
3315
  if (BUILD15.hydrateServerSide) {
3306
3316
  try {
@@ -3340,12 +3350,11 @@ var renderingRef = null;
3340
3350
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
3341
3351
  const allRenderFn = BUILD15.allRenderFn ? true : false;
3342
3352
  const lazyLoad = BUILD15.lazyLoad ? true : false;
3343
- const taskQueue = BUILD15.taskQueue ? true : false;
3344
3353
  const updatable = BUILD15.updatable ? true : false;
3345
3354
  try {
3346
3355
  renderingRef = instance;
3347
3356
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
3348
- if (updatable && taskQueue) {
3357
+ if (updatable) {
3349
3358
  hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
3350
3359
  }
3351
3360
  if (updatable || lazyLoad) {
@@ -3381,11 +3390,11 @@ var postUpdateComponent = (hostRef) => {
3381
3390
  const instance = BUILD15.lazyLoad ? hostRef.$lazyInstance$ : elm;
3382
3391
  const ancestorComponent = hostRef.$ancestorComponent$;
3383
3392
  if (BUILD15.isDev) {
3384
- hostRef.$flags$ |= 1024 /* devOnRender */;
3393
+ hostRef.$flags$ |= 2048 /* devOnRender */;
3385
3394
  }
3386
3395
  safeCall(instance, "componentDidRender", void 0, elm);
3387
3396
  if (BUILD15.isDev) {
3388
- hostRef.$flags$ &= ~1024 /* devOnRender */;
3397
+ hostRef.$flags$ &= ~2048 /* devOnRender */;
3389
3398
  }
3390
3399
  emitLifecycleEvent(elm, "componentDidRender");
3391
3400
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
@@ -3394,11 +3403,11 @@ var postUpdateComponent = (hostRef) => {
3394
3403
  addHydratedFlag(elm);
3395
3404
  }
3396
3405
  if (BUILD15.isDev) {
3397
- hostRef.$flags$ |= 2048 /* devOnDidLoad */;
3406
+ hostRef.$flags$ |= 4096 /* devOnDidLoad */;
3398
3407
  }
3399
3408
  safeCall(instance, "componentDidLoad", void 0, elm);
3400
3409
  if (BUILD15.isDev) {
3401
- hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
3410
+ hostRef.$flags$ &= ~4096 /* devOnDidLoad */;
3402
3411
  }
3403
3412
  emitLifecycleEvent(elm, "componentDidLoad");
3404
3413
  endPostUpdate();
@@ -3410,11 +3419,11 @@ var postUpdateComponent = (hostRef) => {
3410
3419
  }
3411
3420
  } else {
3412
3421
  if (BUILD15.isDev) {
3413
- hostRef.$flags$ |= 1024 /* devOnRender */;
3422
+ hostRef.$flags$ |= 2048 /* devOnRender */;
3414
3423
  }
3415
3424
  safeCall(instance, "componentDidUpdate", void 0, elm);
3416
3425
  if (BUILD15.isDev) {
3417
- hostRef.$flags$ &= ~1024 /* devOnRender */;
3426
+ hostRef.$flags$ &= ~2048 /* devOnRender */;
3418
3427
  }
3419
3428
  emitLifecycleEvent(elm, "componentDidUpdate");
3420
3429
  endPostUpdate();
@@ -3546,7 +3555,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3546
3555
  }
3547
3556
  }
3548
3557
  if (BUILD16.isDev) {
3549
- if (hostRef.$flags$ & 1024 /* devOnRender */) {
3558
+ if (hostRef.$flags$ & 2048 /* devOnRender */) {
3550
3559
  consoleDevWarn(
3551
3560
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
3552
3561
  "\nElement",
@@ -3556,7 +3565,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3556
3565
  "\nOld value",
3557
3566
  oldVal
3558
3567
  );
3559
- } else if (hostRef.$flags$ & 2048 /* devOnDidLoad */) {
3568
+ } else if (hostRef.$flags$ & 4096 /* devOnDidLoad */) {
3560
3569
  consoleDevWarn(
3561
3570
  `The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`,
3562
3571
  "\nElement",
@@ -3847,10 +3856,12 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3847
3856
 
3848
3857
  // src/runtime/initialize-component.ts
3849
3858
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3859
+ var _a2;
3850
3860
  let Cstr;
3851
3861
  try {
3852
3862
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3853
3863
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3864
+ hostRef.$flags$ &= ~1024 /* hasFailedLoad */;
3854
3865
  const bundleId = cmpMeta.$lazyBundleId$;
3855
3866
  if (BUILD18.lazyLoad && bundleId) {
3856
3867
  const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
@@ -3865,6 +3876,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3865
3876
  Cstr = CstrImport;
3866
3877
  }
3867
3878
  if (!Cstr) {
3879
+ hostRef.$flags$ &= ~32 /* hasInitializedComponent */;
3880
+ hostRef.$loadRetryCount$ = ((_a2 = hostRef.$loadRetryCount$) != null ? _a2 : 0) + 1;
3881
+ if (hostRef.$loadRetryCount$ < MAX_LAZY_LOAD_RETRIES) {
3882
+ hostRef.$flags$ |= 1024 /* hasFailedLoad */;
3883
+ }
3868
3884
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3869
3885
  }
3870
3886
  if (BUILD18.member && !Cstr.isProxied) {
@@ -3944,7 +3960,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3944
3960
  hostRef.$onRenderResolve$();
3945
3961
  hostRef.$onRenderResolve$ = void 0;
3946
3962
  }
3947
- if (BUILD18.asyncLoading && hostRef.$onReadyResolve$) {
3963
+ if (BUILD18.asyncLoading && hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
3948
3964
  hostRef.$onReadyResolve$(elm);
3949
3965
  }
3950
3966
  }
@@ -4016,6 +4032,8 @@ var connectedCallback = (elm) => {
4016
4032
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
4017
4033
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
4018
4034
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
4035
+ } else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
4036
+ setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
4019
4037
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
4020
4038
  hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
4021
4039
  }
@@ -4319,7 +4337,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
4319
4337
  }
4320
4338
  disconnectedCallback() {
4321
4339
  plt.jmp(() => disconnectedCallback(this));
4322
- plt.raf(() => {
4340
+ nextTick(() => {
4323
4341
  var _a4;
4324
4342
  const hostRef = getHostRef(this);
4325
4343
  if (!hostRef) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/hydrate",
3
- "version": "4.43.5",
3
+ "version": "4.44.0",
4
4
  "description": "Stencil internal hydrate platform to be imported by the Stencil 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
- Stencil Hydrate Runner v4.43.5 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Runner v4.44.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal",
3
- "version": "4.43.5",
3
+ "version": "4.44.0",
4
4
  "description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -500,6 +500,7 @@ export interface ComponentCompilerFeatures {
500
500
  htmlAttrNames: string[];
501
501
  htmlTagNames: string[];
502
502
  htmlParts: string[];
503
+ htmlSlots: string[];
503
504
  isUpdateable: boolean;
504
505
  /**
505
506
  * A plain component is one that doesn't have:
@@ -1167,6 +1168,7 @@ export interface Module {
1167
1168
  htmlAttrNames: string[];
1168
1169
  htmlTagNames: string[];
1169
1170
  htmlParts: string[];
1171
+ htmlSlots: string[];
1170
1172
  isCollectionDependency: boolean;
1171
1173
  isLegacy: boolean;
1172
1174
  jsFilePath: string;
@@ -1639,6 +1641,11 @@ export interface HostRef {
1639
1641
  * Defer connectedCallback until after first render for components with slot relocation.
1640
1642
  */
1641
1643
  $deferredConnectedCallback$?: boolean;
1644
+ /**
1645
+ * The number of times this host's lazy component load has failed and been retried.
1646
+ * Used to give up retrying after {@link MAX_LAZY_LOAD_RETRIES} failed attempts.
1647
+ */
1648
+ $loadRetryCount$?: number;
1642
1649
  }
1643
1650
  export interface PlatformRuntime {
1644
1651
  /**
@@ -146,6 +146,10 @@ export interface StencilConfig {
146
146
  * (for example, decorating a method named `focus` with `@Method()`). Defaults to `false`.
147
147
  */
148
148
  suppressReservedPublicNameWarnings?: boolean;
149
+ /**
150
+ * When `true`, Stencil will suppress diagnostics which warn about event names conflicting with native DOM event names. Defaults to `false`.
151
+ */
152
+ suppressReservedEventNameWarnings?: boolean;
149
153
  /**
150
154
  * When `true`, we will validate a project's `package.json` based on the output target the user has designated
151
155
  * as `isPrimaryPackageOutputTarget: true` in their Stencil config.