vue 3.2.34 → 3.2.37

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.
@@ -4370,7 +4370,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
4370
4370
  const Component = instance.type;
4371
4371
  // explicit self name has highest priority
4372
4372
  if (type === COMPONENTS) {
4373
- const selfName = getComponentName(Component);
4373
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
4374
4374
  if (selfName &&
4375
4375
  (selfName === name ||
4376
4376
  selfName === camelize(name) ||
@@ -6041,7 +6041,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6041
6041
  setupState[ref] = value;
6042
6042
  }
6043
6043
  }
6044
- else if (isRef(ref)) {
6044
+ else if (_isRef) {
6045
6045
  ref.value = value;
6046
6046
  if (rawRef.k)
6047
6047
  refs[rawRef.k] = value;
@@ -6080,11 +6080,13 @@ function createHydrationFunctions(rendererInternals) {
6080
6080
  `Performing full mount instead.`);
6081
6081
  patch(null, vnode, container);
6082
6082
  flushPostFlushCbs();
6083
+ container._vnode = vnode;
6083
6084
  return;
6084
6085
  }
6085
6086
  hasMismatch = false;
6086
6087
  hydrateNode(container.firstChild, vnode, null, null, null);
6087
6088
  flushPostFlushCbs();
6089
+ container._vnode = vnode;
6088
6090
  if (hasMismatch && !false) {
6089
6091
  // this error should show up in production
6090
6092
  console.error(`Hydration completed but contains mismatches.`);
@@ -6107,7 +6109,7 @@ function createHydrationFunctions(rendererInternals) {
6107
6109
  // #5728 empty text node inside a slot can cause hydration failure
6108
6110
  // because the server rendered HTML won't contain a text node
6109
6111
  if (vnode.children === '') {
6110
- insert((vnode.el = createText('')), node.parentElement, node);
6112
+ insert((vnode.el = createText('')), parentNode(node), node);
6111
6113
  nextNode = node;
6112
6114
  }
6113
6115
  else {
@@ -6134,7 +6136,7 @@ function createHydrationFunctions(rendererInternals) {
6134
6136
  }
6135
6137
  break;
6136
6138
  case Static:
6137
- if (domType !== 1 /* ELEMENT */) {
6139
+ if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
6138
6140
  nextNode = onMismatch();
6139
6141
  }
6140
6142
  else {
@@ -6145,7 +6147,10 @@ function createHydrationFunctions(rendererInternals) {
6145
6147
  const needToAdoptContent = !vnode.children.length;
6146
6148
  for (let i = 0; i < vnode.staticCount; i++) {
6147
6149
  if (needToAdoptContent)
6148
- vnode.children += nextNode.outerHTML;
6150
+ vnode.children +=
6151
+ nextNode.nodeType === 1 /* ELEMENT */
6152
+ ? nextNode.outerHTML
6153
+ : nextNode.data;
6149
6154
  if (i === vnode.staticCount - 1) {
6150
6155
  vnode.anchor = nextNode;
6151
6156
  }
@@ -8818,10 +8823,10 @@ function getExposeProxy(instance) {
8818
8823
  }
8819
8824
  const classifyRE = /(?:^|[-_])(\w)/g;
8820
8825
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
8821
- function getComponentName(Component) {
8826
+ function getComponentName(Component, includeInferred = true) {
8822
8827
  return isFunction(Component)
8823
8828
  ? Component.displayName || Component.name
8824
- : Component.name;
8829
+ : Component.name || (includeInferred && Component.__name);
8825
8830
  }
8826
8831
  /* istanbul ignore next */
8827
8832
  function formatComponentName(instance, Component, isRoot = false) {
@@ -9265,9 +9270,9 @@ function isMemoSame(cached, memo) {
9265
9270
  }
9266
9271
 
9267
9272
  // Core API ------------------------------------------------------------------
9268
- const version = "3.2.34";
9273
+ const version = "3.2.37";
9269
9274
  /**
9270
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
9275
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
9271
9276
  * @internal
9272
9277
  */
9273
9278
  const ssrUtils = (null);
@@ -9576,7 +9581,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
9576
9581
  // if the low-res timestamp which is bigger than the event timestamp
9577
9582
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
9578
9583
  // and we need to use the hi-res version for event listeners as well.
9579
- _getNow = () => performance.now();
9584
+ _getNow = performance.now.bind(performance);
9580
9585
  }
9581
9586
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
9582
9587
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -10106,9 +10111,8 @@ function resolveTransitionProps(rawProps) {
10106
10111
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
10107
10112
  done && done();
10108
10113
  };
10109
- let isLeaving = false;
10110
10114
  const finishLeave = (el, done) => {
10111
- isLeaving = false;
10115
+ el._isLeaving = false;
10112
10116
  removeTransitionClass(el, leaveFromClass);
10113
10117
  removeTransitionClass(el, leaveToClass);
10114
10118
  removeTransitionClass(el, leaveActiveClass);
@@ -10142,14 +10146,14 @@ function resolveTransitionProps(rawProps) {
10142
10146
  onEnter: makeEnterHook(false),
10143
10147
  onAppear: makeEnterHook(true),
10144
10148
  onLeave(el, done) {
10145
- isLeaving = true;
10149
+ el._isLeaving = true;
10146
10150
  const resolve = () => finishLeave(el, done);
10147
10151
  addTransitionClass(el, leaveFromClass);
10148
10152
  // force reflow so *-leave-from classes immediately take effect (#2593)
10149
10153
  forceReflow();
10150
10154
  addTransitionClass(el, leaveActiveClass);
10151
10155
  nextFrame(() => {
10152
- if (!isLeaving) {
10156
+ if (!el._isLeaving) {
10153
10157
  // cancelled
10154
10158
  return;
10155
10159
  }
@@ -12704,6 +12708,14 @@ function getConstantType(node, context) {
12704
12708
  // static then they don't need to be blocks since there will be no
12705
12709
  // nested updates.
12706
12710
  if (codegenNode.isBlock) {
12711
+ // except set custom directives.
12712
+ for (let i = 0; i < node.props.length; i++) {
12713
+ const p = node.props[i];
12714
+ if (p.type === 7 /* DIRECTIVE */) {
12715
+ constantCache.set(node, 0 /* NOT_CONSTANT */);
12716
+ return 0 /* NOT_CONSTANT */;
12717
+ }
12718
+ }
12707
12719
  context.removeHelper(OPEN_BLOCK);
12708
12720
  context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
12709
12721
  codegenNode.isBlock = false;