@vue/runtime-core 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-core v3.6.0-alpha.5
2
+ * @vue/runtime-core v3.6.0-alpha.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1953,7 +1953,8 @@ function createHydrationFunctions(rendererInternals) {
1953
1953
  node,
1954
1954
  container,
1955
1955
  null,
1956
- parentComponent
1956
+ parentComponent,
1957
+ parentSuspense
1957
1958
  );
1958
1959
  } else {
1959
1960
  mountComponent(
@@ -4803,29 +4804,7 @@ function renderComponentRoot(instance) {
4803
4804
  }
4804
4805
  root = cloneVNode(root, fallthroughAttrs, false, true);
4805
4806
  } else if (!accessedAttrs && root.type !== Comment) {
4806
- const allAttrs = Object.keys(attrs);
4807
- const eventAttrs = [];
4808
- const extraAttrs = [];
4809
- for (let i = 0, l = allAttrs.length; i < l; i++) {
4810
- const key = allAttrs[i];
4811
- if (shared.isOn(key)) {
4812
- if (!shared.isModelListener(key)) {
4813
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
4814
- }
4815
- } else {
4816
- extraAttrs.push(key);
4817
- }
4818
- }
4819
- if (extraAttrs.length) {
4820
- warn$1(
4821
- `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.`
4822
- );
4823
- }
4824
- if (eventAttrs.length) {
4825
- warn$1(
4826
- `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.`
4827
- );
4828
- }
4807
+ warnExtraneousAttributes(attrs);
4829
4808
  }
4830
4809
  }
4831
4810
  }
@@ -4877,6 +4856,31 @@ const getChildRoot = (vnode) => {
4877
4856
  };
4878
4857
  return [normalizeVNode(childRoot), setRoot];
4879
4858
  };
4859
+ function warnExtraneousAttributes(attrs) {
4860
+ const allAttrs = Object.keys(attrs);
4861
+ const eventAttrs = [];
4862
+ const extraAttrs = [];
4863
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
4864
+ const key = allAttrs[i];
4865
+ if (shared.isOn(key)) {
4866
+ if (!shared.isModelListener(key)) {
4867
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
4868
+ }
4869
+ } else {
4870
+ extraAttrs.push(key);
4871
+ }
4872
+ }
4873
+ if (extraAttrs.length) {
4874
+ warn$1(
4875
+ `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.`
4876
+ );
4877
+ }
4878
+ if (eventAttrs.length) {
4879
+ warn$1(
4880
+ `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.`
4881
+ );
4882
+ }
4883
+ }
4880
4884
  function filterSingleRoot(children, recurse = true) {
4881
4885
  let singleRoot;
4882
4886
  for (let i = 0; i < children.length; i++) {
@@ -6129,7 +6133,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6129
6133
  n2,
6130
6134
  container,
6131
6135
  anchor,
6132
- parentComponent
6136
+ parentComponent,
6137
+ parentSuspense
6133
6138
  );
6134
6139
  }
