@vue/compat 3.3.0-alpha.4 → 3.3.0-alpha.6

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.
@@ -10,6 +10,96 @@ var Vue = (function () {
10
10
  return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
11
11
  }
12
12
 
13
+ const EMPTY_OBJ = Object.freeze({}) ;
14
+ const EMPTY_ARR = Object.freeze([]) ;
15
+ const NOOP = () => {
16
+ };
17
+ const NO = () => false;
18
+ const onRE = /^on[^a-z]/;
19
+ const isOn = (key) => onRE.test(key);
20
+ const isModelListener = (key) => key.startsWith("onUpdate:");
21
+ const extend = Object.assign;
22
+ const remove = (arr, el) => {
23
+ const i = arr.indexOf(el);
24
+ if (i > -1) {
25
+ arr.splice(i, 1);
26
+ }
27
+ };
28
+ const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
29
+ const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
30
+ const isArray = Array.isArray;
31
+ const isMap = (val) => toTypeString(val) === "[object Map]";
32
+ const isSet = (val) => toTypeString(val) === "[object Set]";
33
+ const isDate = (val) => toTypeString(val) === "[object Date]";
34
+ const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
35
+ const isFunction = (val) => typeof val === "function";
36
+ const isString = (val) => typeof val === "string";
37
+ const isSymbol = (val) => typeof val === "symbol";
38
+ const isObject = (val) => val !== null && typeof val === "object";
39
+ const isPromise = (val) => {
40
+ return isObject(val) && isFunction(val.then) && isFunction(val.catch);
41
+ };
42
+ const objectToString = Object.prototype.toString;
43
+ const toTypeString = (value) => objectToString.call(value);
44
+ const toRawType = (value) => {
45
+ return toTypeString(value).slice(8, -1);
46
+ };
47
+ const isPlainObject = (val) => toTypeString(val) === "[object Object]";
48
+ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
49
+ const isReservedProp = /* @__PURE__ */ makeMap(
50
+ // the leading comma is intentional so empty string "" is also included
51
+ ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
52
+ );
53
+ const isBuiltInDirective = /* @__PURE__ */ makeMap(
54
+ "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
55
+ );
56
+ const cacheStringFunction = (fn) => {
57
+ const cache = /* @__PURE__ */ Object.create(null);
58
+ return (str) => {
59
+ const hit = cache[str];
60
+ return hit || (cache[str] = fn(str));
61
+ };
62
+ };
63
+ const camelizeRE = /-(\w)/g;
64
+ const camelize = cacheStringFunction((str) => {
65
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
66
+ });
67
+ const hyphenateRE = /\B([A-Z])/g;
68
+ const hyphenate = cacheStringFunction(
69
+ (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
70
+ );
71
+ const capitalize = cacheStringFunction(
72
+ (str) => str.charAt(0).toUpperCase() + str.slice(1)
73
+ );
74
+ const toHandlerKey = cacheStringFunction(
75
+ (str) => str ? `on${capitalize(str)}` : ``
76
+ );
77
+ const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
78
+ const invokeArrayFns = (fns, arg) => {
79
+ for (let i = 0; i < fns.length; i++) {
80
+ fns[i](arg);
81
+ }
82
+ };
83
+ const def = (obj, key, value) => {
84
+ Object.defineProperty(obj, key, {
85
+ configurable: true,
86
+ enumerable: false,
87
+ value
88
+ });
89
+ };
90
+ const looseToNumber = (val) => {
91
+ const n = parseFloat(val);
92
+ return isNaN(n) ? val : n;
93
+ };
94
+ const toNumber = (val) => {
95
+ const n = isString(val) ? Number(val) : NaN;
96
+ return isNaN(n) ? val : n;
97
+ };
98
+ let _globalThis;
99
+ const getGlobalThis = () => {
100
+ return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
101
+ };
102
+
13
103
  const PatchFlagNames = {
14
104
  [1]: `TEXT`,
15
105
  [2]: `CLASS`,
@@ -229,96 +319,6 @@ var Vue = (function () {
229
319
  return val;
230
320
  };
231
321
 
232
- const EMPTY_OBJ = Object.freeze({}) ;
233
- const EMPTY_ARR = Object.freeze([]) ;
234
- const NOOP = () => {
235
- };
236
- const NO = () => false;
237
- const onRE = /^on[^a-z]/;
238
- const isOn = (key) => onRE.test(key);
239
- const isModelListener = (key) => key.startsWith("onUpdate:");
240
- const extend = Object.assign;
241
- const remove = (arr, el) => {
242
- const i = arr.indexOf(el);
243
- if (i > -1) {
244
- arr.splice(i, 1);
245
- }
246
- };
247
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
248
- const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
249
- const isArray = Array.isArray;
250
- const isMap = (val) => toTypeString(val) === "[object Map]";
251
- const isSet = (val) => toTypeString(val) === "[object Set]";
252
- const isDate = (val) => toTypeString(val) === "[object Date]";
253
- const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
254
- const isFunction = (val) => typeof val === "function";
255
- const isString = (val) => typeof val === "string";
256
- const isSymbol = (val) => typeof val === "symbol";
257
- const isObject = (val) => val !== null && typeof val === "object";
258
- const isPromise = (val) => {
259
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
260
- };
261
- const objectToString = Object.prototype.toString;
262
- const toTypeString = (value) => objectToString.call(value);
263
- const toRawType = (value) => {
264
- return toTypeString(value).slice(8, -1);
265
- };
266
- const isPlainObject = (val) => toTypeString(val) === "[object Object]";
267
- const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
268
- const isReservedProp = /* @__PURE__ */ makeMap(
269
- // the leading comma is intentional so empty string "" is also included
270
- ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
271
- );
272
- const isBuiltInDirective = /* @__PURE__ */ makeMap(
273
- "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
274
- );
275
- const cacheStringFunction = (fn) => {
276
- const cache = /* @__PURE__ */ Object.create(null);
277
- return (str) => {
278
- const hit = cache[str];
279
- return hit || (cache[str] = fn(str));
280
- };
281
- };
282
- const camelizeRE = /-(\w)/g;
283
- const camelize = cacheStringFunction((str) => {
284
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
285
- });
286
- const hyphenateRE = /\B([A-Z])/g;
287
- const hyphenate = cacheStringFunction(
288
- (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
289
- );
290
- const capitalize = cacheStringFunction(
291
- (str) => str.charAt(0).toUpperCase() + str.slice(1)
292
- );
293
- const toHandlerKey = cacheStringFunction(
294
- (str) => str ? `on${capitalize(str)}` : ``
295
- );
296
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
297
- const invokeArrayFns = (fns, arg) => {
298
- for (let i = 0; i < fns.length; i++) {
299
- fns[i](arg);
300
- }
301
- };
302
- const def = (obj, key, value) => {
303
- Object.defineProperty(obj, key, {
304
- configurable: true,
305
- enumerable: false,
306
- value
307
- });
308
- };
309
- const looseToNumber = (val) => {
310
- const n = parseFloat(val);
311
- return isNaN(n) ? val : n;
312
- };
313
- const toNumber = (val) => {
314
- const n = isString(val) ? Number(val) : NaN;
315
- return isNaN(n) ? val : n;
316
- };
317
- let _globalThis;
318
- const getGlobalThis = () => {
319
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
320
- };
321
-
322
322
  function warn$1(msg, ...args) {
323
323
  console.warn(`[Vue warn] ${msg}`, ...args);
324
324
  }
@@ -4103,8 +4103,8 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4103
4103
  return ret;
4104
4104
  }
4105
4105
 
4106
- function defineComponent(options) {
4107
- return isFunction(options) ? { setup: options, name: options.name } : options;
4106
+ function defineComponent(options, extraOptions) {
4107
+ return isFunction(options) ? extend({}, extraOptions, { setup: options, name: options.name }) : options;
4108
4108
  }
4109
4109
 
4110
4110
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -4680,7 +4680,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4680
4680
  function resolveComponent(name, maybeSelfReference) {
4681
4681
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
4682
4682
  }
4683
- const NULL_DYNAMIC_COMPONENT = Symbol();
4683
+ const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
4684
4684
  function resolveDynamicComponent(component) {
4685
4685
  if (isString(component)) {
4686
4686
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -6257,7 +6257,7 @@ If this is a native custom element, make sure to exclude it from component resol
6257
6257
  const hasDefault = hasOwn(opt, "default");
6258
6258
  if (hasDefault && value === void 0) {
6259
6259
  const defaultValue = opt.default;
6260
- if (opt.type !== Function && isFunction(defaultValue)) {
6260
+ if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
6261
6261
  const { propsDefaults } = instance;
6262
6262
  if (key in propsDefaults) {
6263
6263
  value = propsDefaults[key];
@@ -6396,7 +6396,7 @@ If this is a native custom element, make sure to exclude it from component resol
6396
6396
  }
6397
6397
  }
6398
6398
  function validateProp(name, value, prop, isAbsent) {
6399
- const { type, required, validator } = prop;
6399
+ const { type, required, validator, skipCheck } = prop;
6400
6400
  if (required && isAbsent) {
6401
6401
  warn('Missing required prop: "' + name + '"');
6402
6402
  return;
@@ -6404,7 +6404,7 @@ If this is a native custom element, make sure to exclude it from component resol
6404
6404
  if (value == null && !prop.required) {
6405
6405
  return;
6406
6406
  }
6407
- if (type != null && type !== true) {
6407
+ if (type != null && type !== true && !skipCheck) {
6408
6408
  let isValid = false;
6409
6409
  const types = isArray(type) ? type : [type];
6410
6410
  const expectedTypes = [];
@@ -6646,7 +6646,7 @@ If this is a native custom element, make sure to exclude it from component resol
6646
6646
  return vm;
6647
6647
  }
6648
6648
  }
6649
- Vue.version = `2.6.14-compat:${"3.3.0-alpha.4"}`;
6649
+ Vue.version = `2.6.14-compat:${"3.3.0-alpha.6"}`;
6650
6650
  Vue.config = singletonApp.config;
6651
6651
  Vue.use = (p, ...options) => {
6652
6652
  if (p && isFunction(p.install)) {
@@ -9541,10 +9541,10 @@ If you want to remount the same app, move your app creation logic into a factory
9541
9541
  return comp;
9542
9542
  }
9543
9543
 
9544
- const Fragment = Symbol("Fragment" );
9545
- const Text = Symbol("Text" );
9546
- const Comment = Symbol("Comment" );
9547
- const Static = Symbol("Static" );
9544
+ const Fragment = Symbol.for("v-fgt");
9545
+ const Text = Symbol.for("v-txt");
9546
+ const Comment = Symbol.for("v-cmt");
9547
+ const Static = Symbol.for("v-stc");
9548
9548
  const blockStack = [];
9549
9549
  let currentBlock = null;
9550
9550
  function openBlock(disableTracking = false) {
@@ -10006,13 +10006,19 @@ Component that was made reactive: `,
10006
10006
  }
10007
10007
  let currentInstance = null;
10008
10008
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
10009
+ let internalSetCurrentInstance;
10010
+ {
10011
+ internalSetCurrentInstance = (i) => {
10012
+ currentInstance = i;
10013
+ };
10014
+ }
10009
10015
  const setCurrentInstance = (instance) => {
10010
- currentInstance = instance;
10016
+ internalSetCurrentInstance(instance);
10011
10017
  instance.scope.on();
10012
10018
  };
10013
10019
  const unsetCurrentInstance = () => {
10014
10020
  currentInstance && currentInstance.scope.off();
10015
- currentInstance = null;
10021
+ internalSetCurrentInstance(null);
10016
10022
  };
10017
10023
  const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
10018
10024
  function validateComponentName(name, config) {
@@ -10333,6 +10339,11 @@ Component that was made reactive: `,
10333
10339
  warnRuntimeUsage(`defineExpose`);
10334
10340
  }
10335
10341
  }
10342
+ function defineOptions(options) {
10343
+ {
10344
+ warnRuntimeUsage(`defineOptions`);
10345
+ }
10346
+ }
10336
10347
  function withDefaults(props, defaults) {
10337
10348
  {
10338
10349
  warnRuntimeUsage(`withDefaults`);
@@ -10358,18 +10369,23 @@ Component that was made reactive: `,
10358
10369
  {}
10359
10370
  ) : raw;
10360
10371
  for (const key in defaults) {
10361
- const opt = props[key];
10372
+ if (key.startsWith("__skip"))
10373
+ continue;
10374
+ let opt = props[key];
10362
10375
  if (opt) {
10363
10376
  if (isArray(opt) || isFunction(opt)) {
10364
- props[key] = { type: opt, default: defaults[key] };
10377
+ opt = props[key] = { type: opt, default: defaults[key] };
10365
10378
  } else {
10366
10379
  opt.default = defaults[key];
10367
10380
  }
10368
10381
  } else if (opt === null) {
10369
- props[key] = { default: defaults[key] };
10382
+ opt = props[key] = { default: defaults[key] };
10370
10383
  } else {
10371
10384
  warn(`props default key "${key}" has no corresponding declaration.`);
10372
10385
  }
10386
+ if (opt && defaults[`__skip_${key}`]) {
10387
+ opt.skipFactory = true;
10388
+ }
10373
10389
  }
10374
10390
  return props;
10375
10391
  }
@@ -10424,7 +10440,7 @@ Component that was made reactive: `,
10424
10440
  }
10425
10441
  }
10426
10442
 
10427
- const ssrContextKey = Symbol(`ssrContext` );
10443
+ const ssrContextKey = Symbol.for("v-scx");
10428
10444
  const useSSRContext = () => {
10429
10445
  {
10430
10446
  warn(`useSSRContext() is not supported in the global build.`);
@@ -10632,7 +10648,7 @@ Component that was made reactive: `,
10632
10648
  return true;
10633
10649
  }
10634
10650
 
10635
- const version = "3.3.0-alpha.4";
10651
+ const version = "3.3.0-alpha.6";
10636
10652
  const ssrUtils = null;
10637
10653
  const resolveFilter = resolveFilter$1 ;
10638
10654
  const _compatUtils = {
@@ -12276,6 +12292,7 @@ Component that was made reactive: `,
12276
12292
  defineCustomElement: defineCustomElement,
12277
12293
  defineEmits: defineEmits,
12278
12294
  defineExpose: defineExpose,
12295
+ defineOptions: defineOptions,
12279
12296
  defineProps: defineProps,
12280
12297
  defineSSRCustomElement: defineSSRCustomElement,
12281
12298
  get devtools () { return devtools; },
@@ -12705,6 +12722,20 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
12705
12722
  loc: locStub
12706
12723
  };
12707
12724
  }
12725
+ function getVNodeHelper(ssr, isComponent) {
12726
+ return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
12727
+ }
12728
+ function getVNodeBlockHelper(ssr, isComponent) {
12729
+ return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
12730
+ }
12731
+ function convertToBlock(node, { helper, removeHelper, inSSR }) {
12732
+ if (!node.isBlock) {
12733
+ node.isBlock = true;
12734
+ removeHelper(getVNodeHelper(inSSR, node.isComponent));
12735
+ helper(OPEN_BLOCK);
12736
+ helper(getVNodeBlockHelper(inSSR, node.isComponent));
12737
+ }
12738
+ }
12708
12739
 
12709
12740
  const isStaticExp = (p) => p.type === 4 && p.isStatic;
12710
12741
  const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
@@ -12874,12 +12905,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
12874
12905
  function isSlotOutlet(node) {
12875
12906
  return node.type === 1 && node.tagType === 2;
12876
12907
  }
12877
- function getVNodeHelper(ssr, isComponent) {
12878
- return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
12879
- }
12880
- function getVNodeBlockHelper(ssr, isComponent) {
12881
- return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
12882
- }
12883
12908
  const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
12884
12909
  function getUnnormalizedProps(props, callPath = []) {
12885
12910
  if (props && !isString(props) && props.type === 14) {
@@ -12973,14 +12998,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
12973
12998
  return node;
12974
12999
  }
12975
13000
  }
12976
- function makeBlock(node, { helper, removeHelper, inSSR }) {
12977
- if (!node.isBlock) {
12978
- node.isBlock = true;
12979
- removeHelper(getVNodeHelper(inSSR, node.isComponent));
12980
- helper(OPEN_BLOCK);
12981
- helper(getVNodeBlockHelper(inSSR, node.isComponent));
12982
- }
12983
- }
12984
13001
 
12985
13002
  const deprecationData = {
12986
13003
  ["COMPILER_IS_ON_ELEMENT"]: {
@@ -14242,7 +14259,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14242
14259
  if (isSingleElementRoot(root, child) && child.codegenNode) {
14243
14260
  const codegenNode = child.codegenNode;
14244
14261
  if (codegenNode.type === 13) {
14245
- makeBlock(codegenNode, context);
14262
+ convertToBlock(codegenNode, context);
14246
14263
  }
14247
14264
  root.codegenNode = codegenNode;
14248
14265
  } else {
@@ -15162,7 +15179,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15162
15179
  const ret = firstChild.codegenNode;
15163
15180
  const vnodeCall = getMemoedVNodeCall(ret);
15164
15181
  if (vnodeCall.type === 13) {
15165
- makeBlock(vnodeCall, context);
15182
+ convertToBlock(vnodeCall, context);
15166
15183
  }
15167
15184
  injectProp(vnodeCall, keyProperty, context);
15168
15185
  return ret;
@@ -16792,7 +16809,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16792
16809
  const codegenNode = node.codegenNode || context.currentNode.codegenNode;
16793
16810
  if (codegenNode && codegenNode.type === 13) {
16794
16811
  if (node.tagType !== 1) {
16795
- makeBlock(codegenNode, context);
16812
+ convertToBlock(codegenNode, context);
16796
16813
  }
16797
16814
  node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
16798
16815
  dir.exp,