@vue/compat 3.3.0-beta.4 → 3.3.0

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.
package/dist/vue.cjs.js CHANGED
@@ -3153,7 +3153,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3153
3153
  );
3154
3154
  setActiveBranch(suspense, vnode.ssFallback);
3155
3155
  } else {
3156
- suspense.resolve();
3156
+ suspense.resolve(false, true);
3157
3157
  }
3158
3158
  }
3159
3159
  function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
@@ -3312,7 +3312,6 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3312
3312
  }
3313
3313
  let hasWarned = false;
3314
3314
  function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3315
- var _a;
3316
3315
  if (!hasWarned) {
3317
3316
  hasWarned = true;
3318
3317
  console[console.info ? "info" : "log"](
@@ -3327,10 +3326,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3327
3326
  o: { parentNode, remove }
3328
3327
  } = rendererInternals;
3329
3328
  let parentSuspenseId;
3330
- const isSuspensible = ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3329
+ const isSuspensible = isVNodeSuspensible(vnode);
3331
3330
  if (isSuspensible) {
3332
3331
  if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
3333
- parentSuspenseId = parentSuspense == null ? void 0 : parentSuspense.pendingId;
3332
+ parentSuspenseId = parentSuspense.pendingId;
3334
3333
  parentSuspense.deps++;
3335
3334
  }
3336
3335
  }
@@ -3355,7 +3354,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3355
3354
  isHydrating,
3356
3355
  isUnmounted: false,
3357
3356
  effects: [],
