@vue/server-renderer 3.6.0-rc.10 → 3.6.0-rc.12

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/server-renderer v3.6.0-rc.10
2
+ * @vue/server-renderer v3.6.0-rc.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -210,9 +210,10 @@ const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
210
210
  * - ismap -> isMap
211
211
  * - nomodule -> noModule
212
212
  * - novalidate -> noValidate
213
+ * - playsinline -> playsInline
213
214
  * - readonly -> readOnly
214
215
  */
215
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
216
+ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
216
217
  const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
217
218
  /**
218
219
  * The full list is needed during SSR to produce the correct initial markup.
@@ -941,17 +942,33 @@ const arrayInstrumentations = {
941
942
  };
942
943
  function iterator(self, method, wrapValue) {
943
944
  const arr = shallowReadArray(self);
944
- const iter = arr[method]();
945
+ const methodFn = arr[method];
946
+ const iter = methodFn.call(arr);
945
947
  if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
948
+ if (iter[Symbol.toStringTag] === "Array Iterator") {
949
+ const wrapped = Object.create(Object.getPrototypeOf(iter));
950
+ wrapped.next = () => wrapResult(iter.next(), wrapValue);
951
+ if (methodFn !== arrayProto[method]) Object.defineProperties(wrapped, {
952
+ return: { get() {
953
+ const fn = iter.return;
954
+ return typeof fn === "function" ? fn.bind(iter) : fn;
955
+ } },
956
+ throw: { get() {
957
+ const fn = iter.throw;
958
+ return typeof fn === "function" ? fn.bind(iter) : fn;
959
+ } }
960
+ });
961
+ return wrapped;
962
+ }
946
963
  iter._next = iter.next;
947
- iter.next = () => {
948
- const result = iter._next();
949
- if (!result.done) result.value = wrapValue(result.value);
950
- return result;
951
- };
964
+ iter.next = () => wrapResult(iter._next(), wrapValue);
952
965
  }
953
966
  return iter;
954
967
  }
968
+ function wrapResult(result, wrapValue) {
969
+ if (!result.done) result.value = wrapValue(result.value);
970
+ return result;
971
+ }
955
972
  const arrayProto = Array.prototype;
956
973
  function apply(self, method, fn, thisArg, wrappedRetFn, args) {
957
974
  const arr = shallowReadArray(self);
@@ -1269,6 +1286,7 @@ function createInstrumentationGetter(isReadonly, shallow) {
1269
1286
  return (target, key, receiver) => {
1270
1287
  if (key === "__v_isReactive") return !isReadonly;
1271
1288
  else if (key === "__v_isReadonly") return isReadonly;
1289
+ else if (key === "__v_isShallow") return shallow;
1272
1290
  else if (key === "__v_raw") return target;
1273
1291
  return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1274
1292
  };
@@ -1861,8 +1879,9 @@ let activeWatcher = void 0;
1861
1879
  function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
1862
1880
  if (owner) {
1863
1881
  const { call } = owner.options;
1864
- if (call) owner.cleanups[owner.cleanupsLength++] = () => call(cleanupFn, 4);
1865
- else owner.cleanups[owner.cleanupsLength++] = cleanupFn;
1882
+ const cleanup = call ? () => call(cleanupFn, 4) : cleanupFn;
1883
+ if (owner.cb) (owner.cbCleanups || (owner.cbCleanups = [])).push(cleanup);
1884
+ else owner.cleanups[owner.cleanupsLength++] = cleanup;
1866
1885
  } else if (!failSilently) warn$2("onWatcherCleanup() was called when there was no active watcher to associate with.");
1867
1886
  }
1868
1887
  var WatcherEffect = class extends ReactiveEffect {
@@ -1923,9 +1942,11 @@ var WatcherEffect = class extends ReactiveEffect {
1923
1942
  if (once && cb) {
1924
1943
  const _cb = cb;
1925
1944
  cb = (...args) => {
1926
- const res = _cb(...args);
1927
- this.stop();
1928
- return res;
1945
+ try {
1946
+ return _cb(...args);
1947
+ } finally {
1948
+ this.stop();
1949
+ }
1929
1950
  };
1930
1951
  }
1931
1952
  this.cb = cb;
@@ -1933,6 +1954,19 @@ var WatcherEffect = class extends ReactiveEffect {
1933
1954
  this.onTrack = options.onTrack;
1934
1955
  this.onTrigger = options.onTrigger;
1935
1956
  }
1957
+ cleanupCallback() {
1958
+ const cleanups = this.cbCleanups;
1959
+ if (cleanups) {
1960
+ this.cbCleanups = void 0;
1961
+ for (let i = 0, l = cleanups.length; i < l; i++) cleanups[i]();
1962
+ }
1963
+ }
1964
+ stop() {
1965
+ if (this.active) {
1966
+ super.stop();
1967
+ this.cleanupCallback();
1968
+ }
1969
+ }
1936
1970
  run(initialRun = false) {
1937
1971
  const oldValue = this.oldValue;
1938
1972
  const newValue = this.oldValue = super.run();
@@ -1940,10 +1974,11 @@ var WatcherEffect = class extends ReactiveEffect {
1940
1974
  const { immediate, deep, call } = this.options;
1941
1975
  if (initialRun && !immediate) return;
1942
1976
  if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
1943
- cleanup(this);
1944
1977
  const currentWatcher = activeWatcher;
1945
- activeWatcher = this;
1978
+ const prevSub = setActiveSub();
1946
1979
  try {
1980
+ this.cleanupCallback();
1981
+ activeWatcher = this;
1947
1982
  const args = [
1948
1983
  newValue,
1949
1984
  oldValue === INITIAL_WATCHER_VALUE ? void 0 : this.isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
@@ -1952,6 +1987,7 @@ var WatcherEffect = class extends ReactiveEffect {
1952
1987
  call ? call(this.cb, 3, args) : this.cb(...args);
1953
1988
  } finally {
1954
1989
  activeWatcher = currentWatcher;
1990
+ setActiveSub(prevSub);
1955
1991
  }
1956
1992
  }
1957
1993
  }
@@ -2244,15 +2280,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
2244
2280
  } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2245
2281
  queueFlush();
2246
2282
  }
2247
- function flushPreFlushCbs(instance, seen) {
2283
+ function flushPreFlushCbs(instance, minUid, seen) {
2248
2284
  seen = seen || /* @__PURE__ */ new Map();
