@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 GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
14
104
  const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
15
105
 
@@ -164,96 +254,6 @@ var Vue = (function () {
164
254
  return val;
165
255
  };
166
256
 
167
- const EMPTY_OBJ = Object.freeze({}) ;
168
- const EMPTY_ARR = Object.freeze([]) ;
169
- const NOOP = () => {
170
- };
171
- const NO = () => false;
172
- const onRE = /^on[^a-z]/;
173
- const isOn = (key) => onRE.test(key);
174
- const isModelListener = (key) => key.startsWith("onUpdate:");
175
- const extend = Object.assign;
176
- const remove = (arr, el) => {
177
- const i = arr.indexOf(el);
178
- if (i > -1) {
179
- arr.splice(i, 1);
180
- }
181
- };
182
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
183
- const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
184
- const isArray = Array.isArray;
185
- const isMap = (val) => toTypeString(val) === "[object Map]";
186
- const isSet = (val) => toTypeString(val) === "[object Set]";
187
- const isDate = (val) => toTypeString(val) === "[object Date]";
188
- const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
189
- const isFunction = (val) => typeof val === "function";
190
- const isString = (val) => typeof val === "string";
191
- const isSymbol = (val) => typeof val === "symbol";
192
- const isObject = (val) => val !== null && typeof val === "object";
193
- const isPromise = (val) => {
194
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
195
- };
196
- const objectToString = Object.prototype.toString;
197
- const toTypeString = (value) => objectToString.call(value);
198
- const toRawType = (value) => {
199
- return toTypeString(value).slice(8, -1);
200
- };
201
- const isPlainObject = (val) => toTypeString(val) === "[object Object]";
202
- const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
203
- const isReservedProp = /* @__PURE__ */ makeMap(
204
- // the leading comma is intentional so empty string "" is also included
205
- ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
206
- );
207
- const isBuiltInDirective = /* @__PURE__ */ makeMap(
208
- "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
209
- );
210
- const cacheStringFunction = (fn) => {
211
- const cache = /* @__PURE__ */ Object.create(null);
212
- return (str) => {
213
- const hit = cache[str];
214
- return hit || (cache[str] = fn(str));
215
- };
216
- };
217
- const camelizeRE = /-(\w)/g;
218
- const camelize = cacheStringFunction((str) => {
219
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
220
- });
221
- const hyphenateRE = /\B([A-Z])/g;
222
- const hyphenate = cacheStringFunction(
223
- (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
224
- );
225
- const capitalize = cacheStringFunction(
226
- (str) => str.charAt(0).toUpperCase() + str.slice(1)
227
- );
228
- const toHandlerKey = cacheStringFunction(
229
- (str) => str ? `on${capitalize(str)}` : ``
230
- );
231
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
232
- const invokeArrayFns = (fns, arg) => {
233
- for (let i = 0; i < fns.length; i++) {
234
- fns[i](arg);
235
- }
236
- };
237
- const def = (obj, key, value) => {
238
- Object.defineProperty(obj, key, {
239
- configurable: true,
240
- enumerable: false,
241
- value
242
- });
243
- };
244
- const looseToNumber = (val) => {
245
- const n = parseFloat(val);
246
- return isNaN(n) ? val : n;
247
- };
248
- const toNumber = (val) => {
249
- const n = isString(val) ? Number(val) : NaN;
250
- return isNaN(n) ? val : n;
251
- };
252
- let _globalThis;
253
- const getGlobalThis = () => {
254
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
255
- };
256
-
257
257
  function warn$1(msg, ...args) {
258
258
  console.warn(`[Vue warn] ${msg}`, ...args);
259
259
  }
@@ -4038,8 +4038,8 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4038
4038
  return ret;
4039
4039
  }
4040
4040
 
4041
- function defineComponent(options) {
4042
- return isFunction(options) ? { setup: options, name: options.name } : options;
4041
+ function defineComponent(options, extraOptions) {
4042
+ return isFunction(options) ? extend({}, extraOptions, { setup: options, name: options.name }) : options;
4043
4043
  }
4044
4044
 
4045
4045
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -4615,7 +4615,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4615
4615
  function resolveComponent(name, maybeSelfReference) {
4616
4616
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
4617
4617
  }
4618
- const NULL_DYNAMIC_COMPONENT = Symbol();
4618
+ const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
4619
4619
  function resolveDynamicComponent(component) {
4620
4620
  if (isString(component)) {
4621
4621
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -6192,7 +6192,7 @@ If this is a native custom element, make sure to exclude it from component resol
6192
6192
  const hasDefault = hasOwn(opt, "default");
6193
6193
  if (hasDefault && value === void 0) {
6194
6194
  const defaultValue = opt.default;
6195
- if (opt.type !== Function && isFunction(defaultValue)) {
6195
+ if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
6196
6196
  const { propsDefaults } = instance;
6197
6197
  if (key in propsDefaults) {
6198
6198
  value = propsDefaults[key];
@@ -6331,7 +6331,7 @@ If this is a native custom element, make sure to exclude it from component resol
6331
6331
  }
6332
6332
  }
6333
6333
  function validateProp(name, value, prop, isAbsent) {
6334
- const { type, required, validator } = prop;
6334
+ const { type, required, validator, skipCheck } = prop;
6335
6335
  if (required && isAbsent) {
6336
6336
  warn('Missing required prop: "' + name + '"');
6337
6337
  return;
@@ -6339,7 +6339,7 @@ If this is a native custom element, make sure to exclude it from component resol
6339
6339
  if (value == null && !prop.required) {
6340
6340
  return;
6341
6341
  }
6342
- if (type != null && type !== true) {
6342
+ if (type != null && type !== true && !skipCheck) {
6343
6343
  let isValid = false;
6344
6344
  const types = isArray(type) ? type : [type];
6345
6345
  const expectedTypes = [];
@@ -6581,7 +6581,7 @@ If this is a native custom element, make sure to exclude it from component resol
6581
6581
  return vm;
6582
6582
  }
6583
6583
  }
6584
- Vue.version = `2.6.14-compat:${"3.3.0-alpha.4"}`;
6584
+ Vue.version = `2.6.14-compat:${"3.3.0-alpha.6"}`;
6585
6585
  Vue.config = singletonApp.config;
6586
6586
  Vue.use = (p, ...options) => {
6587
6587
  if (p && isFunction(p.install)) {
@@ -9476,10 +9476,10 @@ If you want to remount the same app, move your app creation logic into a factory
9476
9476
  return comp;
9477
9477
  }
9478
9478
 
9479
- const Fragment = Symbol("Fragment" );
9480
- const Text = Symbol("Text" );
9481
- const Comment = Symbol("Comment" );
9482
- const Static = Symbol("Static" );
9479
+ const Fragment = Symbol.for("v-fgt");
9480
+ const Text = Symbol.for("v-txt");
9481
+ const Comment = Symbol.for("v-cmt");
9482
+ const Static = Symbol.for("v-stc");
9483
9483
  const blockStack = [];
9484
9484
  let currentBlock = null;
9485
9485
  function openBlock(disableTracking = false) {
@@ -9941,13 +9941,19 @@ Component that was made reactive: `,
9941
9941
  }
9942
9942
  let currentInstance = null;
9943
9943
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
9944
+ let internalSetCurrentInstance;
9945
+ {
9946
+ internalSetCurrentInstance = (i) => {
9947
+ currentInstance = i;
9948
+ };
9949
+ }
9944
9950
  const setCurrentInstance = (instance) => {
9945
- currentInstance = instance;
9951
+ internalSetCurrentInstance(instance);
9946
9952
  instance.scope.on();
9947
9953
  };
9948
9954
  const unsetCurrentInstance = () => {
9949
9955
  currentInstance && currentInstance.scope.off();
9950
- currentInstance = null;
9956
+ internalSetCurrentInstance(null);
9951
9957
  };
9952
9958
  const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
9953
9959
  function validateComponentName(name, config) {
@@ -10268,6 +10274,11 @@ Component that was made reactive: `,
10268
10274
  warnRuntimeUsage(`defineExpose`);
10269
10275
  }
10270
10276
  }
10277
+ function defineOptions(options) {
10278
+ {
10279
+ warnRuntimeUsage(`defineOptions`);
10280
+ }
10281
+ }
10271
10282
  function withDefaults(props, defaults) {
10272
10283
  {
10273
10284
  warnRuntimeUsage(`withDefaults`);
@@ -10293,18 +10304,23 @@ Component that was made reactive: `,
10293
10304
  {}
10294
10305
  ) : raw;
10295
10306
  for (const key in defaults) {
10296
- const opt = props[key];
10307
+ if (key.startsWith("__skip"))
10308
+ continue;
10309
+ let opt = props[key];
10297
10310
  if (opt) {
10298
10311
  if (isArray(opt) || isFunction(opt)) {
10299
- props[key] = { type: opt, default: defaults[key] };
10312
+ opt = props[key] = { type: opt, default: defaults[key] };
10300
10313
  } else {
10301
10314
  opt.default = defaults[key];
10302
10315
  }
10303
10316
  } else if (opt === null) {
10304
- props[key] = { default: defaults[key] };
10317
+ opt = props[key] = { default: defaults[key] };
10305
10318
  } else {
10306
10319
  warn(`props default key "${key}" has no corresponding declaration.`);
10307
10320
  }
10321
+ if (opt && defaults[`__skip_${key}`]) {
10322
+ opt.skipFactory = true;
10323
+ }
10308
10324
  }
10309
10325
  return props;
10310
10326
  }
@@ -10359,7 +10375,7 @@ Component that was made reactive: `,
10359
10375
  }
10360
10376
  }
10361
10377
 
10362
- const ssrContextKey = Symbol(`ssrContext` );
10378
+ const ssrContextKey = Symbol.for("v-scx");
10363
10379
  const useSSRContext = () => {
10364
10380
  {
10365
10381
  warn(`useSSRContext() is not supported in the global build.`);
@@ -10567,7 +10583,7 @@ Component that was made reactive: `,
10567
10583
  return true;
10568
10584
  }
10569
10585
 
10570
- const version = "3.3.0-alpha.4";
10586
+ const version = "3.3.0-alpha.6";
10571
10587
  const ssrUtils = null;
10572
10588
  const resolveFilter = resolveFilter$1 ;
10573
10589
  const _compatUtils = {
@@ -12211,6 +12227,7 @@ Component that was made reactive: `,
12211
12227
  defineCustomElement: defineCustomElement,
12212
12228
  defineEmits: defineEmits,
12213
12229
  defineExpose: defineExpose,
12230
+ defineOptions: defineOptions,
12214
12231
  defineProps: defineProps,
12215
12232
  defineSSRCustomElement: defineSSRCustomElement,
12216
12233
  get devtools () { return devtools; },