@vue/server-renderer 3.6.0-rc.14 → 3.6.0-rc.15

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.14
2
+ * @vue/server-renderer v3.6.0-rc.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -332,7 +332,15 @@ function ssrCompile(template, instance) {
332
332
  }
333
333
  //#endregion
334
334
  //#region packages/server-renderer/src/render.ts
335
- const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, isVNode: isVNode$2, normalizeVNode, pushWarningContext, popWarningContext, VaporSlot, rawVaporSlotKey, invokeSlotFallback } = _vue_runtime_dom.ssrUtils;
335
+ const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, isVNode: isVNode$2, normalizeVNode, pushWarningContext, popWarningContext, VaporSlot, rawVaporSlotKey, invokeSlotFallback, setDeferElementSlots } = _vue_runtime_dom.ssrUtils;
336
+ function renderRoot(instance) {
337
+ const prev = setDeferElementSlots(true);
338
+ try {
339
+ return renderComponentRoot(instance);
340
+ } finally {
341
+ setDeferElementSlots(prev);
342
+ }
343
+ }
336
344
  function cleanupContext(context) {
337
345
  let firstError;
338
346
  if (context.__watcherHandles) {
@@ -446,7 +454,7 @@ function renderComponentSubTree(instance, slotScopeId) {
446
454
  const comp = instance.type;
447
455
  const { getBuffer, push } = createBuffer();
448
456
  if ((0, _vue_shared.isFunction)(comp)) {
449
- let root = renderComponentRoot(instance);
457
+ let root = renderRoot(instance);
450
458
  if (!comp.props) {
451
459
  for (const key in instance.attrs) if (key.startsWith(`data-v-`)) (root.props || (root.props = {}))[key] = ``;
452
460
  }
@@ -484,7 +492,7 @@ function renderComponentSubTree(instance, slotScopeId) {
484
492
  } finally {
485
493
  setCurrentRenderingInstance(prev);
486
494
  }
487
- } else if (instance.render && instance.render !== _vue_shared.NOOP) renderVNode(push, instance.subTree = renderComponentRoot(instance), instance, slotScopeId);
495
+ } else if (instance.render && instance.render !== _vue_shared.NOOP) renderVNode(push, instance.subTree = renderRoot(instance), instance, slotScopeId);
488
496
  else {
489
497
  const componentName = comp.name || comp.__file || `<Anonymous>`;
490
498
  (0, _vue_runtime_dom.warn)(`Component ${componentName} is missing template or render function.`);
@@ -590,10 +598,21 @@ function renderElementVNode(push, vnode, parentComponent, slotScopeId, renderChi
590
598
  if (renderChildren) renderChildren();
591
599
  else if (shapeFlag & 8) push((0, _vue_shared.escapeHtml)(children));
592
600
  else if (shapeFlag & 16) renderVNodeChildren(push, children, parentComponent, slotScopeId);
601
+ else if (shapeFlag & 32) renderElementSlot(push, children.default, parentComponent, slotScopeId);
593
602
  }
594
603
  push(`</${tag}>`);
595
604
  }
596
605
  }
606
+ function renderElementSlot(push, slot, parentComponent, slotScopeId) {
607
+ let ret;
608
+ try {
609
+ ret = slot(void 0, push, parentComponent, slotScopeId ? " " + slotScopeId.trim() : "");
610
+ } catch (err) {
611
+ (0, _vue_runtime_dom.handleError)(err, parentComponent, 1);
612
+ }
613
+ if ((0, _vue_shared.isArray)(ret)) renderVNodeChildren(push, ret, parentComponent, slotScopeId);
614
+ else if (ret != null) renderVNode(push, normalizeVNode(ret), parentComponent, slotScopeId);
615
+ }
597
616
  function applySSRDirectives(vnode, rawProps, dirs) {
598
617
  const toMerge = [];
599
618
  for (let i = 0; i < dirs.length; i++) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/server-renderer v3.6.0-rc.14
2
+ * @vue/server-renderer v3.6.0-rc.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -325,7 +325,15 @@ function ssrCompile(template, instance) {
325
325
  }
326
326
  //#endregion
327
327
  //#region packages/server-renderer/src/render.ts
328
- const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, isVNode: isVNode$2, normalizeVNode, pushWarningContext, popWarningContext, VaporSlot, rawVaporSlotKey, invokeSlotFallback } = _vue_runtime_dom.ssrUtils;
328
+ const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, isVNode: isVNode$2, normalizeVNode, pushWarningContext, popWarningContext, VaporSlot, rawVaporSlotKey, invokeSlotFallback, setDeferElementSlots } = _vue_runtime_dom.ssrUtils;
329
+ function renderRoot(instance) {
330
+ const prev = setDeferElementSlots(true);
331
+ try {
332
+ return renderComponentRoot(instance);
333
+ } finally {
334
+ setDeferElementSlots(prev);
335
+ }
336
+ }
329
337
  function cleanupContext(context) {
330
338
  let firstError;
331
339
  if (context.__watcherHandles) {
@@ -436,7 +444,7 @@ function renderComponentSubTree(instance, slotScopeId) {
436
444
  const comp = instance.type;
437
445
  const { getBuffer, push } = createBuffer();
438
446
  if ((0, _vue_shared.isFunction)(comp)) {
439
- let root = renderComponentRoot(instance);
447
+ let root = renderRoot(instance);
440
448
  if (!comp.props) {
441
449
  for (const key in instance.attrs) if (key.startsWith(`data-v-`)) (root.props || (root.props = {}))[key] = ``;
442
450
  }
@@ -474,7 +482,7 @@ function renderComponentSubTree(instance, slotScopeId) {
474
482
  } finally {
475
483
  setCurrentRenderingInstance(prev);
476
484
  }
477
- } else if (instance.render && instance.render !== _vue_shared.NOOP) renderVNode(push, instance.subTree = renderComponentRoot(instance), instance, slotScopeId);
485
+ } else if (instance.render && instance.render !== _vue_shared.NOOP) renderVNode(push, instance.subTree = renderRoot(instance), instance, slotScopeId);
478
486
  else {
479
487
  const componentName = comp.name || comp.__file || `<Anonymous>`;
480
488
  (0, _vue_runtime_dom.warn)(`Component ${componentName} is missing template or render function.`);
@@ -579,10 +587,21 @@ function renderElementVNode(push, vnode, parentComponent, slotScopeId, renderChi
579
587
  if (renderChildren) renderChildren();
580
588
  else if (shapeFlag & 8) push((0, _vue_shared.escapeHtml)(children));
581
589
  else if (shapeFlag & 16) renderVNodeChildren(push, children, parentComponent, slotScopeId);
590
+ else if (shapeFlag & 32) renderElementSlot(push, children.default, parentComponent, slotScopeId);
582
591
  }
583
592
  push(`</${tag}>`);
584
593
  }
585
594
  }
595
+ function renderElementSlot(push, slot, parentComponent, slotScopeId) {
596
+ let ret;
597
+ try {
598
+ ret = slot(void 0, push, parentComponent, slotScopeId ? " " + slotScopeId.trim() : "");
599
+ } catch (err) {
600
+ (0, _vue_runtime_dom.handleError)(err, parentComponent, 1);
601
+ }
602
+ if ((0, _vue_shared.isArray)(ret)) renderVNodeChildren(push, ret, parentComponent, slotScopeId);
603
+ else if (ret != null) renderVNode(push, normalizeVNode(ret), parentComponent, slotScopeId);
604
+ }
586
605
  function applySSRDirectives(vnode, rawProps, dirs) {
587
606
  const toMerge = [];
588
607
  for (let i = 0; i < dirs.length; i++) {