3358
- resolve(resume = false) {
3357
+ resolve(resume = false, sync = false) {
3359
3358
  {
3360
3359
  if (!resume && !suspense.pendingBranch) {
3361
3360
  throw new Error(
@@ -3417,7 +3416,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3417
3416
  if (isSuspensible) {
3418
3417
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
3419
3418
  parentSuspense.deps--;
3420
- if (parentSuspense.deps === 0) {
3419
+ if (parentSuspense.deps === 0 && !sync) {
3421
3420
  parentSuspense.resolve();
3422
3421
  }
3423
3422
  }
@@ -3627,6 +3626,10 @@ function setActiveBranch(suspense, branch) {
3627
3626
  updateHOCHostEl(parentComponent, el);
3628
3627
  }
3629
3628
  }
3629
+ function isVNodeSuspensible(vnode) {
3630
+ var _a;
3631
+ return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3632
+ }
3630
3633
 
3631
3634
  const legacyDirectiveHookMap = {
3632
3635
  beforeMount: "bind",
@@ -4312,7 +4315,11 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4312
4315
  }
4313
4316
 
4314
4317
  function defineComponent(options, extraOptions) {
4315
- return isFunction(options) ? extend({}, extraOptions, { setup: options, name: options.name }) : options;
4318
+ return isFunction(options) ? (
4319
+ // #8326: extend call and options.name access are considered side-effects
4320
+ // by Rollup, so we have to wrap it in a pure-annotated IIFE.
4321
+ /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
4322
+ ) : options;
4316
4323
  }
4317
4324
 
4318
4325
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -6348,7 +6355,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6348
6355
  return vm;
6349
6356
  }
6350
6357
  }
6351
- Vue.version = `2.6.14-compat:${"3.3.0-beta.4"}`;
6358
+ Vue.version = `2.6.14-compat:${"3.3.0"}`;
6352
6359
  Vue.config = singletonApp.config;
6353
6360
  Vue.use = (p, ...options) => {
6354
6361
  if (p && isFunction(p.install)) {
@@ -10889,7 +10896,7 @@ function isMemoSame(cached, memo) {
10889
10896
  return true;
10890
10897
  }
10891
10898
 
10892
- const version = "3.3.0-beta.4";
10899
+ const version = "3.3.0";
10893
10900
  const _ssrUtils = {
10894
10901
  createComponentInstance,
10895
10902
  setupComponent,
@@ -11123,14 +11130,13 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
11123
11130
  el[key] = value == null ? "" : value;
11124
11131
  return;
11125
11132
  }
11126
- if (key === "value" && el.tagName !== "PROGRESS" && // custom elements may use _value internally
11127
- !el.tagName.includes("-")) {
11133
+ const tag = el.tagName;
11134
+ if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11135
+ !tag.includes("-")) {
11128
11136
  el._value = value;
11137
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
11129
11138
  const newValue = value == null ? "" : value;
11130
- if (el.value !== newValue || // #4956: always set for OPTION elements because its value falls back to
11131
- // textContent if no value attribute is present. And setting .value for
11132
- // OPTION has no side effect
11133
- el.tagName === "OPTION") {
11139
+ if (oldValue !== newValue) {
11134
11140
  el.value = newValue;
11135
11141
  }
11136
11142
  if (value == null) {
@@ -11172,7 +11178,7 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
11172
11178
  } catch (e) {
11173
11179
  if (!needRemove) {
11174
11180
  warn(
11175
- `Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: value ${value} is invalid.`,
11181
+ `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
11176
11182
  e
11177
11183
  );
11178
11184
  }
@@ -12465,7 +12471,7 @@ function injectCompilerOptionsCheck(app) {
12465
12471
  const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
12466
12472
  - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
12467
12473
  - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
12468
- - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom`;
12474
+ - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
12469
12475
  Object.defineProperty(app.config, "compilerOptions", {
12470
12476
  get() {
12471
12477
  warn(msg);
@@ -2247,7 +2247,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
2247
2247
  );
2248
2248
  setActiveBranch(suspense, vnode.ssFallback);
2249
2249
  } else {
2250
- suspense.resolve();
2250
+ suspense.resolve(false, true);
2251
2251
  }
2252
2252
  }
2253
2253
  function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
@@ -2405,7 +2405,6 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2405
2405
  }
2406
2406
  }
2407
2407
  function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
2408
- var _a;
2409
2408
  const {
2410
2409
  p: patch,
2411
2410
  m: move,
@@ -2414,10 +2413,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2414
2413
  o: { parentNode, remove }
2415
2414
  } = rendererInternals;
2416
2415
  let parentSuspenseId;
2417
- const isSuspensible = ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
2416
+ const isSuspensible = isVNodeSuspensible(vnode);
2418
2417
  if (isSuspensible) {
2419
2418
  if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
2420
- parentSuspenseId = parentSuspense == null ? void 0 : parentSuspense.pendingId;
2419
+ parentSuspenseId = parentSuspense.pendingId;
2421
2420
  parentSuspense.deps++;
2422
2421
  }
2423
2422
  }
@@ -2439,7 +2438,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2439
2438
  isHydrating,
2440
2439
  isUnmounted: false,
2441
2440
  effects: [],
2442
- resolve(resume = false) {
2441
+ resolve(resume = false, sync = false) {
2443
2442
  const {
2444
2443
  vnode: vnode2,
2445
2444
  activeBranch,
@@ -2489,7 +2488,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2489
2488
  if (isSuspensible) {
2490
2489
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
2491
2490
  parentSuspense.deps--;
2492
- if (parentSuspense.deps === 0) {
2491
+ if (parentSuspense.deps === 0 && !sync) {
2493
2492
  parentSuspense.resolve();
2494
2493
  }
2495
2494
  }
@@ -2690,6 +2689,10 @@ function setActiveBranch(suspense, branch) {
2690
2689
  updateHOCHostEl(parentComponent, el);
2691
2690
  }
2692
2691
  }
2692
+ function isVNodeSuspensible(vnode) {
2693
+ var _a;
2694
+ return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
2695
+ }
2693
2696
 
2694
2697
  const legacyDirectiveHookMap = {
2695
2698
  beforeMount: "bind",
@@ -3328,7 +3331,11 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3328
3331
  }
3329
3332
 
3330
3333
  function defineComponent(options, extraOptions) {
3331
- return isFunction(options) ? extend({}, extraOptions, { setup: options, name: options.name }) : options;
3334
+ return isFunction(options) ? (
3335
+ // #8326: extend call and options.name access are considered side-effects
3336
+ // by Rollup, so we have to wrap it in a pure-annotated IIFE.
3337
+ /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
3338
+ ) : options;
3332
3339
  }
3333
3340
 
3334
3341
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -5066,7 +5073,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5066
5073
  return vm;
5067
5074
  }
5068
5075
  }
5069
- Vue.version = `2.6.14-compat:${"3.3.0-beta.4"}`;
5076
+ Vue.version = `2.6.14-compat:${"3.3.0"}`;
5070
5077
  Vue.config = singletonApp.config;
5071
5078
  Vue.use = (p, ...options) => {
5072
5079
  if (p && isFunction(p.install)) {
@@ -8750,7 +8757,7 @@ function isMemoSame(cached, memo) {
8750
8757
  return true;
8751
8758
  }
8752
8759
 
8753
- const version = "3.3.0-beta.4";
8760
+ const version = "3.3.0";
8754
8761
  const _ssrUtils = {
8755
8762
  createComponentInstance,
8756
8763
  setupComponent,
@@ -8976,14 +8983,13 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
8976
8983
  el[key] = value == null ? "" : value;
8977
8984
  return;
8978
8985
  }
8979
- if (key === "value" && el.tagName !== "PROGRESS" && // custom elements may use _value internally
8980
- !el.tagName.includes("-")) {
8986
+ const tag = el.tagName;
8987
+ if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
8988
+ !tag.includes("-")) {
8981
8989
  el._value = value;
8990
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
8982
8991
  const newValue = value == null ? "" : value;
8983
- if (el.value !== newValue || // #4956: always set for OPTION elements because its value falls back to
8984
- // textContent if no value attribute is present. And setting .value for
8985
- // OPTION has no side effect
8986
- el.tagName === "OPTION") {
8992
+ if (oldValue !== newValue) {
8987
8993
  el.value = newValue;
8988
8994
  }
8989
8995
  if (value == null) {
@@ -3080,7 +3080,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3080
3080
  );
3081
3081
  setActiveBranch(suspense, vnode.ssFallback);
3082
3082
  } else {
3083
- suspense.resolve();
3083
+ suspense.resolve(false, true);
3084
3084
  }
3085
3085
  }
3086
3086
  function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
@@ -3239,7 +3239,6 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3239
3239
  }
3240
3240
  let hasWarned = false;
3241
3241
  function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3242
- var _a;
3243
3242
  if (!hasWarned) {
3244
3243
  hasWarned = true;
3245
3244
  console[console.info ? "info" : "log"](
@@ -3254,10 +3253,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3254
3253
  o: { parentNode, remove }
3255
3254
  } = rendererInternals;
3256
3255
  let parentSuspenseId;
3257
- const isSuspensible = ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3256
+ const isSuspensible = isVNodeSuspensible(vnode);
3258
3257
  if (isSuspensible) {
3259
3258
  if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
3260
- parentSuspenseId = parentSuspense == null ? void 0 : parentSuspense.pendingId;
3259
+ parentSuspenseId = parentSuspense.pendingId;
3261
3260
  parentSuspense.deps++;
3262
3261
  }
3263
3262
  }
@@ -3282,7 +3281,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3282
3281
  isHydrating,
3283
3282
  isUnmounted: false,
3284
3283
  effects: [],
3285
- resolve(resume = false) {
3284
+ resolve(resume = false, sync = false) {
3286
3285
  {
3287
3286
  if (!resume && !suspense.pendingBranch) {
3288
3287
  throw new Error(
@@ -3344,7 +3343,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3344
3343
  if (isSuspensible) {
3345
3344
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
3346
3345
  parentSuspense.deps--;
3347
- if (parentSuspense.deps === 0) {
3346
+ if (parentSuspense.deps === 0 && !sync) {
3348
3347
  parentSuspense.resolve();
3349
3348
  }
3350
3349
  }
@@ -3554,6 +3553,10 @@ function setActiveBranch(suspense, branch) {
3554
3553
  updateHOCHostEl(parentComponent, el);
3555
3554
  }
3556
3555
  }
3556
+ function isVNodeSuspensible(vnode) {
3557
+ var _a;
3558
+ return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3559
+ }
3557
3560
 
3558
3561
  const legacyDirectiveHookMap = {
3559
3562
  beforeMount: "bind",
@@ -4218,7 +4221,11 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4218
4221
  }
4219
4222
 
4220
4223
  function defineComponent(options, extraOptions) {
4221
- return isFunction(options) ? extend({}, extraOptions, { setup: options, name: options.name }) : options;
4224
+ return isFunction(options) ? (
4225
+ // #8326: extend call and options.name access are considered side-effects
4226
+ // by Rollup, so we have to wrap it in a pure-annotated IIFE.
4227
+ /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
4228
+ ) : options;
4222
4229
  }
4223
4230
 
4224
4231
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -6248,7 +6255,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6248
6255
  return vm;
6249
6256
  }
6250
6257
  }
6251
- Vue.version = `2.6.14-compat:${"3.3.0-beta.4"}`;
6258
+ Vue.version = `2.6.14-compat:${"3.3.0"}`;
6252
6259
  Vue.config = singletonApp.config;
6253
6260
  Vue.use = (p, ...options) => {
6254
6261
  if (p && isFunction(p.install)) {
@@ -10777,7 +10784,7 @@ function isMemoSame(cached, memo) {
10777
10784
  return true;
10778
10785
  }
10779
10786
 
10780
- const version = "3.3.0-beta.4";
10787
+ const version = "3.3.0";
10781
10788
  const ssrUtils = null;
10782
10789
  const resolveFilter = resolveFilter$1 ;
10783
10790
  const _compatUtils = {
@@ -11003,14 +11010,13 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
11003
11010
  el[key] = value == null ? "" : value;
11004
11011
  return;
11005
11012
  }
11006
- if (key === "value" && el.tagName !== "PROGRESS" && // custom elements may use _value internally
11007
- !el.tagName.includes("-")) {
11013
+ const tag = el.tagName;
11014
+ if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11015
+ !tag.includes("-")) {
11008
11016
  el._value = value;
11017
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
11009
11018
  const newValue = value == null ? "" : value;
11010
- if (el.value !== newValue || // #4956: always set for OPTION elements because its value falls back to
11011
- // textContent if no value attribute is present. And setting .value for
11012
- // OPTION has no side effect
11013
- el.tagName === "OPTION") {
11019
+ if (oldValue !== newValue) {
11014
11020
  el.value = newValue;
11015
11021
  }
11016
11022
  if (value == null) {
@@ -11052,7 +11058,7 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
11052
11058
  } catch (e) {
11053
11059
  if (!needRemove) {
11054
11060
  warn(
11055
- `Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: value ${value} is invalid.`,
11061
+ `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
11056
11062
  e
11057
11063
  );
11058
11064
  }
@@ -12359,7 +12365,7 @@ function injectCompilerOptionsCheck(app) {
12359
12365
  const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
12360
12366
  - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
12361
12367
  - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
12362
- - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom`;
12368
+ - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
12363
12369
  Object.defineProperty(app.config, "compilerOptions", {
12364
12370
  get() {
12365
12371
  warn(msg);