6135
6140
  } else {
@@ -6190,7 +6195,42 @@ function baseCreateRenderer(options, createHydrationFns) {
6190
6195
  }
6191
6196
  if (isHmrUpdating) initialVNode.el = null;
6192
6197
  if (instance.asyncDep) {
6193
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
6198
+ if (parentSuspense) {
6199
+ const hydratedEl = instance.vnode.el;
6200
+ parentSuspense.registerDep(instance, (setupResult) => {
6201
+ const { vnode } = instance;
6202
+ {
6203
+ pushWarningContext(vnode);
6204
+ }
6205
+ handleSetupResult(instance, setupResult, false);
6206
+ if (hydratedEl) {
6207
+ vnode.el = hydratedEl;
6208
+ }
6209
+ const placeholder = !hydratedEl && instance.subTree.el;
6210
+ setupRenderEffect(
6211
+ instance,
6212
+ vnode,
6213
+ // component may have been moved before resolve.
6214
+ // if this is not a hydration, instance.subTree will be the comment
6215
+ // placeholder.
6216
+ hostParentNode(hydratedEl || instance.subTree.el),
6217
+ // anchor will not be used if this is hydration, so only need to
6218
+ // consider the comment placeholder case.
6219
+ hydratedEl ? null : getNextHostNode(instance.subTree),
6220
+ parentSuspense,
6221
+ namespace,
6222
+ optimized
6223
+ );
6224
+ if (placeholder) {
6225
+ vnode.placeholder = null;
6226
+ hostRemove(placeholder);
6227
+ }
6228
+ updateHOCHostEl(instance, vnode.el);
6229
+ {
6230
+ popWarningContext();
6231
+ }
6232
+ });
6233
+ }
6194
6234
  if (!initialVNode.el) {
6195
6235
  const placeholder = instance.subTree = createVNode(Comment);
6196
6236
  processCommentNode(null, placeholder, container, anchor);
@@ -7519,7 +7559,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7519
7559
  m: move,
7520
7560
  um: unmount,
7521
7561
  n: next,
7522
- o: { parentNode, remove }
7562
+ o: { parentNode }
7523
7563
  } = rendererInternals;
7524
7564
  let parentSuspenseId;
7525
7565
  const isSuspensible = isVNodeSuspensible(vnode);
@@ -7694,12 +7734,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7694
7734
  next() {
7695
7735
  return suspense.activeBranch && next(suspense.activeBranch);
7696
7736
  },
7697
- registerDep(instance, setupRenderEffect, optimized2) {
7737
+ registerDep(instance, onResolve) {
7698
7738
  const isInPendingSuspense = !!suspense.pendingBranch;
7699
7739
  if (isInPendingSuspense) {
7700
7740
  suspense.deps++;
7701
7741
  }
7702
- const hydratedEl = instance.vnode.el;
7703
7742
  instance.asyncDep.catch((err) => {
7704
7743
  handleError(err, instance, 0);
7705
7744
  }).then((asyncSetupResult) => {
@@ -7707,37 +7746,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7707
7746
  return;
7708
7747
  }
7709
7748
  instance.asyncResolved = true;
7710
- const { vnode: vnode2 } = instance;
7711
- {
7712
- pushWarningContext(vnode2);
7713
- }
7714
- handleSetupResult(instance, asyncSetupResult, false);
7715
- if (hydratedEl) {
7716
- vnode2.el = hydratedEl;
7717
- }
7718
- const placeholder = !hydratedEl && instance.subTree.el;
7719
- setupRenderEffect(
7720
- instance,
7721
- vnode2,
7722
- // component may have been moved before resolve.
7723
- // if this is not a hydration, instance.subTree will be the comment
7724
- // placeholder.
7725
- parentNode(hydratedEl || instance.subTree.el),
7726
- // anchor will not be used if this is hydration, so only need to
7727
- // consider the comment placeholder case.
7728
- hydratedEl ? null : next(instance.subTree),
7729
- suspense,
7730
- namespace,
7731
- optimized2
7732
- );
7733
- if (placeholder) {
7734
- vnode2.placeholder = null;
7735
- remove(placeholder);
7736
- }
7737
- updateHOCHostEl(instance, vnode2.el);
7738
- {
7739
- popWarningContext();
7740
- }
7749
+ onResolve(asyncSetupResult);
7741
7750
  if (isInPendingSuspense && --suspense.deps === 0) {
7742
7751
  suspense.resolve();
7743
7752
  }
@@ -8919,7 +8928,7 @@ function isMemoSame(cached, memo) {
8919
8928
  return true;
8920
8929
  }
8921
8930
 
8922
- const version = "3.6.0-alpha.5";
8931
+ const version = "3.6.0-alpha.6";
8923
8932
  const warn = warn$1 ;
8924
8933
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8925
8934
  const devtools = devtools$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-alpha.5
2
+ * @vue/runtime-core v3.6.0-alpha.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -10,9 +10,119 @@ Object.defineProperty(exports, '__esModule', { value: true });
10
10
  var reactivity = require('@vue/reactivity');
11
11
  var shared = require('@vue/shared');
12
12
 
13
+ const stack = [];
13
14
  function pushWarningContext(ctx) {
15
+ stack.push(ctx);
14
16
  }
15
17
  function popWarningContext() {
18
+ stack.pop();
19
+ }
20
+ let isWarning = false;
21
+ function warn$2(msg, ...args) {
22
+ if (isWarning) return;
23
+ isWarning = true;
24
+ const prevSub = reactivity.setActiveSub();
25
+ const entry = stack.length ? stack[stack.length - 1] : null;
26
+ const instance = isVNode(entry) ? entry.component : entry;
27
+ const appWarnHandler = instance && instance.appContext.config.warnHandler;
28
+ const trace = getComponentTrace();
29
+ if (appWarnHandler) {
30
+ callWithErrorHandling(
31
+ appWarnHandler,
32
+ instance,
33
+ 11,
34
+ [
35
+ // eslint-disable-next-line no-restricted-syntax
36
+ msg + args.map((a) => {
37
+ var _a, _b;
38
+ return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
39
+ }).join(""),
40
+ instance && instance.proxy || instance,
41
+ trace.map(
42
+ ({ ctx }) => `at <${formatComponentName(instance, ctx.type)}>`
43
+ ).join("\n"),
44
+ trace
45
+ ]
46
+ );
47
+ } else {
48
+ const warnArgs = [`[Vue warn]: ${msg}`, ...args];
49
+ if (trace.length && // avoid spamming console during tests
50
+ true) {
51
+ warnArgs.push(`
52
+ `, ...formatTrace(trace));
53
+ }
54
+ console.warn(...warnArgs);
55
+ }
56
+ reactivity.setActiveSub(prevSub);
57
+ isWarning = false;
58
+ }
59
+ function getComponentTrace() {
60
+ let currentCtx = stack[stack.length - 1];
61
+ if (!currentCtx) {
62
+ return [];
63
+ }
64
+ const normalizedStack = [];
65
+ while (currentCtx) {
66
+ const last = normalizedStack[0];
67
+ if (last && last.ctx === currentCtx) {
68
+ last.recurseCount++;
69
+ } else {
70
+ normalizedStack.push({
71
+ ctx: currentCtx,
72
+ recurseCount: 0
73
+ });
74
+ }
75
+ if (isVNode(currentCtx)) {
76
+ const parent = currentCtx.component && currentCtx.component.parent;
77
+ currentCtx = parent && parent.vnode || parent;
78
+ } else {
79
+ currentCtx = currentCtx.parent;
80
+ }
81
+ }
82
+ return normalizedStack;
83
+ }
84
+ function formatTrace(trace) {
85
+ const logs = [];
86
+ trace.forEach((entry, i) => {
87
+ logs.push(...i === 0 ? [] : [`
88
+ `], ...formatTraceEntry(entry));
89
+ });
90
+ return logs;
91
+ }
92
+ function formatTraceEntry({ ctx, recurseCount }) {
93
+ const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
94
+ const instance = isVNode(ctx) ? ctx.component : ctx;
95
+ const isRoot = instance ? instance.parent == null : false;
96
+ const open = ` at <${formatComponentName(instance, ctx.type, isRoot)}`;
97
+ const close = `>` + postfix;
98
+ return ctx.props ? [open, ...formatProps(ctx.props), close] : [open + close];
99
+ }
100
+ function formatProps(props) {
101
+ const res = [];
102
+ const keys = Object.keys(props);
103
+ keys.slice(0, 3).forEach((key) => {
104
+ res.push(...formatProp(key, props[key]));
105
+ });
106
+ if (keys.length > 3) {
107
+ res.push(` ...`);
108
+ }
109
+ return res;
110
+ }
111
+ function formatProp(key, value, raw) {
112
+ if (shared.isString(value)) {
113
+ value = JSON.stringify(value);
114
+ return raw ? value : [`${key}=${value}`];
115
+ } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
116
+ return raw ? value : [`${key}=${value}`];
117
+ } else if (reactivity.isRef(value)) {
118
+ value = formatProp(key, reactivity.toRaw(value.value), true);
119
+ return raw ? value : [`${key}=Ref<`, value, `>`];
120
+ } else if (shared.isFunction(value)) {
121
+ return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
122
+ } else {
123
+ value = reactivity.toRaw(value);
124
+ return raw ? value : [`${key}=`, value];
125
+ }
16
126
  }
17
127
  function assertNumber(val, type) {
18
128
  return;
@@ -1444,7 +1554,8 @@ function createHydrationFunctions(rendererInternals) {
1444
1554
  node,
1445
1555
  container,
1446
1556
  null,
1447
- parentComponent
1557
+ parentComponent,
1558
+ parentSuspense
1448
1559
  );
1449
1560
  } else {
1450
1561
  mountComponent(
@@ -3634,7 +3745,7 @@ function renderComponentRoot(instance) {
3634
3745
  const proxyToUse = withProxy || proxy;
3635
3746
  const thisProxy = false ? new Proxy(proxyToUse, {
3636
3747
  get(target, key, receiver) {
3637
- warn(
3748
+ warn$2(
3638
3749
  `Property '${String(
3639
3750
  key
3640
3751
  )}' was accessed via 'this'. Avoid using 'this' in templates.`
@@ -4725,7 +4836,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4725
4836
  n2,
4726
4837
  container,
4727
4838
  anchor,
4728
- parentComponent
4839
+ parentComponent,
4840
+ parentSuspense
4729
4841
  );
4730
4842
  }
4731
4843
  } else {
@@ -4772,7 +4884,36 @@ function baseCreateRenderer(options, createHydrationFns) {
4772
4884
  setupComponent(instance, false, optimized);
4773
4885
  }
4774
4886
  if (instance.asyncDep) {
4775
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
4887
+ if (parentSuspense) {
4888
+ const hydratedEl = instance.vnode.el;
4889
+ parentSuspense.registerDep(instance, (setupResult) => {
4890
+ const { vnode } = instance;
4891
+ handleSetupResult(instance, setupResult, false);
4892
+ if (hydratedEl) {
4893
+ vnode.el = hydratedEl;
4894
+ }
4895
+ const placeholder = !hydratedEl && instance.subTree.el;
4896
+ setupRenderEffect(
4897
+ instance,
4898
+ vnode,
4899
+ // component may have been moved before resolve.
4900
+ // if this is not a hydration, instance.subTree will be the comment
4901
+ // placeholder.
4902
+ hostParentNode(hydratedEl || instance.subTree.el),
4903
+ // anchor will not be used if this is hydration, so only need to
4904
+ // consider the comment placeholder case.
4905
+ hydratedEl ? null : getNextHostNode(instance.subTree),
4906
+ parentSuspense,
4907
+ namespace,
4908
+ optimized
4909
+ );
4910
+ if (placeholder) {
4911
+ vnode.placeholder = null;
4912
+ hostRemove(placeholder);
4913
+ }
4914
+ updateHOCHostEl(instance, vnode.el);
4915
+ });
4916
+ }
4776
4917
  if (!initialVNode.el) {
4777
4918
  const placeholder = instance.subTree = createVNode(Comment);
4778
4919
  processCommentNode(null, placeholder, container, anchor);
@@ -5989,7 +6130,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5989
6130
  m: move,
5990
6131
  um: unmount,
5991
6132
  n: next,
5992
- o: { parentNode, remove }
6133
+ o: { parentNode }
5993
6134
  } = rendererInternals;
5994
6135
  let parentSuspenseId;
5995
6136
  const isSuspensible = isVNodeSuspensible(vnode);
@@ -6149,12 +6290,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
6149
6290
  next() {
6150
6291
  return suspense.activeBranch && next(suspense.activeBranch);
6151
6292
  },
6152
- registerDep(instance, setupRenderEffect, optimized2) {
6293
+ registerDep(instance, onResolve) {
6153
6294
  const isInPendingSuspense = !!suspense.pendingBranch;
6154
6295
  if (isInPendingSuspense) {
6155
6296
  suspense.deps++;
6156
6297
  }
6157
- const hydratedEl = instance.vnode.el;
6158
6298
  instance.asyncDep.catch((err) => {
6159
6299
  handleError(err, instance, 0);
6160
6300
  }).then((asyncSetupResult) => {
@@ -6162,31 +6302,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
6162
6302
  return;
6163
6303
  }
6164
6304
  instance.asyncResolved = true;
6165
- const { vnode: vnode2 } = instance;
6166
- handleSetupResult(instance, asyncSetupResult, false);
6167
- if (hydratedEl) {
6168
- vnode2.el = hydratedEl;
6169
- }
6170
- const placeholder = !hydratedEl && instance.subTree.el;
6171
- setupRenderEffect(
6172
- instance,
6173
- vnode2,
6174
- // component may have been moved before resolve.
6175
- // if this is not a hydration, instance.subTree will be the comment
6176
- // placeholder.
6177
- parentNode(hydratedEl || instance.subTree.el),
6178
- // anchor will not be used if this is hydration, so only need to
6179
- // consider the comment placeholder case.
6180
- hydratedEl ? null : next(instance.subTree),
6181
- suspense,
6182
- namespace,
6183
- optimized2
6184
- );
6185
- if (placeholder) {
6186
- vnode2.placeholder = null;
6187
- remove(placeholder);
6188
- }
6189
- updateHOCHostEl(instance, vnode2.el);
6305
+ onResolve(asyncSetupResult);
6190
6306
  if (isInPendingSuspense && --suspense.deps === 0) {
6191
6307
  suspense.resolve();
6192
6308
  }
@@ -6940,9 +7056,33 @@ function getComponentPublicInstance(instance) {
6940
7056
  return instance.proxy;
6941
7057
  }
6942
7058
  }
7059
+ const classifyRE = /(?:^|[-_])\w/g;
7060
+ const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
6943
7061
  function getComponentName(Component, includeInferred = true) {
6944
7062
  return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
6945
7063
  }
7064
+ function formatComponentName(instance, Component, isRoot = false) {
7065
+ let name = getComponentName(Component);
7066
+ if (!name && Component.__file) {
7067
+ const match = Component.__file.match(/([^/\\]+)\.\w+$/);
7068
+ if (match) {
7069
+ name = match[1];
7070
+ }
7071
+ }
7072
+ if (!name && instance) {
7073
+ const inferFromRegistry = (registry) => {
7074
+ for (const key in registry) {
7075
+ if (registry[key] === Component) {
7076
+ return key;
7077
+ }
7078
+ }
7079
+ };
7080
+ name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(
7081
+ instance.parent.type.components
7082
+ ) || inferFromRegistry(instance.appContext.components);
7083
+ }
7084
+ return name ? classify(name) : isRoot ? `App` : `Anonymous`;
7085
+ }
6946
7086
  function isClassComponent(value) {
6947
7087
  return shared.isFunction(value) && "__vccOpts" in value;
6948
7088
  }
@@ -7009,7 +7149,7 @@ function isMemoSame(cached, memo) {
7009
7149
  return true;
7010
7150
  }
7011
7151
 
7012
- const version = "3.6.0-alpha.5";
7152
+ const version = "3.6.0-alpha.6";
7013
7153
  const warn$1 = shared.NOOP;
7014
7154
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
7015
7155
  const devtools = void 0;
@@ -586,7 +586,7 @@ export interface SuspenseBoundary {
586
586
  fallback(fallbackVNode: VNode): void;
587
587
  move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
588
588
  next(): RendererNode | null;
589
- registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean): void;
589
+ registerDep(instance: GenericComponentInstance, onResolve: (setupResult: unknown) => void): void;
590
590
  unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
591
591
  }
592
592
  declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, hydrateNode: (node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
@@ -720,7 +720,6 @@ type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | nul
720
720
  type RemoveFn = (vnode: VNode) => void;
721
721
  type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
722
722
  type UnmountComponentFn = (instance: ComponentInternalInstance, parentSuspense: SuspenseBoundary | null, doRemove?: boolean) => void;
723
- type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
724
723
  declare enum MoveType {
725
724
  ENTER = 0,
726
725
  LEAVE = 1,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-alpha.5
2
+ * @vue/runtime-core v3.6.0-alpha.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1957,7 +1957,8 @@ function createHydrationFunctions(rendererInternals) {
1957
1957
  node,
1958
1958
  container,
1959
1959
  null,
1960
- parentComponent
1960
+ parentComponent,
1961
+ parentSuspense
1961
1962
  );
1962
1963
  } else {
1963
1964
  mountComponent(
@@ -4837,29 +4838,7 @@ function renderComponentRoot(instance) {
4837
4838
  }
4838
4839
  root = cloneVNode(root, fallthroughAttrs, false, true);
4839
4840
  } else if (!!(process.env.NODE_ENV !== "production") && !accessedAttrs && root.type !== Comment) {
4840
- const allAttrs = Object.keys(attrs);
4841
- const eventAttrs = [];
4842
- const extraAttrs = [];
4843
- for (let i = 0, l = allAttrs.length; i < l; i++) {
4844
- const key = allAttrs[i];
4845
- if (isOn(key)) {
4846
- if (!isModelListener(key)) {
4847
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
4848
- }
4849
- } else {
4850
- extraAttrs.push(key);
4851
- }
4852
- }
4853
- if (extraAttrs.length) {
4854
- warn$1(
4855
- `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.`
4856
- );
4857
- }
4858
- if (eventAttrs.length) {
4859
- warn$1(
4860
- `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.`
4861
- );
4862
- }
4841
+ warnExtraneousAttributes(attrs);
4863
4842
  }
4864
4843
  }
4865
4844
  }
@@ -4911,6 +4890,31 @@ const getChildRoot = (vnode) => {
4911
4890
  };
4912
4891
  return [normalizeVNode(childRoot), setRoot];
4913
4892
  };
4893
+ function warnExtraneousAttributes(attrs) {
4894
+ const allAttrs = Object.keys(attrs);
4895
+ const eventAttrs = [];
4896
+ const extraAttrs = [];
4897
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
4898
+ const key = allAttrs[i];
4899
+ if (isOn(key)) {
4900
+ if (!isModelListener(key)) {
4901
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
4902
+ }
4903
+ } else {
4904
+ extraAttrs.push(key);
4905
+ }
4906
+ }
4907
+ if (extraAttrs.length) {
4908
+ warn$1(
4909
+ `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.`
4910
+ );
4911
+ }
4912
+ if (eventAttrs.length) {
4913
+ warn$1(
4914
+ `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.`
4915
+ );
4916
+ }
4917
+ }
4914
4918
  function filterSingleRoot(children, recurse = true) {
4915
4919
  let singleRoot;
4916
4920
  for (let i = 0; i < children.length; i++) {
@@ -6212,7 +6216,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6212
6216
  n2,
6213
6217
  container,
6214
6218
  anchor,
6215
- parentComponent
6219
+ parentComponent,
6220
+ parentSuspense
6216
6221
  );
6217
6222
  }
6218
6223
  } else {
@@ -6273,7 +6278,42 @@ function baseCreateRenderer(options, createHydrationFns) {
6273
6278
  }
6274
6279
  if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) initialVNode.el = null;
6275
6280
  if (instance.asyncDep) {
6276
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
6281
+ if (parentSuspense) {
6282
+ const hydratedEl = instance.vnode.el;
6283
+ parentSuspense.registerDep(instance, (setupResult) => {
6284
+ const { vnode } = instance;
6285
+ if (!!(process.env.NODE_ENV !== "production")) {
6286
+ pushWarningContext(vnode);
6287
+ }
6288
+ handleSetupResult(instance, setupResult, false);
6289
+ if (hydratedEl) {
6290
+ vnode.el = hydratedEl;
6291
+ }
6292
+ const placeholder = !hydratedEl && instance.subTree.el;
6293
+ setupRenderEffect(
6294
+ instance,
6295
+ vnode,
6296
+ // component may have been moved before resolve.
6297
+ // if this is not a hydration, instance.subTree will be the comment
6298
+ // placeholder.
6299
+ hostParentNode(hydratedEl || instance.subTree.el),
6300
+ // anchor will not be used if this is hydration, so only need to
6301
+ // consider the comment placeholder case.
6302
+ hydratedEl ? null : getNextHostNode(instance.subTree),
6303
+ parentSuspense,
6304
+ namespace,
6305
+ optimized
6306
+ );
6307
+ if (placeholder) {
6308
+ vnode.placeholder = null;
6309
+ hostRemove(placeholder);
6310
+ }
6311
+ updateHOCHostEl(instance, vnode.el);
6312
+ if (!!(process.env.NODE_ENV !== "production")) {
6313
+ popWarningContext();
6314
+ }
6315
+ });
6316
+ }
6277
6317
  if (!initialVNode.el) {
6278
6318
  const placeholder = instance.subTree = createVNode(Comment);
6279
6319
  processCommentNode(null, placeholder, container, anchor);
@@ -7602,7 +7642,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7602
7642
  m: move,
7603
7643
  um: unmount,
7604
7644
  n: next,
7605
- o: { parentNode, remove }
7645
+ o: { parentNode }
7606
7646
  } = rendererInternals;
7607
7647
  let parentSuspenseId;
7608
7648
  const isSuspensible = isVNodeSuspensible(vnode);
@@ -7777,12 +7817,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7777
7817
  next() {
7778
7818
  return suspense.activeBranch && next(suspense.activeBranch);
7779
7819
  },
7780
- registerDep(instance, setupRenderEffect, optimized2) {
7820
+ registerDep(instance, onResolve) {
7781
7821
  const isInPendingSuspense = !!suspense.pendingBranch;
7782
7822
  if (isInPendingSuspense) {
7783
7823
  suspense.deps++;
7784
7824
  }
7785
- const hydratedEl = instance.vnode.el;
7786
7825
  instance.asyncDep.catch((err) => {
7787
7826
  handleError(err, instance, 0);
7788
7827
  }).then((asyncSetupResult) => {
@@ -7790,37 +7829,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7790
7829
  return;
7791
7830
  }
7792
7831
  instance.asyncResolved = true;
7793
- const { vnode: vnode2 } = instance;
7794
- if (!!(process.env.NODE_ENV !== "production")) {
7795
- pushWarningContext(vnode2);
7796
- }
7797
- handleSetupResult(instance, asyncSetupResult, false);
7798
- if (hydratedEl) {
7799
- vnode2.el = hydratedEl;
7800
- }
7801
- const placeholder = !hydratedEl && instance.subTree.el;
7802
- setupRenderEffect(
7803
- instance,
7804
- vnode2,
7805
- // component may have been moved before resolve.
7806
- // if this is not a hydration, instance.subTree will be the comment
7807
- // placeholder.
7808
- parentNode(hydratedEl || instance.subTree.el),
7809
- // anchor will not be used if this is hydration, so only need to
7810
- // consider the comment placeholder case.
7811
- hydratedEl ? null : next(instance.subTree),
7812
- suspense,
7813
- namespace,
7814
- optimized2
7815
- );
7816
- if (placeholder) {
7817
- vnode2.placeholder = null;
7818
- remove(placeholder);
7819
- }
7820
- updateHOCHostEl(instance, vnode2.el);
7821
- if (!!(process.env.NODE_ENV !== "production")) {
7822
- popWarningContext();
7823
- }
7832
+ onResolve(asyncSetupResult);
7824
7833
  if (isInPendingSuspense && --suspense.deps === 0) {
7825
7834
  suspense.resolve();
7826
7835
  }
@@ -9019,7 +9028,7 @@ function isMemoSame(cached, memo) {
9019
9028
  return true;
9020
9029
  }
9021
9030
 
9022
- const version = "3.6.0-alpha.5";
9031
+ const version = "3.6.0-alpha.6";
9023
9032
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
9024
9033
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9025
9034
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -9041,4 +9050,4 @@ const resolveFilter = null;
9041
9050
  const compatUtils = null;
9042
9051
  const DeprecationTypes = null;
9043
9052
 
9044
- export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, Static, Suspense, Teleport, Text, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, deactivate, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, endMeasure, ensureVaporSlotFallback, expose, flushOnAppMount, getAttributeMismatch, getComponentName, getCurrentInstance, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, isAsyncWrapper, isEmitListener, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isRuntimeOnly, isSetEqual, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isVNode, isValidHtmlOrSvgAttribute, leaveCbKey, markAsyncBoundary, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeRef, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, setBlockTracking, setCurrentInstance, setDevtoolsHook, setRef, setTransitionHooks, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, toClassSet, toHandlers, toStyleMap, transformVNodeArgs, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
9053
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, Static, Suspense, Teleport, Text, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, deactivate, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, endMeasure, ensureVaporSlotFallback, expose, flushOnAppMount, getAttributeMismatch, getComponentName, getCurrentInstance, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, isAsyncWrapper, isEmitListener, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isRuntimeOnly, isSetEqual, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isVNode, isValidHtmlOrSvgAttribute, leaveCbKey, markAsyncBoundary, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeRef, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, setBlockTracking, setCurrentInstance, setDevtoolsHook, setRef, setTransitionHooks, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, toClassSet, toHandlers, toStyleMap, transformVNodeArgs, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.6.0-alpha.5",
3
+ "version": "3.6.0-alpha.6",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
- "@vue/shared": "3.6.0-alpha.5",
50
- "@vue/reactivity": "3.6.0-alpha.5"
49
+ "@vue/shared": "3.6.0-alpha.6",
50
+ "@vue/reactivity": "3.6.0-alpha.6"
51
51
  }
52
52
  }