vue 3.6.0-rc.7 → 3.6.0-rc.9

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.7
2
+ * vue v3.6.0-rc.9
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.7
2
+ * vue v3.6.0-rc.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
package/dist/vue.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { CompilerOptions } from "@vue/compiler-dom";
2
2
  import { RenderFunction, defineAsyncComponent as defineVaporAsyncComponent$1 } from "@vue/runtime-dom";
3
- import { VaporSlot, defineVaporAsyncComponent, withAsyncContext } from "@vue/runtime-vapor";
3
+ import { VaporSlot, defineVaporAsyncComponent } from "@vue/runtime-vapor";
4
4
  export * from "@vue/runtime-dom";
5
5
  export * from "@vue/runtime-vapor";
6
6
  //#region temp/packages/vue/src/index.d.ts
7
7
  export declare function compileToFunction(template: string | HTMLElement, options?: CompilerOptions): RenderFunction;
8
8
  //#endregion
9
- export { type VaporSlot, compileToFunction as compile, defineVaporAsyncComponent, withAsyncContext };
9
+ export { type VaporSlot, compileToFunction as compile, defineVaporAsyncComponent };
package/dist/vue.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { CompilerOptions } from "@vue/compiler-dom";
2
2
  import { RenderFunction, defineAsyncComponent as defineVaporAsyncComponent$1 } from "@vue/runtime-dom";
3
- import { VaporSlot, defineVaporAsyncComponent, withAsyncContext } from "@vue/runtime-vapor";
3
+ import { VaporSlot, defineVaporAsyncComponent } from "@vue/runtime-vapor";
4
4
  export * from "@vue/runtime-dom";
5
5
  export * from "@vue/runtime-vapor";
6
6
  //#region temp/packages/vue/src/index.d.ts
7
7
  export declare function compileToFunction(template: string | HTMLElement, options?: CompilerOptions): RenderFunction;
8
8
  //#endregion
9
- export { type VaporSlot, compileToFunction as compile, defineVaporAsyncComponent, withAsyncContext };
9
+ export { type VaporSlot, compileToFunction as compile, defineVaporAsyncComponent };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-rc.7
2
+ * vue v3.6.0-rc.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -231,10 +231,10 @@ function normalizeStyle(value) {
231
231
  }
232
232
  const listDelimiterRE = /;(?![^(]*\))/g;
233
233
  const propertyDelimiterRE = /:([^]+)/;
