@vue/runtime-core 3.2.32 → 3.2.33

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.
@@ -235,7 +235,7 @@ let preFlushIndex = 0;
235
235
  const pendingPostFlushCbs = [];
236
236
  let activePostFlushCbs = null;
237
237
  let postFlushIndex = 0;
238
- const resolvedPromise = Promise.resolve();
238
+ const resolvedPromise = /*#__PURE__*/ Promise.resolve();
239
239
  let currentFlushPromise = null;
240
240
  let currentPreFlushParentJob = null;
241
241
  const RECURSION_LIMIT = 100;
@@ -650,6 +650,8 @@ function devtoolsComponentEmit(component, event, params) {
650
650
  }
651
651
 
652
652
  function emit$1(instance, event, ...rawArgs) {
653
+ if (instance.isUnmounted)
654
+ return;
653
655
  const props = instance.vnode.props || shared.EMPTY_OBJ;
654
656
  {
655
657
  const { emitsOptions, propsOptions: [propsOptions] } = instance;
@@ -1943,10 +1945,22 @@ const BaseTransitionImpl = {
1943
1945
  if (!children || !children.length) {
1944
1946
  return;
1945
1947
  }
1946
- // warn multiple elements
1948
+ let child = children[0];
1947
1949
  if (children.length > 1) {
1948
- warn('<transition> can only be used on a single element or component. Use ' +
1949
- '<transition-group> for lists.');
1950
+ let hasFound = false;
1951
+ // locate first non-comment child
1952
+ for (const c of children) {
1953
+ if (c.type !== Comment) {
1954
+ if (hasFound) {
1955
+ // warn more than one non-comment child
1956
+ warn('<transition> can only be used on a single element or component. ' +
1957
+ 'Use <transition-group> for lists.');
1958
+ break;
1959
+ }
1960
+ child = c;
1961
+ hasFound = true;
1962
+ }
1963
+ }
1950
1964
  }
1951
1965
  // there's no need to track reactivity for these props so use the raw
1952
1966
  // props for a bit better perf
@@ -1959,8 +1973,6 @@ const BaseTransitionImpl = {
1959
1973
  mode !== 'default') {
1960
1974
  warn(`invalid <transition> mode: ${mode}`);
1961
1975
  }
1962
- // at this point children has a guaranteed length of 1.
1963
- const child = children[0];
1964
1976
  if (state.isLeaving) {
1965
1977
  return emptyPlaceholder(child);
1966
1978
  }
@@ -5482,7 +5494,22 @@ function baseCreateRenderer(options, createHydrationFns) {
5482
5494
  const remove = vnode => {
5483
5495
  const { type, el, anchor, transition } = vnode;
5484
5496
  if (type === Fragment) {
5485
- removeFragment(el, anchor);
5497
+ if (vnode.patchFlag > 0 &&
5498
+ vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
5499
+ transition &&
5500
+ !transition.persisted) {
5501
+ vnode.children.forEach(child => {
5502
+ if (child.type === Comment) {
5503
+ hostRemove(child.el);
5504
+ }
5505
+ else {
5506
+ remove(child);
5507
+ }
5508
+ });
5509
+ }
5510
+ else {
5511
+ removeFragment(el, anchor);
5512
+ }
5486
5513
  return;
5487
5514
  }
5488
5515
  if (type === Static) {
@@ -6501,7 +6528,10 @@ function renderSlot(slots, name, props = {},
6501
6528
  // this is not a user-facing function, so the fallback is always generated by
6502
6529
  // the compiler and guaranteed to be a function returning an array
6503
6530
  fallback, noSlotted) {
6504
- if (currentRenderingInstance.isCE) {
6531
+ if (currentRenderingInstance.isCE ||
6532
+ (currentRenderingInstance.parent &&
6533
+ isAsyncWrapper(currentRenderingInstance.parent) &&
6534
+ currentRenderingInstance.parent.isCE)) {
6505
6535
  return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());
6506
6536
  }
6507
6537
  let slot = slots[name];
@@ -6574,7 +6604,10 @@ const getPublicInstance = (i) => {
6574
6604
  return getExposeProxy(i) || i.proxy;
6575
6605
  return getPublicInstance(i.parent);
6576
6606
  };
6577
- const publicPropertiesMap = shared.extend(Object.create(null), {
6607
+ const publicPropertiesMap =
6608
+ // Move PURE marker to new line to workaround compiler discarding it
6609
+ // due to type annotation
6610
+ /*#__PURE__*/ shared.extend(Object.create(null), {
6578
6611
  $: i => i,
6579
6612
  $el: i => i.vnode.el,
6580
6613
  $data: i => i.data,
@@ -6744,7 +6777,7 @@ const PublicInstanceProxyHandlers = {
6744
6777
  defineProperty(target, key, descriptor) {
6745
6778
  if (descriptor.get != null) {
6746
6779
  // invalidate key cache of a getter based property #5417
6747
- target.$.accessCache[key] = 0;
6780
+ target._.accessCache[key] = 0;
6748
6781
  }
6749
6782
  else if (shared.hasOwn(descriptor, 'value')) {
6750
6783
  this.set(target, key, descriptor.value, null);
@@ -6952,6 +6985,7 @@ function setupComponent(instance, isSSR = false) {
6952
6985
  return setupResult;
6953
6986
  }
6954
6987
  function setupStatefulComponent(instance, isSSR) {
6988
+ var _a;
6955
6989
  const Component = instance.type;
6956
6990
  {
6957
6991
  if (Component.name) {
@@ -7009,6 +7043,13 @@ function setupStatefulComponent(instance, isSSR) {
7009
7043
  // async setup returned Promise.
7010
7044
  // bail here and wait for re-entry.
7011
7045
  instance.asyncDep = setupResult;
7046
+ if (!instance.suspense) {
7047
+ const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
7048
+ warn(`Component <${name}>: setup function returned a promise, but no ` +
7049
+ `<Suspense> boundary was found in the parent component tree. ` +
7050
+ `A component with async setup() must be nested in a <Suspense> ` +
7051
+ `in order to be rendered.`);
7052
+ }
7012
7053
  }
7013
7054
  }
7014
7055
  else {
@@ -7633,7 +7674,7 @@ function isMemoSame(cached, memo) {
7633
7674
  }
7634
7675
 
7635
7676
  // Core API ------------------------------------------------------------------
7636
- const version = "3.2.32";
7677
+ const version = "3.2.33";
7637
7678
  const _ssrUtils = {
7638
7679
  createComponentInstance,
7639
7680
  setupComponent,
@@ -184,7 +184,7 @@ let preFlushIndex = 0;
184
184
  const pendingPostFlushCbs = [];
185
185
  let activePostFlushCbs = null;
186
186
  let postFlushIndex = 0;
187
- const resolvedPromise = Promise.resolve();
187
+ const resolvedPromise = /*#__PURE__*/ Promise.resolve();
188
188
  let currentFlushPromise = null;
189
189
  let currentPreFlushParentJob = null;
190
190
  function nextTick(fn) {
@@ -375,6 +375,8 @@ function setDevtoolsHook(hook, target) {
375
375
  }
376
376
 
377
377
  function emit(instance, event, ...rawArgs) {
378
+ if (instance.isUnmounted)
379
+ return;
378
380
  const props = instance.vnode.props || shared.EMPTY_OBJ;
379
381
  let args = rawArgs;
380
382
  const isModelListener = event.startsWith('update:');
@@ -1472,12 +1474,20 @@ const BaseTransitionImpl = {
1472
1474
  if (!children || !children.length) {
1473
1475
  return;
1474
1476
  }
1477
+ let child = children[0];
1478
+ if (children.length > 1) {
1479
+ // locate first non-comment child
1480
+ for (const c of children) {
1481
+ if (c.type !== Comment) {
1482
+ child = c;
1483
+ break;
1484
+ }
1485
+ }
1486
+ }
1475
1487
  // there's no need to track reactivity for these props so use the raw
1476
1488
  // props for a bit better perf
1477
1489
  const rawProps = reactivity.toRaw(props);
1478
1490
  const { mode } = rawProps;
1479
- // at this point children has a guaranteed length of 1.
1480
- const child = children[0];
1481
1491
  if (state.isLeaving) {
1482
1492
  return emptyPlaceholder(child);
1483
1493
  }
@@ -4448,7 +4458,9 @@ function baseCreateRenderer(options, createHydrationFns) {
4448
4458
  const remove = vnode => {
4449
4459
  const { type, el, anchor, transition } = vnode;
4450
4460
  if (type === Fragment) {
4451
- removeFragment(el, anchor);
4461
+ {
4462
+ removeFragment(el, anchor);
4463
+ }
4452
4464
  return;
4453
4465
  }
4454
4466
  if (type === Static) {
@@ -5377,7 +5389,10 @@ function renderSlot(slots, name, props = {},
5377
5389
  // this is not a user-facing function, so the fallback is always generated by
5378
5390
  // the compiler and guaranteed to be a function returning an array
5379
5391
  fallback, noSlotted) {
5380
- if (currentRenderingInstance.isCE) {
5392
+ if (currentRenderingInstance.isCE ||
5393
+ (currentRenderingInstance.parent &&
5394
+ isAsyncWrapper(currentRenderingInstance.parent) &&
5395
+ currentRenderingInstance.parent.isCE)) {
5381
5396
  return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());
5382
5397
  }
5383
5398
  let slot = slots[name];
@@ -5440,7 +5455,10 @@ const getPublicInstance = (i) => {
5440
5455
  return getExposeProxy(i) || i.proxy;
5441
5456
  return getPublicInstance(i.parent);
5442
5457
  };
5443
- const publicPropertiesMap = shared.extend(Object.create(null), {
5458
+ const publicPropertiesMap =
5459
+ // Move PURE marker to new line to workaround compiler discarding it
5460
+ // due to type annotation
5461
+ /*#__PURE__*/ shared.extend(Object.create(null), {
5444
5462
  $: i => i,
5445
5463
  $el: i => i.vnode.el,
5446
5464
  $data: i => i.data,
@@ -5571,7 +5589,7 @@ const PublicInstanceProxyHandlers = {
5571
5589
  defineProperty(target, key, descriptor) {
5572
5590
  if (descriptor.get != null) {
5573
5591
  // invalidate key cache of a getter based property #5417
5574
- target.$.accessCache[key] = 0;
5592
+ target._.accessCache[key] = 0;
5575
5593
  }
5576
5594
  else if (shared.hasOwn(descriptor, 'value')) {
5577
5595
  this.set(target, key, descriptor.value, null);
@@ -6097,7 +6115,7 @@ function isMemoSame(cached, memo) {
6097
6115
  }
6098
6116
 
6099
6117
  // Core API ------------------------------------------------------------------
6100
- const version = "3.2.32";
6118
+ const version = "3.2.33";
6101
6119
  const _ssrUtils = {
6102
6120
  createComponentInstance,
6103
6121
  setupComponent,
@@ -237,7 +237,7 @@ let preFlushIndex = 0;
237
237
  const pendingPostFlushCbs = [];
238
238
  let activePostFlushCbs = null;
239
239
  let postFlushIndex = 0;
240
- const resolvedPromise = Promise.resolve();
240
+ const resolvedPromise = /*#__PURE__*/ Promise.resolve();
241
241
  let currentFlushPromise = null;
242
242
  let currentPreFlushParentJob = null;
243
243
  const RECURSION_LIMIT = 100;
@@ -656,6 +656,8 @@ function devtoolsComponentEmit(component, event, params) {
656
656
  }
657
657
 
658
658
  function emit$1(instance, event, ...rawArgs) {
659
+ if (instance.isUnmounted)
660
+ return;
659
661
  const props = instance.vnode.props || EMPTY_OBJ;
660
662
  if ((process.env.NODE_ENV !== 'production')) {
661
663
  const { emitsOptions, propsOptions: [propsOptions] } = instance;
@@ -1952,10 +1954,24 @@ const BaseTransitionImpl = {
1952
1954
  if (!children || !children.length) {
1953
1955
  return;
1954
1956
  }
1955
- // warn multiple elements
1956
- if ((process.env.NODE_ENV !== 'production') && children.length > 1) {
1957
- warn('<transition> can only be used on a single element or component. Use ' +
1958
- '<transition-group> for lists.');
1957
+ let child = children[0];
1958
+ if (children.length > 1) {
1959
+ let hasFound = false;
1960
+ // locate first non-comment child
1961
+ for (const c of children) {
1962
+ if (c.type !== Comment) {
1963
+ if ((process.env.NODE_ENV !== 'production') && hasFound) {
1964
+ // warn more than one non-comment child
1965
+ warn('<transition> can only be used on a single element or component. ' +
1966
+ 'Use <transition-group> for lists.');
1967
+ break;
1968
+ }
1969
+ child = c;
1970
+ hasFound = true;
1971
+ if (!(process.env.NODE_ENV !== 'production'))
1972
+ break;
1973
+ }
1974
+ }
1959
1975
  }
1960
1976
  // there's no need to track reactivity for these props so use the raw
1961
1977
  // props for a bit better perf
@@ -1969,8 +1985,6 @@ const BaseTransitionImpl = {
1969
1985
  mode !== 'default') {
1970
1986
  warn(`invalid <transition> mode: ${mode}`);
1971
1987
  }
1972
- // at this point children has a guaranteed length of 1.
1973
- const child = children[0];
1974
1988
  if (state.isLeaving) {
1975
1989
  return emptyPlaceholder(child);
1976
1990
  }
@@ -5549,7 +5563,23 @@ function baseCreateRenderer(options, createHydrationFns) {
5549
5563
  const remove = vnode => {
5550
5564
  const { type, el, anchor, transition } = vnode;
5551
5565
  if (type === Fragment) {
5552
- removeFragment(el, anchor);
5566
+ if ((process.env.NODE_ENV !== 'production') &&
5567
+ vnode.patchFlag > 0 &&
5568
+ vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
5569
+ transition &&
5570
+ !transition.persisted) {
5571
+ vnode.children.forEach(child => {
5572
+ if (child.type === Comment) {
5573
+ hostRemove(child.el);
5574
+ }
5575
+ else {
5576
+ remove(child);
5577
+ }
5578
+ });
5579
+ }
5580
+ else {
5581
+ removeFragment(el, anchor);
5582
+ }
5553
5583
  return;
5554
5584
  }
5555
5585
  if (type === Static) {
@@ -6573,7 +6603,10 @@ function renderSlot(slots, name, props = {},
6573
6603
  // this is not a user-facing function, so the fallback is always generated by
6574
6604
  // the compiler and guaranteed to be a function returning an array
6575
6605
  fallback, noSlotted) {
6576
- if (currentRenderingInstance.isCE) {
6606
+ if (currentRenderingInstance.isCE ||
6607
+ (currentRenderingInstance.parent &&
6608
+ isAsyncWrapper(currentRenderingInstance.parent) &&
6609
+ currentRenderingInstance.parent.isCE)) {
6577
6610
  return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());
6578
6611
  }
6579
6612
  let slot = slots[name];
@@ -6646,7 +6679,10 @@ const getPublicInstance = (i) => {
6646
6679
  return getExposeProxy(i) || i.proxy;
6647
6680
  return getPublicInstance(i.parent);
6648
6681
  };
6649
- const publicPropertiesMap = extend(Object.create(null), {
6682
+ const publicPropertiesMap =
6683
+ // Move PURE marker to new line to workaround compiler discarding it
6684
+ // due to type annotation
6685
+ /*#__PURE__*/ extend(Object.create(null), {
6650
6686
  $: i => i,
6651
6687
  $el: i => i.vnode.el,
6652
6688
  $data: i => i.data,
@@ -6820,7 +6856,7 @@ const PublicInstanceProxyHandlers = {
6820
6856
  defineProperty(target, key, descriptor) {
6821
6857
  if (descriptor.get != null) {
6822
6858
  // invalidate key cache of a getter based property #5417
6823
- target.$.accessCache[key] = 0;
6859
+ target._.accessCache[key] = 0;
6824
6860
  }
6825
6861
  else if (hasOwn(descriptor, 'value')) {
6826
6862
  this.set(target, key, descriptor.value, null);
@@ -7031,6 +7067,7 @@ function setupComponent(instance, isSSR = false) {
7031
7067
  return setupResult;
7032
7068
  }
7033
7069
  function setupStatefulComponent(instance, isSSR) {
7070
+ var _a;
7034
7071
  const Component = instance.type;
7035
7072
  if ((process.env.NODE_ENV !== 'production')) {
7036
7073
  if (Component.name) {
@@ -7088,6 +7125,13 @@ function setupStatefulComponent(instance, isSSR) {
7088
7125
  // async setup returned Promise.
7089
7126
  // bail here and wait for re-entry.
7090
7127
  instance.asyncDep = setupResult;
7128
+ if ((process.env.NODE_ENV !== 'production') && !instance.suspense) {
7129
+ const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
7130
+ warn(`Component <${name}>: setup function returned a promise, but no ` +
7131
+ `<Suspense> boundary was found in the parent component tree. ` +
7132
+ `A component with async setup() must be nested in a <Suspense> ` +
7133
+ `in order to be rendered.`);
7134
+ }
7091
7135
  }
7092
7136
  }
7093
7137
  else {
@@ -7729,7 +7773,7 @@ function isMemoSame(cached, memo) {
7729
7773
  }
7730
7774
 
7731
7775
  // Core API ------------------------------------------------------------------
7732
- const version = "3.2.32";
7776
+ const version = "3.2.33";
7733
7777
  const _ssrUtils = {
7734
7778
  createComponentInstance,
7735
7779
  setupComponent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.2.32",
3
+ "version": "3.2.33",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
34
34
  "dependencies": {
35
- "@vue/shared": "3.2.32",
36
- "@vue/reactivity": "3.2.32"
35
+ "@vue/shared": "3.2.33",
36
+ "@vue/reactivity": "3.2.33"
37
37
  }
38
38
  }