@vue/runtime-dom 3.6.0-alpha.5 → 3.6.0-alpha.6

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-alpha.5
2
+ * @vue/runtime-dom v3.6.0-alpha.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-alpha.5
2
+ * @vue/runtime-dom v3.6.0-alpha.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-alpha.5
2
+ * @vue/runtime-dom v3.6.0-alpha.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -4293,7 +4293,8 @@ function createHydrationFunctions(rendererInternals) {
4293
4293
  node,
4294
4294
  container,
4295
4295
  null,
4296
- parentComponent
4296
+ parentComponent,
4297
+ parentSuspense
4297
4298
  );
4298
4299
  } else {
4299
4300
  mountComponent(
@@ -7146,29 +7147,7 @@ function renderComponentRoot(instance) {
7146
7147
  }
7147
7148
  root = cloneVNode(root, fallthroughAttrs, false, true);
7148
7149
  } else if (!accessedAttrs && root.type !== Comment) {
7149
- const allAttrs = Object.keys(attrs);
7150
- const eventAttrs = [];
7151
- const extraAttrs = [];
7152
- for (let i = 0, l = allAttrs.length; i < l; i++) {
7153
- const key = allAttrs[i];
7154
- if (isOn(key)) {
7155
- if (!isModelListener(key)) {
7156
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
7157
- }
7158
- } else {
7159
- extraAttrs.push(key);
7160
- }
7161
- }
7162
- if (extraAttrs.length) {
7163
- warn$1(
7164
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
7165
- );
7166
- }
7167
- if (eventAttrs.length) {
7168
- warn$1(
7169
- `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
7170
- );
7171
- }
7150
+ warnExtraneousAttributes(attrs);
7172
7151
  }
7173
7152
  }
7174
7153
  }
@@ -7220,6 +7199,31 @@ const getChildRoot = (vnode) => {
7220
7199
  };
7221
7200
  return [normalizeVNode(childRoot), setRoot];
7222
7201
  };
7202
+ function warnExtraneousAttributes(attrs) {
7203
+ const allAttrs = Object.keys(attrs);
7204
+ const eventAttrs = [];
7205
+ const extraAttrs = [];
7206
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
7207
+ const key = allAttrs[i];
7208
+ if (isOn(key)) {
7209
+ if (!isModelListener(key)) {
7210
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
7211
+ }
7212
+ } else {
7213
+ extraAttrs.push(key);
7214
+ }
7215
+ }
7216
+ if (extraAttrs.length) {
7217
+ warn$1(
7218
+ `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
7219
+ );
7220
+ }
7221
+ if (eventAttrs.length) {
7222
+ warn$1(
7223
+ `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
7224
+ );
7225
+ }
7226
+ }
7223
7227
  function filterSingleRoot(children, recurse = true) {
7224
7228
  let singleRoot;
7225
7229
  for (let i = 0; i < children.length; i++) {
@@ -8472,7 +8476,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8472
8476
  n2,
8473
8477
  container,
8474
8478
  anchor,
8475
- parentComponent
8479
+ parentComponent,
8480
+ parentSuspense
8476
8481
  );
8477
8482
  }
8478
8483
  } else {
@@ -8533,7 +8538,42 @@ function baseCreateRenderer(options, createHydrationFns) {
8533
8538
  }
8534
8539
  if (isHmrUpdating) initialVNode.el = null;
8535
8540
  if (instance.asyncDep) {
8536
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8541
+ if (parentSuspense) {
8542
+ const hydratedEl = instance.vnode.el;
8543
+ parentSuspense.registerDep(instance, (setupResult) => {
8544
+ const { vnode } = instance;
8545
+ {
8546
+ pushWarningContext(vnode);
8547
+ }
8548
+ handleSetupResult(instance, setupResult, false);
8549
+ if (hydratedEl) {
8550
+ vnode.el = hydratedEl;
8551
+ }
8552
+ const placeholder = !hydratedEl && instance.subTree.el;
8553
+ setupRenderEffect(
8554
+ instance,
8555
+ vnode,
8556
+ // component may have been moved before resolve.
8557
+ // if this is not a hydration, instance.subTree will be the comment
8558
+ // placeholder.
8559
+ hostParentNode(hydratedEl || instance.subTree.el),
8560
+ // anchor will not be used if this is hydration, so only need to
8561
+ // consider the comment placeholder case.
8562
+ hydratedEl ? null : getNextHostNode(instance.subTree),
8563
+ parentSuspense,
8564
+ namespace,
8565
+ optimized
8566
+ );
8567
+ if (placeholder) {
8568
+ vnode.placeholder = null;
8569
+ hostRemove(placeholder);
8570
+ }
8571
+ updateHOCHostEl(instance, vnode.el);
8572
+ {
8573
+ popWarningContext();
8574
+ }
8575
+ });
8576
+ }
8537
8577
  if (!initialVNode.el) {
8538
8578
  const placeholder = instance.subTree = createVNode(Comment);
8539
8579
  processCommentNode(null, placeholder, container, anchor);
@@ -9862,7 +9902,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9862
9902
  m: move,
9863
9903
  um: unmount,
9864
9904
  n: next,
9865
- o: { parentNode, remove }
9905
+ o: { parentNode }
9866
9906
  } = rendererInternals;
9867
9907
  let parentSuspenseId;
9868
9908
  const isSuspensible = isVNodeSuspensible(vnode);
@@ -10037,12 +10077,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
10037
10077
  next() {
10038
10078
  return suspense.activeBranch && next(suspense.activeBranch);
10039
10079
  },
10040
- registerDep(instance, setupRenderEffect, optimized2) {
10080
+ registerDep(instance, onResolve) {
10041
10081
  const isInPendingSuspense = !!suspense.pendingBranch;
10042
10082
  if (isInPendingSuspense) {
10043
10083
  suspense.deps++;
10044
10084
  }
10045
- const hydratedEl = instance.vnode.el;
10046
10085
  instance.asyncDep.catch((err) => {
10047
10086
  handleError(err, instance, 0);
10048
10087
  }).then((asyncSetupResult) => {
@@ -10050,37 +10089,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
10050
10089
  return;
10051
10090
  }
10052
10091
  instance.asyncResolved = true;
10053
- const { vnode: vnode2 } = instance;
10054
- {
10055
- pushWarningContext(vnode2);
10056
- }
10057
- handleSetupResult(instance, asyncSetupResult, false);
10058
- if (hydratedEl) {
10059
- vnode2.el = hydratedEl;
10060
- }
10061
- const placeholder = !hydratedEl && instance.subTree.el;
10062
- setupRenderEffect(
10063
- instance,
10064
- vnode2,
10065
- // component may have been moved before resolve.
10066
- // if this is not a hydration, instance.subTree will be the comment
10067
- // placeholder.
10068
- parentNode(hydratedEl || instance.subTree.el),
10069
- // anchor will not be used if this is hydration, so only need to
10070
- // consider the comment placeholder case.
10071
- hydratedEl ? null : next(instance.subTree),
10072
- suspense,
10073
- namespace,
10074
- optimized2
10075
- );
10076
- if (placeholder) {
10077
- vnode2.placeholder = null;
10078
- remove(placeholder);
10079
- }
10080
- updateHOCHostEl(instance, vnode2.el);
10081
- {
10082
- popWarningContext();
10083
- }
10092
+ onResolve(asyncSetupResult);
10084
10093
  if (isInPendingSuspense && --suspense.deps === 0) {
10085
10094
  suspense.resolve();
10086
10095
  }
@@ -11262,7 +11271,7 @@ function isMemoSame(cached, memo) {
11262
11271
  return true;
11263
11272
  }
11264
11273
 
11265
- const version = "3.6.0-alpha.5";
11274
+ const version = "3.6.0-alpha.6";
11266
11275
  const warn = warn$1 ;
11267
11276
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11268
11277
  const devtools = devtools$1 ;