@vue/server-renderer 3.4.27 → 3.4.29

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.4.27
2
+ * @vue/server-renderer v3.4.29
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -148,13 +148,11 @@ function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push,
148
148
  fallbackRenderFn();
149
149
  }
150
150
  }
151
- const commentTestRE = /^<!--.*-->$/s;
151
+ const commentTestRE = /^<!--[\s\S]*-->$/;
152
152
  const commentRE = /<!--[^]*?-->/gm;
153
153
  function isComment(item) {
154
- if (typeof item !== "string" || !commentTestRE.test(item))
155
- return false;
156
- if (item.length <= 8)
157
- return true;
154
+ if (typeof item !== "string" || !commentTestRE.test(item)) return false;
155
+ if (item.length <= 8) return true;
158
156
  return !item.replace(commentRE, "").trim();
159
157
  }
160
158
 
@@ -208,6 +206,7 @@ function warn$1(msg, ...args) {
208
206
  instance,
209
207
  11,
210
208
  [
209
+ // eslint-disable-next-line no-restricted-syntax
211
210
  msg + args.map((a) => {
212
211
  var _a, _b;
213
212
  return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
@@ -387,14 +386,11 @@ function logError(err, type, contextVNode, throwInDev = true) {
387
386
  const g = shared.getGlobalThis();
388
387
  const registerGlobalSetter = (key, setter) => {
389
388
  let setters;
390
- if (!(setters = g[key]))
391
- setters = g[key] = [];
389
+ if (!(setters = g[key])) setters = g[key] = [];
392
390
  setters.push(setter);
393
391
  return (v) => {
394
- if (setters.length > 1)
395
- setters.forEach((set) => set(v));
396
- else
397
- setters[0](v);
392
+ if (setters.length > 1) setters.forEach((set) => set(v));
393
+ else setters[0](v);
398
394
  };
399
395
  };
400
396
  registerGlobalSetter(
@@ -478,7 +474,7 @@ function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) {
478
474
  return dir.getSSRProps(
479
475
  {
480
476
  dir,
481
- instance,
477
+ instance: Vue.ssrUtils.getComponentPublicInstance(instance.$),
482
478
  value,
483
479
  oldValue: void 0,
484
480
  arg,
@@ -686,9 +682,11 @@ function renderComponentSubTree(instance, slotScopeId) {
686
682
  }
687
683
  }
688
684
  if (slotScopeId) {
689
- if (!hasCloned)
690
- attrs = { ...attrs };
691
- attrs[slotScopeId.trim()] = "";
685
+ if (!hasCloned) attrs = { ...attrs };
686
+ const slotScopeIdList = slotScopeId.trim().split(" ");
687
+ for (let i = 0; i < slotScopeIdList.length; i++) {
688
+ attrs[slotScopeIdList[i]] = "";
689
+ }
692
690
  }
693
691
  const prev = setCurrentRenderingInstance(instance);
694
692
  try {
@@ -835,8 +833,7 @@ function applySSRDirectives(vnode, rawProps, dirs) {
835
833
  } = binding;
836
834
  if (getSSRProps) {
837
835
  const props = getSSRProps(binding, vnode);
838
- if (props)
839
- toMerge.push(props);
836
+ if (props) toMerge.push(props);
840
837
  }
841
838
  }
842
839
  return Vue.mergeProps(rawProps || {}, ...toMerge);
@@ -1024,8 +1021,7 @@ function renderToWebStream(input, context = {}) {
1024
1021
  start(controller) {
1025
1022
  renderToSimpleStream(input, context, {
1026
1023
  push(content) {
1027
- if (cancelled)
1028
- return;
1024
+ if (cancelled) return;
1029
1025
  if (content != null) {
1030
1026
  controller.enqueue(encoder.encode(content));
1031
1027
  } else {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/server-renderer v3.4.27
2
+ * @vue/server-renderer v3.4.29
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -148,13 +148,11 @@ function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push,
148
148
  fallbackRenderFn();
149
149
  }
150
150
  }
151
- const commentTestRE = /^<!--.*-->$/s;
151
+ const commentTestRE = /^<!--[\s\S]*-->$/;
152
152
  const commentRE = /<!--[^]*?-->/gm;
153
153
  function isComment(item) {
154
- if (typeof item !== "string" || !commentTestRE.test(item))
155
- return false;
156
- if (item.length <= 8)
157
- return true;
154
+ if (typeof item !== "string" || !commentTestRE.test(item)) return false;
155
+ if (item.length <= 8) return true;
158
156
  return !item.replace(commentRE, "").trim();
159
157
  }
160
158
 
@@ -220,7 +218,7 @@ function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) {
220
218
  return dir.getSSRProps(
221
219
  {
222
220
  dir,
223
- instance,
221
+ instance: Vue.ssrUtils.getComponentPublicInstance(instance.$),
224
222
  value,
225
223
  oldValue: void 0,
226
224
  arg,
@@ -421,9 +419,11 @@ function renderComponentSubTree(instance, slotScopeId) {
421
419
  }
422
420
  }
423
421
  if (slotScopeId) {
424
- if (!hasCloned)
425
- attrs = { ...attrs };
426
- attrs[slotScopeId.trim()] = "";
422
+ if (!hasCloned) attrs = { ...attrs };
423
+ const slotScopeIdList = slotScopeId.trim().split(" ");
424
+ for (let i = 0; i < slotScopeIdList.length; i++) {
425
+ attrs[slotScopeIdList[i]] = "";
426
+ }
427
427
  }
428
428
  const prev = setCurrentRenderingInstance(instance);
429
429
  try {
@@ -570,8 +570,7 @@ function applySSRDirectives(vnode, rawProps, dirs) {
570
570
  } = binding;
571
571
  if (getSSRProps) {
572
572
  const props = getSSRProps(binding, vnode);
573
- if (props)
574
- toMerge.push(props);
573
+ if (props) toMerge.push(props);
575
574
  }
576
575
  }
577
576
  return Vue.mergeProps(rawProps || {}, ...toMerge);
@@ -759,8 +758,7 @@ function renderToWebStream(input, context = {}) {
759
758
  start(controller) {
760
759
  renderToSimpleStream(input, context, {
761
760
  push(content) {
762
- if (cancelled)
763
- return;
761
+ if (cancelled) return;
764
762
  if (content != null) {
765
763
  controller.enqueue(encoder.encode(content));
766
764
  } else {
@@ -1,7 +1,6 @@
1
1
  /// <reference types="node" />
2
- import { VNode, ComponentInternalInstance, App, Slots, Component } from 'vue';
2
+ import { VNode, ComponentInternalInstance, App, Slots, Component, ComponentPublicInstance, Directive } from 'vue';
3
3
  import { Readable, Writable } from 'node:stream';
4
- import { ComponentPublicInstance, Directive } from '@vue/runtime-core';
5
4
  export { includeBooleanAttr as ssrIncludeBooleanAttr } from '@vue/shared';
6
5
 
7
6
  type SSRBuffer = SSRBufferItem[] & {