vue 3.6.0-rc.1 → 3.6.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-rc.1
2
+ * vue v3.6.0-rc.2
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 v3.6.0-rc.1
2
+ * vue v3.6.0-rc.2
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 v3.6.0-rc.1
2
+ * vue v3.6.0-rc.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -3161,7 +3161,7 @@ function instanceWatch(source, value, options) {
3161
3161
  }
3162
3162
  const prev = setCurrentInstance(this);
3163
3163
  const res = doWatch(getter, cb.bind(publicThis), options);
3164
- setCurrentInstance(...prev);
3164
+ restoreCurrentInstance(prev);
3165
3165
  return res;
3166
3166
  }
3167
3167
  function createPathGetter(ctx, path) {
@@ -3619,12 +3619,11 @@ function getInnerChild$1(vnode) {
3619
3619
  }
3620
3620
  }
3621
3621
  function setTransitionHooks(vnode, hooks) {
3622
- if (vnode.shapeFlag & 6 && vnode.component) if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3623
- else {
3622
+ if (vnode.shapeFlag & 6 && vnode.component) {
3624
3623
  vnode.transition = hooks;
3625
- setTransitionHooks(vnode.component.subTree, hooks);
3626
- }
3627
- else if (vnode.shapeFlag & 128) {
3624
+ if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3625
+ else setTransitionHooks(vnode.component.subTree, hooks);
3626
+ } else if (vnode.shapeFlag & 128) {
3628
3627
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3629
3628
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3630
3629
  } else vnode.transition = hooks;
@@ -4687,7 +4686,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
4687
4686
  try {
4688
4687
  return callWithAsyncErrorHandling(hook, target, type, args);
4689
4688
  } finally {
4690
- setCurrentInstance(...prev);
4689
+ restoreCurrentInstance(prev);
4691
4690
  setActiveSub(prevSub);
4692
4691
  }
4693
4692
  });
@@ -6132,7 +6131,7 @@ function baseResolveDefault(factory, instance, key) {
6132
6131
  const prev = setCurrentInstance(instance);
6133
6132
  const props = /* @__PURE__ */ toRaw(instance.props);
6134
6133
  value = factory.call(null, props);
6135
- setCurrentInstance(...prev);
6134
+ restoreCurrentInstance(prev);
6136
6135
  return value;
6137
6136
  }
6138
6137
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
@@ -6692,7 +6691,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6692
6691
  };
6693
6692
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6694
6693
  n2.slotScopeIds = slotScopeIds;
6695
- if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
6694
+ if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
6696
6695
  else {
6697
6696
  const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
6698
6697
  getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
@@ -7035,7 +7034,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7035
7034
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
7036
7035
  const { el, type, transition, children, shapeFlag } = vnode;
7037
7036
  if (isVaporComponent(type) || type === VaporSlot) {
7038
- getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
7037
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
7039
7038
  return;
7040
7039
  }
7041
7040
  if (shapeFlag & 6) {
@@ -7091,7 +7090,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7091
7090
  }
7092
7091
  if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
7093
7092
  if (shapeFlag & 256) {
7094
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
7093
+ if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
7095
7094
  else parentComponent.ctx.deactivate(vnode);
7096
7095
  return;
7097
7096
  }
@@ -7101,7 +7100,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7101
7100
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
7102
7101
  if (shapeFlag & 6) if (isVaporComponent(type)) {
7103
7102
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
7104
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
7103
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
7105
7104
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
7106
7105
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
7107
7106
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -7118,7 +7117,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7118
7117
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
7119
7118
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
7120
7119
  if (type === VaporSlot) {
7121
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
7120
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
7122
7121
  return;
7123
7122
  }
7124
7123
  if (doRemove) remove(vnode);
@@ -8016,6 +8015,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
8016
8015
  simpleSetCurrentInstance(instance);
8017
8016
  }
8018
8017
  };
8018
+ /**
8019
+ * Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
8020
+ * `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
8021
+ * verbatim instead of re-triggering the `instance.scope` default.
8022
+ * @internal
8023
+ */
8024
+ const restoreCurrentInstance = (prev) => {
8025
+ setCurrentScope(prev[1]);
8026
+ simpleSetCurrentInstance(prev[0]);
8027
+ };
8019
8028
  const internalOptions = [
8020
8029
  "ce",
8021
8030
  "type",
@@ -8167,7 +8176,7 @@ function setupStatefulComponent(instance, isSSR) {
8167
8176
  const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
8168
8177
  const isAsyncSetup = isPromise(setupResult);
8169
8178
  setActiveSub(prevSub);
8170
- setCurrentInstance(...prev);
8179
+ restoreCurrentInstance(prev);
8171
8180
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
8172
8181
  if (isAsyncSetup) {
8173
8182
  const unsetCurrentInstance = () => {
@@ -8236,7 +8245,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8236
8245
  applyOptions(instance);
8237
8246
  } finally {
8238
8247
  setActiveSub(prevSub);
8239
- setCurrentInstance(...prevInstance);
8248
+ restoreCurrentInstance(prevInstance);
8240
8249
  }
8241
8250
  }
8242
8251
  if (!Component.render && instance.render === NOOP && !isSSR) if (!compile$1 && Component.template)
@@ -8546,7 +8555,7 @@ function isMemoSame(cached, memo) {
8546
8555
  }
8547
8556
  //#endregion
8548
8557
  //#region packages/runtime-core/src/index.ts
8549
- const version = "3.6.0-rc.1";
8558
+ const version = "3.6.0-rc.2";
8550
8559
  const warn = warn$1;
8551
8560
  /**
8552
8561
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -12288,7 +12297,7 @@ function getSelfName(filename) {
12288
12297
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
12289
12298
  return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
12290
12299
  }
12291
- function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
12300
+ function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
12292
12301
  const context = {
12293
12302
  filename,
12294
12303
  selfName: getSelfName(filename),
@@ -12310,7 +12319,6 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
12310
12319
  bindingMetadata,
12311
12320
  inline,
12312
12321
  isTS,
12313
- eventDelegation,
12314
12322
  onError,
12315
12323
  onWarn,
12316
12324
  compatConfig,
@@ -14095,6 +14103,14 @@ const resolveModifiers = (key, modifiers, context, loc) => {
14095
14103
  const eventOptionModifiers = [];
14096
14104
  for (let i = 0; i < modifiers.length; i++) {
14097
14105
  const modifier = modifiers[i].content;
14106
+ if (modifier === "delegate") {
14107
+ if (context) {
14108
+ const error = /* @__PURE__ */ new SyntaxError(`.delegate modifier is only supported in Vapor components.`);
14109
+ error.loc = modifiers[i].loc;
14110
+ context.onWarn(error);
14111
+ }
14112
+ continue;
14113
+ }
14098
14114
  if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
14099
14115
  else {
14100
14116
  const keyString = isString(key) ? key : isStaticExp(key) ? key.content : null;