@vue/server-renderer 3.2.25 → 3.2.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.
@@ -197,7 +197,7 @@ function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
197
197
  const instance = createComponentInstance(vnode, parentComponent, null);
198
198
  const res = setupComponent(instance, true /* isSSR */);
199
199
  const hasAsyncSetup = shared.isPromise(res);
200
- const prefetches = instance.sp;
200
+ const prefetches = instance.sp; /* LifecycleHooks.SERVER_PREFETCH */
201
201
  if (hasAsyncSetup || prefetches) {
202
202
  let p = hasAsyncSetup
203
203
  ? res
@@ -227,6 +227,12 @@ function renderComponentSubTree(instance, slotScopeId) {
227
227
  shared.isString(comp.template)) {
228
228
  comp.ssrRender = ssrCompile(comp.template, instance);
229
229
  }
230
+ // perf: enable caching of computed getters during render
231
+ // since there cannot be state mutations during render.
232
+ for (const e of instance.scope.effects) {
233
+ if (e.computed)
234
+ e.computed._cacheable = true;
235
+ }
230
236
  const ssrRender = instance.ssrRender || comp.ssrRender;
231
237
  if (ssrRender) {
232
238
  // optimized
@@ -682,38 +688,6 @@ function isRef(r) {
682
688
  return Boolean(r && r.__v_isRef === true);
683
689
  }
684
690
 
685
- const classifyRE = /(?:^|[-_])(\w)/g;
686
- const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
687
- function getComponentName(Component) {
688
- return shared.isFunction(Component)
689
- ? Component.displayName || Component.name
690
- : Component.name;
691
- }
692
- /* istanbul ignore next */
693
- function formatComponentName(instance, Component, isRoot = false) {
694
- let name = getComponentName(Component);
695
- if (!name && Component.__file) {
696
- const match = Component.__file.match(/([^/\\]+)\.\w+$/);
697
- if (match) {
698
- name = match[1];
699
- }
700
- }
701
- if (!name && instance && instance.parent) {
702
- // try to infer the name based on reverse resolution
703
- const inferFromRegistry = (registry) => {
704
- for (const key in registry) {
705
- if (registry[key] === Component) {
706
- return key;
707
- }
708
- }
709
- };
710
- name =
711
- inferFromRegistry(instance.components ||
712
- instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
713
- }
714
- return name ? classify(name) : isRoot ? `App` : `Anonymous`;
715
- }
716
-
717
691
  const stack = [];
718
692
  function pushWarningContext(vnode) {
719
693
  stack.push(vnode);
@@ -854,7 +828,7 @@ const ErrorTypeStrings = {
854
828
  [12 /* FUNCTION_REF */]: 'ref function',
855
829
  [13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',
856
830
  [14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
857
- 'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next'
831
+ 'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core'
858
832
  };
859
833
  function callWithErrorHandling(fn, instance, type, args) {
860
834
  let res;
@@ -914,6 +888,38 @@ function logError(err, type, contextVNode, throwInDev = true) {
914
888
  }
915
889
  }
916
890
 
891
+ const classifyRE = /(?:^|[-_])(\w)/g;
892
+ const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
893
+ function getComponentName(Component) {
894
+ return shared.isFunction(Component)
895
+ ? Component.displayName || Component.name
896
+ : Component.name;
897
+ }
898
+ /* istanbul ignore next */
899
+ function formatComponentName(instance, Component, isRoot = false) {
900
+ let name = getComponentName(Component);
901
+ if (!name && Component.__file) {
902
+ const match = Component.__file.match(/([^/\\]+)\.\w+$/);
903
+ if (match) {
904
+ name = match[1];
905
+ }
906
+ }
907
+ if (!name && instance && instance.parent) {
908
+ // try to infer the name based on reverse resolution
909
+ const inferFromRegistry = (registry) => {
910
+ for (const key in registry) {
911
+ if (registry[key] === Component) {
912
+ return key;
913
+ }
914
+ }
915
+ };
916
+ name =
917
+ inferFromRegistry(instance.components ||
918
+ instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
919
+ }
920
+ return name ? classify(name) : isRoot ? `App` : `Anonymous`;
921
+ }
922
+
917
923
  function ssrRenderList(source, renderItem) {
918
924
  if (shared.isArray(source) || shared.isString(source)) {
919
925
  for (let i = 0, l = source.length; i < l; i++) {
@@ -194,7 +194,7 @@ function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
194
194
  const instance = createComponentInstance(vnode, parentComponent, null);
195
195
  const res = setupComponent(instance, true /* isSSR */);
196
196
  const hasAsyncSetup = shared.isPromise(res);
197
- const prefetches = instance.sp;
197
+ const prefetches = instance.sp; /* LifecycleHooks.SERVER_PREFETCH */
198
198
  if (hasAsyncSetup || prefetches) {
199
199
  let p = hasAsyncSetup
200
200
  ? res
@@ -224,6 +224,12 @@ function renderComponentSubTree(instance, slotScopeId) {
224
224
  shared.isString(comp.template)) {
225
225
  comp.ssrRender = ssrCompile(comp.template, instance);
226
226
  }
227
+ // perf: enable caching of computed getters during render
228
+ // since there cannot be state mutations during render.
229
+ for (const e of instance.scope.effects) {
230
+ if (e.computed)
231
+ e.computed._cacheable = true;
232
+ }
227
233
  const ssrRender = instance.ssrRender || comp.ssrRender;
228
234
  if (ssrRender) {
229
235
  // optimized
@@ -166,7 +166,7 @@ function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
166
166
  const instance = createComponentInstance(vnode, parentComponent, null);
167
167
  const res = setupComponent(instance, true /* isSSR */);
168
168
  const hasAsyncSetup = isPromise(res);
169
- const prefetches = instance.sp;
169
+ const prefetches = instance.sp; /* LifecycleHooks.SERVER_PREFETCH */
170
170
  if (hasAsyncSetup || prefetches) {
171
171
  let p = hasAsyncSetup
172
172
  ? res
@@ -196,6 +196,12 @@ function renderComponentSubTree(instance, slotScopeId) {
196
196
  isString(comp.template)) {
197
197
  comp.ssrRender = ssrCompile(comp.template);
198
198
  }
199
+ // perf: enable caching of computed getters during render
200
+ // since there cannot be state mutations during render.
201
+ for (const e of instance.scope.effects) {
202
+ if (e.computed)
203
+ e.computed._cacheable = true;
204
+ }
199
205
  const ssrRender = instance.ssrRender || comp.ssrRender;
200
206
  if (ssrRender) {
201
207
  // optimized
@@ -649,38 +655,6 @@ function isRef(r) {
649
655
  return Boolean(r && r.__v_isRef === true);
650
656
  }
651
657
 
652
- const classifyRE = /(?:^|[-_])(\w)/g;
653
- const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
654
- function getComponentName(Component) {
655
- return isFunction(Component)
656
- ? Component.displayName || Component.name
657
- : Component.name;
658
- }
659
- /* istanbul ignore next */
660
- function formatComponentName(instance, Component, isRoot = false) {
661
- let name = getComponentName(Component);
662
- if (!name && Component.__file) {
663
- const match = Component.__file.match(/([^/\\]+)\.\w+$/);
664
- if (match) {
665
- name = match[1];
666
- }
667
- }
668
- if (!name && instance && instance.parent) {
669
- // try to infer the name based on reverse resolution
670
- const inferFromRegistry = (registry) => {
671
- for (const key in registry) {
672
- if (registry[key] === Component) {
673
- return key;
674
- }
675
- }
676
- };
677
- name =
678
- inferFromRegistry(instance.components ||
679
- instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
680
- }
681
- return name ? classify(name) : isRoot ? `App` : `Anonymous`;
682
- }
683
-
684
658
  const stack = [];
685
659
  function pushWarningContext(vnode) {
686
660
  stack.push(vnode);
@@ -821,7 +795,7 @@ const ErrorTypeStrings = {
821
795
  [12 /* FUNCTION_REF */]: 'ref function',
822
796
  [13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',
823
797
  [14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
824
- 'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next'
798
+ 'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core'
825
799
  };
826
800
  function callWithErrorHandling(fn, instance, type, args) {
827
801
  let res;
@@ -885,6 +859,38 @@ function logError(err, type, contextVNode, throwInDev = true) {
885
859
  }
886
860
  }
887
861
 
862
+ const classifyRE = /(?:^|[-_])(\w)/g;
863
+ const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
864
+ function getComponentName(Component) {
865
+ return isFunction(Component)
866
+ ? Component.displayName || Component.name
867
+ : Component.name;
868
+ }
869
+ /* istanbul ignore next */
870
+ function formatComponentName(instance, Component, isRoot = false) {
871
+ let name = getComponentName(Component);
872
+ if (!name && Component.__file) {
873
+ const match = Component.__file.match(/([^/\\]+)\.\w+$/);
874
+ if (match) {
875
+ name = match[1];
876
+ }
877
+ }
878
+ if (!name && instance && instance.parent) {
879
+ // try to infer the name based on reverse resolution
880
+ const inferFromRegistry = (registry) => {
881
+ for (const key in registry) {
882
+ if (registry[key] === Component) {
883
+ return key;
884
+ }
885
+ }
886
+ };
887
+ name =
888
+ inferFromRegistry(instance.components ||
889
+ instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
890
+ }
891
+ return name ? classify(name) : isRoot ? `App` : `Anonymous`;
892
+ }
893
+
888
894
  function ssrRenderList(source, renderItem) {
889
895
  if (isArray(source) || isString(source)) {
890
896
  for (let i = 0, l = source.length; i < l; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/server-renderer",
3
- "version": "3.2.25",
3
+ "version": "3.2.29",
4
4
  "description": "@vue/server-renderer",
5
5
  "main": "index.js",
6
6
  "module": "dist/server-renderer.esm-bundler.js",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "git+https://github.com/vuejs/vue-next.git",
21
+ "url": "git+https://github.com/vuejs/core.git",
22
22
  "directory": "packages/server-renderer"
23
23
  },
24
24
  "keywords": [
@@ -27,14 +27,14 @@
27
27
  "author": "Evan You",
28
28
  "license": "MIT",
29
29
  "bugs": {
30
- "url": "https://github.com/vuejs/vue-next/issues"
30
+ "url": "https://github.com/vuejs/core/issues"
31
31
  },
32
- "homepage": "https://github.com/vuejs/vue-next/tree/master/packages/server-renderer#readme",
32
+ "homepage": "https://github.com/vuejs/core/tree/main/packages/server-renderer#readme",
33
33
  "peerDependencies": {
34
- "vue": "3.2.25"
34
+ "vue": "3.2.29"
35
35
  },
36
36
  "dependencies": {
37
- "@vue/shared": "3.2.25",
38
- "@vue/compiler-ssr": "3.2.25"
37
+ "@vue/shared": "3.2.29",
38
+ "@vue/compiler-ssr": "3.2.29"
39
39
  }
40
40
  }