234
- const styleCommentRE = /\/\*[^]*?\*\//g;
234
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
235
235
  function parseStringStyle(cssText) {
236
236
  const ret = {};
237
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
237
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
238
238
  if (item) {
239
239
  const tmp = item.split(propertyDelimiterRE);
240
240
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -362,19 +362,19 @@ function getEscapedCssVarName(key, doubleEscape) {
362
362
  }
363
363
  //#endregion
364
364
  //#region packages/shared/src/looseEqual.ts
365
- function looseCompareArrays(a, b) {
365
+ function looseCompareArrays(a, b, seen) {
366
366
  if (a.length !== b.length) return false;
367
367
  let equal = true;
368
- for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
368
+ for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
369
369
  return equal;
370
370
  }
371
- function looseCompareCollections(a, b) {
371
+ function looseCompareCollections(a, b, seen) {
372
372
  if (a.size !== b.size) return false;
373
373
  const candidates = Array.from(b);
374
374
  const matched = new Uint8Array(candidates.length);
375
375
  for (const item of a) {
376
376
  let index = -1;
377
- for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i])) {
377
+ for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
378
378
  index = i;
379
379
  break;
380
380
  }
@@ -383,7 +383,33 @@ function looseCompareCollections(a, b) {
383
383
  }
384
384
  return true;
385
385
  }
386
- function looseEqual(a, b) {
386
+ function looseCompareObjects(a, b, seen) {
387
+ let aValidType = isMap(a);
388
+ let bValidType = isMap(b);
389
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
390
+ aValidType = isSet(a);
391
+ bValidType = isSet(b);
392
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
393
+ if (Object.keys(a).length !== Object.keys(b).length) return false;
394
+ for (const key in a) {
395
+ const aHasKey = a.hasOwnProperty(key);
396
+ const bHasKey = b.hasOwnProperty(key);
397
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
398
+ }
399
+ return String(a) === String(b);
400
+ }
401
+ function looseCompareNested(a, b, seen, compare) {
402
+ if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
403
+ const [seenA, seenB] = seen;
404
+ if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
405
+ seenA.set(a, b);
406
+ seenB.set(b, a);
407
+ const equal = compare(a, b, seen);
408
+ seenA.delete(a);
409
+ seenB.delete(b);
410
+ return equal;
411
+ }
412
+ function looseEqual(a, b, seen) {
387
413
  if (a === b) return true;
388
414
  let aValidType = isDate(a);
389
415
  let bValidType = isDate(b);
@@ -393,23 +419,12 @@ function looseEqual(a, b) {
393
419
  if (aValidType || bValidType) return a === b;
394
420
  aValidType = isArray(a);
395
421
  bValidType = isArray(b);
396
- if (aValidType || bValidType) return aValidType && bValidType ? looseCompareArrays(a, b) : false;
422
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
397
423
  aValidType = isObject(a);
398
424
  bValidType = isObject(b);
399
425
  if (aValidType || bValidType) {
400
426
  if (!aValidType || !bValidType) return false;
401
- aValidType = isMap(a);
402
- bValidType = isMap(b);
403
- if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
404
- aValidType = isSet(a);
405
- bValidType = isSet(b);
406
- if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
407
- if (Object.keys(a).length !== Object.keys(b).length) return false;
408
- for (const key in a) {
409
- const aHasKey = a.hasOwnProperty(key);
410
- const bHasKey = b.hasOwnProperty(key);
411
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
412
- }
427
+ return looseCompareNested(a, b, seen, looseCompareObjects);
413
428
  }
414
429
  return String(a) === String(b);
415
430
  }
@@ -539,6 +554,8 @@ function setupFlagsHandler(target) {
539
554
  function warn$2(msg, ...args) {
540
555
  console.warn(`[Vue warn] ${msg}`, ...args);
541
556
  }
557
+ //#endregion
558
+ //#region packages/reactivity/src/system.ts
542
559
  const notifyBuffer = [];
543
560
  let batchDepth = 0;
544
561
  let activeSub = void 0;
@@ -865,13 +882,17 @@ function getDepFromReactive(object, key) {
865
882
  /**
866
883
  * Track array iteration and return:
867
884
  * - if input is reactive: a cloned raw array with reactive values
868
- * - if input is non-reactive or shallowReactive: the original raw array
885
+ * - if input is readonly: a cloned raw array with readonly values, preserving
886
+ * reactivity
887
+ * - if input is raw or shallow: the original raw array
869
888
  */
870
889
  function reactiveReadArray(array) {
871
890
  const raw = /* @__PURE__ */ toRaw(array);
872
891
  if (raw === array) return raw;
873
892
  track(raw, "iterate", ARRAY_ITERATE_KEY);
874
- return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
893
+ if (/* @__PURE__ */ isShallow(array)) return raw;
894
+ if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
895
+ return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
875
896
  }
876
897
  /**
877
898
  * Track array iteration and return raw array
@@ -4031,12 +4052,12 @@ function createHydrationFunctions(rendererInternals) {
4031
4052
  } else {
4032
4053
  mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
4033
4054
  const component = vnode.component;
4034
- if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep && !component.asyncResolved)) {
4055
+ if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
4035
4056
  let subTree;
4036
4057
  if (isFragmentStart) {
4037
4058
  subTree = createVNode(Static);
4038
4059
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4039
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4060
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
4040
4061
  subTree.el = node;
4041
4062
  component.subTree = subTree;
4042
4063
  }
@@ -5420,37 +5441,32 @@ function createPropsRestProxy(props, excludedKeys) {
5420
5441
  function withAsyncContext(getAwaitable) {
5421
5442
  const ctx = getCurrentGenericInstance();
5422
5443
  const inSSRSetup = isInSSRComponentSetup;
5423
- const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
5424
5444
  if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
5425
5445
  let awaitable = getAwaitable();
5426
5446
  setCurrentInstance(null, void 0);
5427
5447
  if (inSSRSetup) setInSSRSetupState(false);
5428
5448
  const restore = () => {
5429
- const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5449
+ const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5430
5450
  setCurrentInstance(ctx);
5431
5451
  if (inSSRSetup) setInSSRSetupState(true);
5432
- const reset = restoreAsyncContext && restoreAsyncContext();
5433
- return () => {
5434
- if (reset) reset();
5435
- if (resetStoppedScope) resetStoppedScope.reset();
5436
- };
5452
+ return stoppedScope;
5437
5453
  };
5438
5454
  const cleanup = () => {
5439
5455
  setCurrentInstance(null, void 0);
5440
5456
  if (inSSRSetup) setInSSRSetupState(false);
5441
5457
  };
5442
5458
  if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
5443
- const reset = restore();
5459
+ const stoppedScope = restore();
5444
5460
  Promise.resolve().then(() => Promise.resolve().then(() => {
5445
- if (reset) reset();
5461
+ if (stoppedScope) stoppedScope.reset();
5446
5462
  cleanup();
5447
5463
  }));
5448
5464
  throw e;
5449
5465
  });
5450
5466
  return [awaitable, () => {
5451
- const reset = restore();
5467
+ const stoppedScope = restore();
5452
5468
  Promise.resolve().then(() => {
5453
- if (reset) reset();
5469
+ if (stoppedScope) stoppedScope.reset();
5454
5470
  cleanup();
5455
5471
  });
5456
5472
  }];
@@ -6668,6 +6684,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6668
6684
  optimized = false;
6669
6685
  n2.dynamicChildren = null;
6670
6686
  }
6687
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
6688
+ if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
6689
+ n2.dynamicChildren.hasOnce = true;
6690
+ }
6671
6691
  const { type, ref, shapeFlag } = n2;
6672
6692
  switch (type) {
6673
6693
  case Text:
@@ -6984,6 +7004,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6984
7004
  if (shouldUpdateComponent(n1, n2, optimized)) {
6985
7005
  if (instance.asyncDep && !instance.asyncResolved) {
6986
7006
  pushWarningContext(n2);
7007
+ n2.el = n1.el;
6987
7008
  updateComponentPreRender(instance, n2, optimized);
6988
7009
  popWarningContext();
6989
7010
  return;
@@ -7292,13 +7313,13 @@ function baseCreateRenderer(options, createHydrationFns) {
7292
7313
  };
7293
7314
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
7294
7315
  const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
7295
- if (patchFlag === -2) optimized = false;
7316
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
7296
7317
  if (ref != null) {
7297
7318
  const prevSub = setActiveSub();
7298
7319
  setRef(ref, null, parentSuspense, vnode, true);
7299
7320
  setActiveSub(prevSub);
7300
7321
  }
7301
- if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
7322
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
7302
7323
  if (shapeFlag & 256) {
7303
7324
  if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
7304
7325
  else parentComponent.ctx.deactivate(vnode);
@@ -7352,6 +7373,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7352
7373
  }
7353
7374
  if (type === Static) {
7354
7375
  removeStaticNode(vnode);
7376
+ if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
7355
7377
  return;
7356
7378
  }
7357
7379
  if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
@@ -7376,7 +7398,10 @@ function baseCreateRenderer(options, createHydrationFns) {
7376
7398
  if (effect) {
7377
7399
  effect.stop();
7378
7400
  unmount(subTree, instance, parentSuspense, doRemove);
7379
- } else if (doRemove && subTree && instance.vnode.el) remove(subTree);
7401
+ } else if (instance.vnode.el && subTree) {
7402
+ subTree.transition = instance.vnode.transition;
7403
+ unmount(subTree, instance, parentSuspense, doRemove);
7404
+ }
7380
7405
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
7381
7406
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
7382
7407
  devtoolsComponentRemoved(instance);
@@ -7582,7 +7607,7 @@ const Suspense = {
7582
7607
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
7583
7608
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
7584
7609
  else {
7585
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
7610
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
7586
7611
  n2.suspense = n1.suspense;
7587
7612
  n2.suspense.vnode = n2;
7588
7613
  n2.el = n1.el;
@@ -7620,7 +7645,9 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7620
7645
  if (pendingBranch) {
7621
7646
  suspense.pendingBranch = newBranch;
7622
7647
  if (isSameVNodeType(pendingBranch, newBranch)) {
7623
- patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
7648
+ suspense.deps++;
7649
+ patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
7650
+ suspense.deps--;
7624
7651
  if (suspense.deps <= 0) suspense.resolve();
7625
7652
  else if (isInFallback) {
7626
7653
  if (!isHydrating && !suspense.isFallbackMountPending) {
@@ -7756,6 +7783,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7756
7783
  suspense.effects = [];
7757
7784
  if (isSuspensible) {
7758
7785
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
7786
+ parentSuspenseId = void 0;
7759
7787
  parentSuspense.deps--;
7760
7788
  if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
7761
7789
  }
@@ -7793,11 +7821,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7793
7821
  registerDep(instance, onResolve) {
7794
7822
  const isInPendingSuspense = !!suspense.pendingBranch;
7795
7823
  if (isInPendingSuspense) suspense.deps++;
7824
+ const hydratedEl = instance.vnode && instance.vnode.el;
7796
7825
  instance.asyncDep.catch((err) => {
7797
7826
  handleError(err, instance, 0);
7798
7827
  }).then((asyncSetupResult) => {
7799
7828
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
7800
7829
  setCurrentInstance(null, void 0);
7830
+ if (hydratedEl && !instance.scope.active) {
7831
+ if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
7832
+ return;
7833
+ }
7801
7834
  instance.asyncResolved = true;
7802
7835
  onResolve(asyncSetupResult);
7803
7836
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -8110,7 +8143,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
8110
8143
  vs: cloneVaporSlotMeta(vnode),
8111
8144
  vb: vnode.vb,
8112
8145
  ibu: vnode.ibu,
8113
- iu: vnode.iu
8146
+ iu: vnode.iu,
8147
+ cacheIndex: vnode.cacheIndex
8114
8148
  };
8115
8149
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
8116
8150
  return cloned;
@@ -8810,7 +8844,7 @@ function isMemoSame(cached, memo) {
8810
8844
  }
8811
8845
  //#endregion
8812
8846
  //#region packages/runtime-core/src/index.ts
8813
- const version = "3.6.0-rc.7";
8847
+ const version = "3.6.0-rc.9";
8814
8848
  const warn = warn$1;
8815
8849
  /**
8816
8850
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9183,49 +9217,20 @@ const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT");
9183
9217
  */
9184
9218
  function useCssVars(getter) {
9185
9219
  const instance = getCurrentInstance();
9186
- const getVars = () => getter(instance.proxy);
9187
- const setVars = (vars) => {
9188
- if (instance.ce) setVarsOnNode(instance.ce, vars);
9189
- else setVarsOnVNode(instance.subTree, vars);
9190
- };
9191
- baseUseCssVars(instance, () => instance.subTree.el.parentNode, getVars, setVars);
9192
- }
9193
- function setVarsOnVNode(vnode, vars) {
9194
- if (vnode.shapeFlag & 128) {
9195
- const suspense = vnode.suspense;
9196
- vnode = suspense.activeBranch;
9197
- if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
9198
- setVarsOnVNode(suspense.activeBranch, vars);
9199
- });
9200
- }
9201
- while (vnode.component) vnode = vnode.component.subTree;
9202
- if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
9203
- else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
9204
- else if (vnode.type === Static) {
9205
- let { el, anchor } = vnode;
9206
- while (el) {
9207
- setVarsOnNode(el, vars);
9208
- if (el === anchor) break;
9209
- el = el.nextSibling;
9210
- }
9211
- }
9212
- }
9213
- /**
9214
- * @internal
9215
- * shared between vdom and vapor
9216
- */
9217
- function baseUseCssVars(instance, getParentNode, getVars, setVars) {
9218
9220
  /* v8 ignore start */
9219
9221
  if (!instance) {
9220
9222
  warn(`useCssVars is called without current active component instance.`);
9221
9223
  return;
9222
9224
  }
9225
+ /* v8 ignore stop */
9226
+ const getVars = () => getter(instance.proxy);
9223
9227
  instance.getCssVars = getVars;
9224
9228
  const updateTeleports = instance.ut = (vars = getVars()) => {
9225
9229
  Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach((node) => setVarsOnNode(node, vars));
9226
9230
  };
9227
9231
  const applyCssVars = (vars = getVars()) => {
9228
- setVars(vars);
9232
+ if (instance.ce) setVarsOnNode(instance.ce, vars);
9233
+ else setVarsOnVNode(instance.subTree, vars);
9229
9234
  updateTeleports(vars);
9230
9235
  };
9231
9236
  onBeforeUpdate(() => {
@@ -9238,10 +9243,37 @@ function baseUseCssVars(instance, getParentNode, getVars, setVars) {
9238
9243
  applyCssVars(vars);
9239
9244
  }, NOOP, { flush: "post" });
9240
9245
  const ob = new MutationObserver(() => applyCssVars());
9241
- ob.observe(getParentNode(), { childList: true });
9246
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
9242
9247
  onUnmounted(() => ob.disconnect());
9243
9248
  });
9244
9249
  }
9250
+ function setVarsOnVNode(vnode, vars) {
9251
+ if (vnode.shapeFlag & 128) {
9252
+ const suspense = vnode.suspense;
9253
+ vnode = suspense.activeBranch;
9254
+ if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
9255
+ setVarsOnVNode(suspense.activeBranch, vars);
9256
+ });
9257
+ }
9258
+ while (vnode.component) {
9259
+ const component = vnode.component;
9260
+ if (component.vapor) {
9261
+ component.appContext.vapor.applyCssVars(vnode, vars);
9262
+ return;
9263
+ }
9264
+ vnode = vnode.component.subTree;
9265
+ }
9266
+ if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
9267
+ else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
9268
+ else if (vnode.type === Static) {
9269
+ let { el, anchor } = vnode;
9270
+ while (el) {
9271
+ setVarsOnNode(el, vars);
9272
+ if (el === anchor) break;
9273
+ el = el.nextSibling;
9274
+ }
9275
+ }
9276
+ }
9245
9277
  /**
9246
9278
  * @internal
9247
9279
  * shared between vdom and vapor