2249
2285
  for (let i = flushIndex; i < jobsLength; i++) {
2250
2286
  const cb = jobs[i];
2251
2287
  if (cb.order & 1 || cb.order === Infinity) continue;
2252
- if (instance && cb.order !== instance.uid * 2) continue;
2288
+ if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
2253
2289
  if (checkRecursiveUpdates(seen, cb)) continue;
2254
2290
  jobs.splice(i, 1);
2255
- i--;
2291
+ i = instance ? i - 1 : flushIndex - 1;
2256
2292
  jobsLength--;
2257
2293
  if (cb.flags & 2) cb.flags &= -2;
2258
2294
  try {
@@ -2262,15 +2298,24 @@ function flushPreFlushCbs(instance, seen) {
2262
2298
  }
2263
2299
  }
2264
2300
  }
2265
- function flushPostFlushCbs(seen) {
2301
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
2266
2302
  if (postJobs.length) {
2303
+ let cbs = postJobs;
2304
+ if (skip) {
2305
+ cbs = [];
2306
+ let kept = 0;
2307
+ for (let i = 0; i < postJobs.length; i++) {
2308
+ const cb = postJobs[i];
2309
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
2310
+ else cbs.push(cb);
2311
+ }
2312
+ postJobs.length = kept;
2313
+ } else postJobs = [];
2267
2314
  if (activePostJobs) {
2268
- for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2269
- postJobs.length = 0;
2315
+ for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
2270
2316
  return;
2271
2317
  }
2272
- activePostJobs = postJobs;
2273
- postJobs = [];
2318
+ activePostJobs = cbs;
2274
2319
  seen = seen || /* @__PURE__ */ new Map();
2275
2320
  try {
2276
2321
  while (postFlushIndex < activePostJobs.length) {
@@ -2292,17 +2337,28 @@ function flushPostFlushCbs(seen) {
2292
2337
  }
2293
2338
  let isFlushing = false;
2294
2339
  /**
2340
+ * Run a root render, then flush the jobs it is responsible for. A mount or
2341
+ * unmount (`minUid` given) only flushes the jobs of the components it created
2342
+ * and the post cbs it queued, so pre watchers triggered in setup run before
2343
+ * mounted (#5721) while the jobs of other components stay in the queue and
2344
+ * keep their order (#6728). A root update keeps flushing all pending pre jobs
2345
+ * and post cbs, as the jobs of the components it re-renders may predate it.
2346
+ *
2295
2347
  * @internal
2296
2348
  */
2297
- function flushOnAppMount(instance) {
2298
- if (!isFlushing) {
2299
- isFlushing = true;
2300
- try {
2301
- flushPreFlushCbs(instance);
2302
- flushPostFlushCbs();
2303
- } finally {
2304
- isFlushing = false;
2305
- }
2349
+ function flushOnAppMount(fn, minUid) {
2350
+ if (isFlushing) {
2351
+ fn();
2352
+ return;
2353
+ }
2354
+ const queued = minUid === void 0 ? void 0 : new Set(postJobs);
2355
+ fn();
2356
+ isFlushing = true;
2357
+ try {
2358
+ flushPreFlushCbs(void 0, minUid);
2359
+ flushPostFlushCbs(void 0, queued, minUid);
2360
+ } finally {
2361
+ isFlushing = false;
2306
2362
  }
2307
2363
  }
2308
2364
  function flushJobs(seen) {
@@ -2703,7 +2759,7 @@ var RenderWatcherEffect = class extends WatcherEffect {
2703
2759
  this.flags |= 128;
2704
2760
  job.flags |= 2;
2705
2761
  }
2706
- if (instance) job.i = instance;
2762
+ job.i = instance;
2707
2763
  this.job = job;
2708
2764
  }
2709
2765
  notify() {
@@ -2823,9 +2879,23 @@ function setTransitionHooks(vnode, hooks) {
2823
2879
  const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
2824
2880
  const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
2825
2881
  return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
2826
- } else vnode.transition = hooks;
2882
+ } else {
2883
+ vnode.transition = hooks;
2884
+ if (vnode.type === Fragment && isArray(vnode.children)) {
2885
+ const child = filterSingleRoot(vnode.children, false);
2886
+ if (child) setTransitionHooks(child, hooks);
2887
+ }
2888
+ }
2827
2889
  return hooks;
2828
2890
  }
2891
+ function getTransitionRoot(vnode) {
2892
+ if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
2893
+ if (vnode.type === Fragment) {
2894
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
2895
+ return child ? getTransitionRoot(child) : void 0;
2896
+ }
2897
+ if (vnode.type !== Comment) return vnode;
2898
+ }
2829
2899
  //#endregion
2830
2900
  //#region packages/runtime-core/src/helpers/useId.ts
2831
2901
  /**
@@ -3048,6 +3118,65 @@ function invokeSlotFallback$1(fallback, owner) {
3048
3118
  setCurrentRenderingInstance$1(prev);
3049
3119
  }
3050
3120
  }
3121
+ /**
3122
+ * Compiler runtime helper for rendering `<slot/>`
3123
+ * @private
3124
+ */
3125
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
3126
+ if (props == null) props = {};
3127
+ let slot = slots[name];
3128
+ const vaporSlot = slot && slot[rawVaporSlotKey$2];
3129
+ if (vaporSlot) {
3130
+ const ret = (openBlock(), createBlock(VaporSlot$1, props));
3131
+ ret.vs = {
3132
+ slot: vaporSlot,
3133
+ outlets: fallback ? [{
3134
+ fallback,
3135
+ owner: currentRenderingInstance
3136
+ }] : void 0
3137
+ };
3138
+ if (branchKey != null && props.key == null) {
3139
+ ret.vs.props = ret.props;
3140
+ ret.props = extend({}, ret.props, { key: branchKey });
3141
+ ret.key = branchKey;
3142
+ }
3143
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
3144
+ return ret;
3145
+ }
3146
+ if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
3147
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
3148
+ const hasProps = Object.keys(slotProps).length > 0;
3149
+ if (name !== "default") slotProps.name = name;
3150
+ return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
3151
+ }
3152
+ if (slot && slot.length > 1) {
3153
+ warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
3154
+ slot = () => [];
3155
+ }
3156
+ if (slot && slot._c) slot._d = false;
3157
+ const prevStackSize = blockStack.length;
3158
+ openBlock();
3159
+ let rendered;
3160
+ try {
3161
+ const validSlotContent = slot && ensureValidVNode$1(slot(props));
3162
+ let attached = false;
3163
+ if (fallback && validSlotContent && currentRenderingInstance) {
3164
+ const interop = currentRenderingInstance.appContext.vapor;
3165
+ if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
3166
+ }
3167
+ const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
3168
+ rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
3169
+ if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
3170
+ if (attached) rendered.vo = true;
3171
+ } catch (err) {
3172
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3173
+ throw err;
3174
+ } finally {
3175
+ if (slot && slot._c) slot._d = true;
3176
+ }
3177
+ if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
3178
+ return rendered;
3179
+ }
3051
3180
  function ensureValidVNode$1(vnodes) {
3052
3181
  return vnodes.some((child) => {
3053
3182
  if (!isVNode$3(child)) return true;
@@ -3911,7 +4040,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3911
4040
  if (nextKeys.length !== Object.keys(prevProps).length) return true;
3912
4041
  for (let i = 0; i < nextKeys.length; i++) {
3913
4042
  const key = nextKeys[i];
3914
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
4043
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
3915
4044
  }
3916
4045
  return false;
3917
4046
  }
@@ -4591,7 +4720,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4591
4720
  for (let i = 0; i < newChildren.length; i++) {
4592
4721
  const oldVNode = oldChildren[i];
4593
4722
  const newVNode = newChildren[i];
4594
- const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
4723
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
4724
+ const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
4595
4725
  patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
4596
4726
  }
4597
4727
  };
@@ -4683,6 +4813,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4683
4813
  if (instance.asyncDep && !instance.asyncResolved) {
4684
4814
  pushWarningContext$1(n2);
4685
4815
  n2.el = n1.el;
4816
+ n2.placeholder = n1.placeholder;
4686
4817
  updateComponentPreRender(instance, n2, optimized);
4687
4818
  popWarningContext$1();
4688
4819
  return;
@@ -4692,6 +4823,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4692
4823
  }
4693
4824
  } else {
4694
4825
  n2.el = n1.el;
4826
+ n2.placeholder = n1.placeholder;
4695
4827
  instance.vnode = n2;
4696
4828
  }
4697
4829
  };
@@ -5036,12 +5168,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5036
5168
  };
5037
5169
  const remove = (vnode) => {
5038
5170
  const { type, el, anchor, transition } = vnode;
5039
- if (type === Fragment) {
5040
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) vnode.children.forEach((child) => {
5041
- if (child.type === Comment) hostRemove(child.el);
5042
- else remove(child);
5043
- });
5044
- else removeFragment(el, anchor);
5171
+ const isFragment = type === Fragment;
5172
+ if (isFragment && !transition) {
5173
+ removeFragment(el, anchor);
5045
5174
  return;
5046
5175
  }
5047
5176
  if (type === Static) {
@@ -5049,8 +5178,21 @@ function baseCreateRenderer(options, createHydrationFns) {
5049
5178
  if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
5050
5179
  return;
5051
5180
  }
5052
- if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
5053
- else hostRemove(el);
5181
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
5182
+ const performRemove = () => {
5183
+ if (isFragment) {
5184
+ if (hostParentNode(el)) removeFragment(el, anchor);
5185
+ } else hostRemove(el);
5186
+ };
5187
+ if (transition) {
5188
+ let leavingEl = leavingNode && leavingNode.el;
5189
+ let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
5190
+ if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
5191
+ leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
5192
+ isElement = !!leavingEl;
5193
+ }
5194
+ performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
5195
+ } else performRemove();
5054
5196
  };
5055
5197
  const removeFragment = (cur, end) => {
5056
5198
  let next;
@@ -5093,15 +5235,12 @@ function baseCreateRenderer(options, createHydrationFns) {
5093
5235
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
5094
5236
  };
5095
5237
  const render = (vnode, container, namespace) => {
5096
- let instance;
5097
- if (vnode == null) {
5098
- if (container._vnode) {
5099
- unmount(container._vnode, null, null, true);
5100
- instance = container._vnode.component;
5101
- }
5102
- } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
5103
- container._vnode = vnode;
5104
- flushOnAppMount(instance);
5238
+ flushOnAppMount(() => {
5239
+ if (vnode == null) {
5240
+ if (container._vnode) unmount(container._vnode, null, null, true);
5241
+ } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
5242
+ container._vnode = vnode;
5243
+ }, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
5105
5244
  };
5106
5245
  const internals = {
5107
5246
  p: patch,
@@ -5288,6 +5427,25 @@ const Static = Symbol.for("v-stc");
5288
5427
  const VaporSlot$1 = Symbol.for("v-vps");
5289
5428
  const blockStack = [];
5290
5429
  let currentBlock = null;
5430
+ /**
5431
+ * Open a block.
5432
+ * This must be called before `createBlock`. It cannot be part of `createBlock`
5433
+ * because the children of the block are evaluated before `createBlock` itself
5434
+ * is called. The generated code typically looks like this:
5435
+ *
5436
+ * ```js
5437
+ * function render() {
5438
+ * return (openBlock(),createBlock('div', null, [...]))
5439
+ * }
5440
+ * ```
5441
+ * disableTracking is true when creating a v-for fragment block, since a v-for
5442
+ * fragment always diffs its children.
5443
+ *
5444
+ * @private
5445
+ */
5446
+ function openBlock(disableTracking = false) {
5447
+ blockStack.push(currentBlock = disableTracking ? null : []);
5448
+ }
5291
5449
  function closeBlock() {
5292
5450
  blockStack.pop();
5293
5451
  currentBlock = blockStack[blockStack.length - 1] || null;
@@ -5313,6 +5471,22 @@ function setBlockTracking(value, inVOnce = false) {
5313
5471
  isBlockTreeEnabled += value;
5314
5472
  if (value < 0 && currentBlock && inVOnce) currentBlock.hasOnce = true;
5315
5473
  }
5474
+ function setupBlock(vnode) {
5475
+ vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
5476
+ closeBlock();
5477
+ if (isBlockTreeEnabled > 0 && currentBlock) currentBlock.push(vnode);
5478
+ return vnode;
5479
+ }
5480
+ /**
5481
+ * Create a block root vnode. Takes the same exact arguments as `createVNode`.
5482
+ * A block root keeps track of dynamic nodes within the block in the
5483
+ * `dynamicChildren` array.
5484
+ *
5485
+ * @private
5486
+ */
5487
+ function createBlock(type, props, children, patchFlag, dynamicProps) {
5488
+ return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true));
5489
+ }
5316
5490
  function isVNode$3(value) {
5317
5491
  return value ? value.__v_isVNode === true : false;
5318
5492
  }
@@ -5464,7 +5638,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
5464
5638
  ctx: vnode.ctx,
5465
5639
  ce: vnode.ce,
5466
5640
  vi: vnode.vi,
5467
- vs: cloneVaporSlotMeta(vnode),
5641
+ vs: cloneVaporSlotMeta(vnode, extraProps),
5468
5642
  vb: vnode.vb,
5469
5643
  ibu: vnode.ibu,
5470
5644
  iu: vnode.iu,
@@ -5473,13 +5647,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
5473
5647
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
5474
5648
  return cloned;
5475
5649
  }
5476
- function cloneVaporSlotMeta(vnode) {
5650
+ function cloneVaporSlotMeta(vnode, extraProps) {
5477
5651
  const vaporSlot = vnode.vs;
5478
5652
  if (!vaporSlot) return vaporSlot;
5479
5653
  const cloned = {
5480
5654
  slot: vaporSlot.slot,
5481
- outlets: vaporSlot.outlets
5655
+ outlets: vaporSlot.outlets,
5656
+ props: vaporSlot.props
5482
5657
  };
5658
+ if (vaporSlot.props && extraProps) {
5659
+ let extraSlotProps;
5660
+ for (const key in extraProps) if (key !== "key") {
5661
+ if (!extraSlotProps) extraSlotProps = {};
5662
+ extraSlotProps[key] = extraProps[key];
5663
+ }
5664
+ if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
5665
+ }
5483
5666
  if (vnode.el) {
5484
5667
  cloned.state = vaporSlot.state;
5485
5668
  cloned.ref = vaporSlot.ref;
@@ -5628,6 +5811,9 @@ const restoreCurrentInstance = (prev) => {
5628
5811
  //#region packages/runtime-core/src/component.ts
5629
5812
  const emptyAppContext = /*@__PURE__*/ createAppContext();
5630
5813
  let uid = 0;
5814
+ function getNextUid() {
5815
+ return uid;
5816
+ }
5631
5817
  function createComponentInstance$1(vnode, parent, suspense) {
5632
5818
  const type = vnode.type;
5633
5819
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -5904,7 +6090,7 @@ const computed = (getterOrOptions, debugOptions) => {
5904
6090
  };
5905
6091
  //#endregion
5906
6092
  //#region packages/runtime-core/src/index.ts
5907
- const version = "3.6.0-rc.10";
6093
+ const version = "3.6.0-rc.12";
5908
6094
  const warn = warn$1;
5909
6095
  /**
5910
6096
  * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
@@ -6075,7 +6261,7 @@ function patchStyle(el, prev, next) {
6075
6261
  else el.removeAttribute("style");
6076
6262
  }
6077
6263
  if (vShowOriginalDisplay in el) {
6078
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
6264
+ if (!isCssString || prev !== next) el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
6079
6265
  if (el[vShowHidden]) style.display = "none";
6080
6266
  }
6081
6267
  }
@@ -6938,9 +7124,17 @@ function findVaporSlot(children) {
6938
7124
  }
6939
7125
  function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
6940
7126
  const ctx = vnode.ctx;
6941
- if (vnode.shapeFlag & 32 && ctx && ctx.type.__vapor) {
6942
- const slots = vnode.children;
6943
- for (const name in slots) if (isFunction(slots[name])) slots[name][rawVaporSlotKey] = slots[name];
7127
+ const slots = vnode.children;
7128
+ if (vnode.shapeFlag & 32 && ctx && ctx.type.__vapor && slots._) {
7129
+ for (const name in slots) {
7130
+ const slot = slots[name];
7131
+ if (isFunction(slot) && !slot[rawVaporSlotKey]) {
7132
+ const wrapped = (props, push, parent, scopeId) => push ? slot(props, push, parent, scopeId) : [renderSlot({ [name]: slot }, name, props)];
7133
+ slot[rawVaporSlotKey] = wrapped[rawVaporSlotKey] = slot;
7134
+ wrapped._n = true;
7135
+ slots[name] = wrapped;
7136
+ }
7137
+ }
6944
7138
  if (!ctx.appContext.vapor) ctx.appContext.vapor = vaporInterface;
6945
7139
  }
6946
7140
  const instance = vnode.component = createComponentInstance(vnode, parentComponent, null);
@@ -6951,15 +7145,20 @@ function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
6951
7145
  popWarningContext();
6952
7146
  const hasAsyncSetup = isPromise(res);
6953
7147
  let prefetches = instance.sp;
6954
- if (hasAsyncSetup || prefetches) return Promise.resolve(res).then(() => {
7148
+ let p;
7149
+ if (hasAsyncSetup || prefetches) p = Promise.resolve(res).then(() => {
6955
7150
  if (hasAsyncSetup) prefetches = instance.sp;
6956
- if (prefetches) return Promise.all(prefetches.map((prefetch) => prefetch.call(instance.proxy)));
6957
- }).catch(NOOP).then(() => renderComponentSubTree(instance, slotScopeId));
7151
+ if (prefetches) try {
7152
+ return Promise.all(prefetches.map((prefetch) => prefetch.call(instance.proxy))).catch(NOOP);
7153
+ } catch {}
7154
+ }).then(() => renderComponentSubTree(instance, slotScopeId));
6958
7155
  else try {
6959
7156
  return renderComponentSubTree(instance, slotScopeId);
6960
7157
  } catch (err) {
6961
- return Promise.reject(err);
7158
+ p = Promise.reject(err);
6962
7159
  }
7160
+ p.catch(NOOP);
7161
+ return p;
6963
7162
  }
6964
7163
  function renderComponentSubTree(instance, slotScopeId) {
6965
7164
  pushWarningContext(instance.vnode);
@@ -7042,8 +7241,8 @@ function renderVNode(push, vnode, parentComponent, slotScopeId) {
7042
7241
  }
7043
7242
  case VaporSlot: {
7044
7243
  if (vnode.slotScopeIds) slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
7045
- const { slot, outlets } = vnode.vs;
7046
- renderVaporOutlet(push, slot, vnode.props, outlets && outlets[0], parentComponent, slotScopeId);
7244
+ const { slot, outlets, props } = vnode.vs;
7245
+ renderVaporOutlet(push, slot, props || vnode.props, outlets && outlets[0], parentComponent, slotScopeId);
7047
7246
  break;
7048
7247
  }
7049
7248
  default: if (shapeFlag & 1) renderElementVNode(push, vnode, parentComponent, slotScopeId);
@@ -7061,7 +7260,13 @@ function renderVaporOutlet(push, slot, props, outlet, parentComponent, slotScope
7061
7260
  function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
7062
7261
  for (let i = 0; i < children.length; i++) renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId);
7063
7262
  }
7064
- function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
7263
+ function renderDynamicComponent(push, type, props, slots, parentComponent, slotScopeId) {
7264
+ if (isString(type) && type) {
7265
+ const slot = slots && slots.default;
7266
+ renderElementVNode(push, createVNode(type, props), parentComponent, slotScopeId, slot && (() => slot(void 0, push, parentComponent, slotScopeId || "")));
7267
+ } else renderVNode(push, createVNode(type, props, slots), parentComponent, slotScopeId);
7268
+ }
7269
+ function renderElementVNode(push, vnode, parentComponent, slotScopeId, renderChildren) {
7065
7270
  const tag = vnode.type;
7066
7271
  let { props, children, shapeFlag, scopeId } = vnode;
7067
7272
  let openTag = `<${tag}`;
@@ -7089,19 +7294,20 @@ function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
7089
7294
  if (!isVoidTag(tag)) {
7090
7295
  let hasChildrenOverride = false;
7091
7296
  if (props) {
7092
- if (props.innerHTML) {
7297
+ if (props.innerHTML != null) {
7093
7298
  hasChildrenOverride = true;
7094
- push(props.innerHTML);
7095
- } else if (props.textContent) {
7299
+ push(String(props.innerHTML));
7300
+ } else if (props.textContent != null) {
7096
7301
  hasChildrenOverride = true;
7097
7302
  push(escapeHtml(props.textContent));
7098
- } else if (tag === "textarea" && props.value) {
7303
+ } else if (tag === "textarea" && props.value != null) {
7099
7304
  hasChildrenOverride = true;
7100
7305
  push(escapeHtml(props.value));
7101
7306
  }
7102
7307
  }
7103
7308
  if (!hasChildrenOverride) {
7104
- if (shapeFlag & 8) push(escapeHtml(children));
7309
+ if (renderChildren) renderChildren();
7310
+ else if (shapeFlag & 8) push(escapeHtml(children));
7105
7311
  else if (shapeFlag & 16) renderVNodeChildren(push, children, parentComponent, slotScopeId);
7106
7312
  }
7107
7313
  push(`</${tag}>`);
@@ -7176,13 +7382,41 @@ async function renderToString(input, context = {}) {
7176
7382
  const vnode = createVNode(input._component, input._props);
7177
7383
  vnode.appContext = input._context;
7178
7384
  input.provide(ssrContextKey, context);
7385
+ let buffer;
7386
+ let result;
7179
7387
  try {
7180
- const result = await unrollBuffer$1(await renderComponentVNode(vnode));
7388
+ buffer = await renderComponentVNode(vnode);
7389
+ result = await unrollBuffer$1(buffer);
7181
7390
  await resolveTeleports(context);
7182
- return result;
7183
- } finally {
7184
- cleanupContext(context);
7391
+ } catch (err) {
7392
+ cleanupFailedRender(buffer, context);
7393
+ throw err;
7185
7394
  }
7395
+ cleanupContext(context);
7396
+ return result;
7397
+ }
7398
+ /**
7399
+ * Stops watchers without masking the render error. Components after the
7400
+ * failure point are still in flight and can register watchers once the render
7401
+ * has settled, so those are stopped when they finish.
7402
+ * Cleanup errors here have already been reported by the watcher.
7403
+ */
7404
+ function cleanupFailedRender(buffer, context) {
7405
+ try {
7406
+ cleanupContext(context);
7407
+ } catch {}
7408
+ (async () => {
7409
+ if (buffer) await settleBuffer(buffer);
7410
+ for (const key in context.__teleportBuffers) await settleBuffer(context.__teleportBuffers[key]);
7411
+ cleanupContext(context);
7412
+ })().catch(NOOP);
7413
+ }
7414
+ async function settleBuffer(buffer) {
7415
+ if (!buffer.hasAsync) return;
7416
+ for (let item of buffer) try {
7417
+ if (isPromise(item)) item = await item;
7418
+ if (!isString(item)) await settleBuffer(item);
7419
+ } catch {}
7186
7420
  }
7187
7421
  async function resolveTeleports(context) {
7188
7422
  if (context.__teleportBuffers) {
@@ -7214,19 +7448,12 @@ function renderToSimpleStream(input, context, stream) {
7214
7448
  const vnode = createVNode(input._component, input._props);
7215
7449
  vnode.appContext = input._context;
7216
7450
  input.provide(ssrContextKey, context);
7217
- let cleaned = false;
7218
- const finalize = () => {
7219
- if (cleaned) return;
7220
- cleaned = true;
7451
+ let buffer;
7452
+ Promise.resolve().then(() => renderComponentVNode(vnode)).then((b) => unrollBuffer(buffer = b, stream)).then(() => resolveTeleports(context)).then(() => {
7221
7453
  cleanupContext(context);
7222
- };
7223
- Promise.resolve().then(() => renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => {
7224
- finalize();
7225
7454
  return stream.push(null);
7226
7455
  }).catch((error) => {
7227
- try {
7228
- finalize();
7229
- } catch {}
7456
+ cleanupFailedRender(buffer, context);
7230
7457
  stream.destroy(error);
7231
7458
  });
7232
7459
  return stream;
@@ -7297,4 +7524,4 @@ function pipeToWebWritable(input, context = {}, writable) {
7297
7524
  //#region packages/server-renderer/src/index.ts
7298
7525
  initDirectivesForSSR();
7299
7526
  //#endregion
7300
- export { pipeToNodeWritable, pipeToWebWritable, renderToNodeStream, renderToSimpleStream, renderToStream, renderToString, renderToWebStream, ssrGetDirectiveProps, ssrGetDynamicModelProps, includeBooleanAttr as ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderDynamicAttr, ssrRenderDynamicModel, ssrRenderList, ssrRenderSlot, ssrRenderSlotInner, ssrRenderStyle, ssrRenderSuspense, ssrRenderTeleport, renderVNode as ssrRenderVNode };
7527
+ export { pipeToNodeWritable, pipeToWebWritable, renderToNodeStream, renderToSimpleStream, renderToStream, renderToString, renderToWebStream, ssrGetDirectiveProps, ssrGetDynamicModelProps, includeBooleanAttr as ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderDynamicAttr, renderDynamicComponent as ssrRenderDynamicComponent, ssrRenderDynamicModel, ssrRenderList, ssrRenderSlot, ssrRenderSlotInner, ssrRenderStyle, ssrRenderSuspense, ssrRenderTeleport, renderVNode as ssrRenderVNode };