@vue/compat 3.4.0-alpha.3 → 3.4.0-alpha.4

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.
@@ -8,8 +8,8 @@ const EMPTY_ARR = Object.freeze([]) ;
8
8
  const NOOP = () => {
9
9
  };
10
10
  const NO = () => false;
11
- const onRE = /^on[^a-z]/;
12
- const isOn = (key) => onRE.test(key);
11
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
12
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
13
13
  const isModelListener = (key) => key.startsWith("onUpdate:");
14
14
  const extend = Object.assign;
15
15
  const remove = (arr, el) => {
@@ -94,7 +94,7 @@ const getGlobalThis = () => {
94
94
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
95
95
  };
96
96
 
97
- const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
97
+ const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
98
98
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
99
99
 
100
100
  function normalizeStyle(value) {
@@ -1433,6 +1433,18 @@ function propertyToRef(source, key, defaultValue) {
1433
1433
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1434
1434
  }
1435
1435
 
1436
+ const TrackOpTypes = {
1437
+ "GET": "get",
1438
+ "HAS": "has",
1439
+ "ITERATE": "iterate"
1440
+ };
1441
+ const TriggerOpTypes = {
1442
+ "SET": "set",
1443
+ "ADD": "add",
1444
+ "DELETE": "delete",
1445
+ "CLEAR": "clear"
1446
+ };
1447
+
1436
1448
  const stack = [];
1437
1449
  function pushWarningContext(vnode) {
1438
1450
  stack.push(vnode);
@@ -1547,6 +1559,38 @@ function assertNumber(val, type) {
1547
1559
  }
1548
1560
  }
1549
1561
 
1562
+ const ErrorCodes = {
1563
+ "SETUP_FUNCTION": 0,
1564
+ "0": "SETUP_FUNCTION",
1565
+ "RENDER_FUNCTION": 1,
1566
+ "1": "RENDER_FUNCTION",
1567
+ "WATCH_GETTER": 2,
1568
+ "2": "WATCH_GETTER",
1569
+ "WATCH_CALLBACK": 3,
1570
+ "3": "WATCH_CALLBACK",
1571
+ "WATCH_CLEANUP": 4,
1572
+ "4": "WATCH_CLEANUP",
1573
+ "NATIVE_EVENT_HANDLER": 5,
1574
+ "5": "NATIVE_EVENT_HANDLER",
1575
+ "COMPONENT_EVENT_HANDLER": 6,
1576
+ "6": "COMPONENT_EVENT_HANDLER",
1577
+ "VNODE_HOOK": 7,
1578
+ "7": "VNODE_HOOK",
1579
+ "DIRECTIVE_HOOK": 8,
1580
+ "8": "DIRECTIVE_HOOK",
1581
+ "TRANSITION_HOOK": 9,
1582
+ "9": "TRANSITION_HOOK",
1583
+ "APP_ERROR_HANDLER": 10,
1584
+ "10": "APP_ERROR_HANDLER",
1585
+ "APP_WARN_HANDLER": 11,
1586
+ "11": "APP_WARN_HANDLER",
1587
+ "FUNCTION_REF": 12,
1588
+ "12": "FUNCTION_REF",
1589
+ "ASYNC_COMPONENT_LOADER": 13,
1590
+ "13": "ASYNC_COMPONENT_LOADER",
1591
+ "SCHEDULER": 14,
1592
+ "14": "SCHEDULER"
1593
+ };
1550
1594
  const ErrorTypeStrings$1 = {
1551
1595
  ["sp"]: "serverPrefetch hook",
1552
1596
  ["bc"]: "beforeCreate hook",
@@ -2029,6 +2073,50 @@ function devtoolsComponentEmit(component, event, params) {
2029
2073
  );
2030
2074
  }
2031
2075
 
2076
+ const DeprecationTypes$1 = {
2077
+ "GLOBAL_MOUNT": "GLOBAL_MOUNT",
2078
+ "GLOBAL_MOUNT_CONTAINER": "GLOBAL_MOUNT_CONTAINER",
2079
+ "GLOBAL_EXTEND": "GLOBAL_EXTEND",
2080
+ "GLOBAL_PROTOTYPE": "GLOBAL_PROTOTYPE",
2081
+ "GLOBAL_SET": "GLOBAL_SET",
2082
+ "GLOBAL_DELETE": "GLOBAL_DELETE",
2083
+ "GLOBAL_OBSERVABLE": "GLOBAL_OBSERVABLE",
2084
+ "GLOBAL_PRIVATE_UTIL": "GLOBAL_PRIVATE_UTIL",
2085
+ "CONFIG_SILENT": "CONFIG_SILENT",
2086
+ "CONFIG_DEVTOOLS": "CONFIG_DEVTOOLS",
2087
+ "CONFIG_KEY_CODES": "CONFIG_KEY_CODES",
2088
+ "CONFIG_PRODUCTION_TIP": "CONFIG_PRODUCTION_TIP",
2089
+ "CONFIG_IGNORED_ELEMENTS": "CONFIG_IGNORED_ELEMENTS",
2090
+ "CONFIG_WHITESPACE": "CONFIG_WHITESPACE",
2091
+ "CONFIG_OPTION_MERGE_STRATS": "CONFIG_OPTION_MERGE_STRATS",
2092
+ "INSTANCE_SET": "INSTANCE_SET",
2093
+ "INSTANCE_DELETE": "INSTANCE_DELETE",
2094
+ "INSTANCE_DESTROY": "INSTANCE_DESTROY",
2095
+ "INSTANCE_EVENT_EMITTER": "INSTANCE_EVENT_EMITTER",
2096
+ "INSTANCE_EVENT_HOOKS": "INSTANCE_EVENT_HOOKS",
2097
+ "INSTANCE_CHILDREN": "INSTANCE_CHILDREN",
2098
+ "INSTANCE_LISTENERS": "INSTANCE_LISTENERS",
2099
+ "INSTANCE_SCOPED_SLOTS": "INSTANCE_SCOPED_SLOTS",
2100
+ "INSTANCE_ATTRS_CLASS_STYLE": "INSTANCE_ATTRS_CLASS_STYLE",
2101
+ "OPTIONS_DATA_FN": "OPTIONS_DATA_FN",
2102
+ "OPTIONS_DATA_MERGE": "OPTIONS_DATA_MERGE",
2103
+ "OPTIONS_BEFORE_DESTROY": "OPTIONS_BEFORE_DESTROY",
2104
+ "OPTIONS_DESTROYED": "OPTIONS_DESTROYED",
2105
+ "WATCH_ARRAY": "WATCH_ARRAY",
2106
+ "PROPS_DEFAULT_THIS": "PROPS_DEFAULT_THIS",
2107
+ "V_ON_KEYCODE_MODIFIER": "V_ON_KEYCODE_MODIFIER",
2108
+ "CUSTOM_DIR": "CUSTOM_DIR",
2109
+ "ATTR_FALSE_VALUE": "ATTR_FALSE_VALUE",
2110
+ "ATTR_ENUMERATED_COERCION": "ATTR_ENUMERATED_COERCION",
2111
+ "TRANSITION_CLASSES": "TRANSITION_CLASSES",
2112
+ "TRANSITION_GROUP_ROOT": "TRANSITION_GROUP_ROOT",
2113
+ "COMPONENT_ASYNC": "COMPONENT_ASYNC",
2114
+ "COMPONENT_FUNCTIONAL": "COMPONENT_FUNCTIONAL",
2115
+ "COMPONENT_V_MODEL": "COMPONENT_V_MODEL",
2116
+ "RENDER_FUNCTION": "RENDER_FUNCTION",
2117
+ "FILTERS": "FILTERS",
2118
+ "PRIVATE_APIS": "PRIVATE_APIS"
2119
+ };
2032
2120
  const deprecationData = {
2033
2121
  ["GLOBAL_MOUNT"]: {
2034
2122
  message: `The global app bootstrapping API has changed: vm.$mount() and the "el" option have been removed. Use createApp(RootComponent).mount() instead.`,
@@ -3343,7 +3431,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3343
3431
  if (delayEnter) {
3344
3432
  activeBranch.transition.afterLeave = () => {
3345
3433
  if (pendingId === suspense.pendingId) {
3346
- move(pendingBranch, container2, anchor2, 0);
3434
+ move(
3435
+ pendingBranch,
3436
+ container2,
3437
+ next(activeBranch),
3438
+ 0
3439
+ );
3347
3440
  queuePostFlushCb(effects);
3348
3441
  }
3349
3442
  };
@@ -3390,7 +3483,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3390
3483
  }
3391
3484
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3392
3485
  triggerEvent(vnode2, "onFallback");
3393
- const anchor2 = next(activeBranch);
3394
3486
  const mountFallback = () => {
3395
3487
  if (!suspense.isInFallback) {
3396
3488
  return;
@@ -3399,7 +3491,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3399
3491
  null,
3400
3492
  fallbackVNode,
3401
3493
  container2,
3402
- anchor2,
3494
+ next(activeBranch),
3403
3495
  parentComponent2,
3404
3496
  null,
3405
3497
  // fallback tree will not have suspense context
@@ -6257,7 +6349,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6257
6349
  return vm;
6258
6350
  }
6259
6351
  }
6260
- Vue.version = `2.6.14-compat:${"3.4.0-alpha.3"}`;
6352
+ Vue.version = `2.6.14-compat:${"3.4.0-alpha.4"}`;
6261
6353
  Vue.config = singletonApp.config;
6262
6354
  Vue.use = (p, ...options) => {
6263
6355
  if (p && isFunction(p.install)) {
@@ -6658,18 +6750,6 @@ function createAppAPI(render, hydrate) {
6658
6750
  rootProps = null;
6659
6751
  }
6660
6752
  const context = createAppContext();
6661
- {
6662
- Object.defineProperty(context.config, "unwrapInjectedRef", {
6663
- get() {
6664
- return true;
6665
- },
6666
- set() {
6667
- warn(
6668
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
6669
- );
6670
- }
6671
- });
6672
- }
6673
6753
  const installedPlugins = /* @__PURE__ */ new WeakSet();
6674
6754
  let isMounted = false;
6675
6755
  const app = context.app = {
@@ -10660,9 +10740,9 @@ function initCustomFormatter() {
10660
10740
  return;
10661
10741
  }
10662
10742
  const vueStyle = { style: "color:#3ba776" };
10663
- const numberStyle = { style: "color:#0b1bc9" };
10664
- const stringStyle = { style: "color:#b62e24" };
10665
- const keywordStyle = { style: "color:#9d288c" };
10743
+ const numberStyle = { style: "color:#1677ff" };
10744
+ const stringStyle = { style: "color:#f5222d" };
10745
+ const keywordStyle = { style: "color:#eb2f96" };
10666
10746
  const formatter = {
10667
10747
  header(obj) {
10668
10748
  if (!isObject(obj)) {
@@ -10856,7 +10936,7 @@ function isMemoSame(cached, memo) {
10856
10936
  return true;
10857
10937
  }
10858
10938
 
10859
- const version = "3.4.0-alpha.3";
10939
+ const version = "3.4.0-alpha.4";
10860
10940
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10861
10941
  const ssrUtils = null;
10862
10942
  const resolveFilter = resolveFilter$1 ;
@@ -10868,6 +10948,7 @@ const _compatUtils = {
10868
10948
  softAssertCompatEnabled
10869
10949
  };
10870
10950
  const compatUtils = _compatUtils ;
10951
+ const DeprecationTypes = DeprecationTypes$1 ;
10871
10952
 
10872
10953
  const svgNS = "http://www.w3.org/2000/svg";
10873
10954
  const doc = typeof document !== "undefined" ? document : null;
@@ -11556,7 +11637,8 @@ function patchStopImmediatePropagation(e, value) {
11556
11637
  }
11557
11638
  }
11558
11639
 
11559
- const nativeOnRE = /^on[a-z]/;
11640
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11641
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11560
11642
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11561
11643
  if (key === "class") {
11562
11644
  patchClass(el, nextValue, isSVG);
@@ -11590,7 +11672,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11590
11672
  if (key === "innerHTML" || key === "textContent") {
11591
11673
  return true;
11592
11674
  }
11593
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11675
+ if (key in el && isNativeOn(key) && isFunction(value)) {
11594
11676
  return true;
11595
11677
  }
11596
11678
  return false;
@@ -11607,7 +11689,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
11607
11689
  if (key === "type" && el.tagName === "TEXTAREA") {
11608
11690
  return false;
11609
11691
  }
11610
- if (nativeOnRE.test(key) && isString(value)) {
11692
+ if (key === "width" || key === "height") {
11693
+ const tag = el.tagName;
11694
+ return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
11695
+ }
11696
+ if (isNativeOn(key) && isString(value)) {
11611
11697
  return false;
11612
11698
  }
11613
11699
  return key in el;
@@ -12297,14 +12383,14 @@ const modifierGuards = {
12297
12383
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12298
12384
  };
12299
12385
  const withModifiers = (fn, modifiers) => {
12300
- return (event, ...args) => {
12386
+ return fn._withMods || (fn._withMods = (event, ...args) => {
12301
12387
  for (let i = 0; i < modifiers.length; i++) {
12302
12388
  const guard = modifierGuards[modifiers[i]];
12303
12389
  if (guard && guard(event, modifiers))
12304
12390
  return;
12305
12391
  }
12306
12392
  return fn(event, ...args);
12307
- };
12393
+ });
12308
12394
  };
12309
12395
  const keyNames = {
12310
12396
  esc: "escape",
@@ -12332,7 +12418,7 @@ const withKeys = (fn, modifiers) => {
12332
12418
  );
12333
12419
  }
12334
12420
  }
12335
- return (event) => {
12421
+ return fn._withKeys || (fn._withKeys = (event) => {
12336
12422
  if (!("key" in event)) {
12337
12423
  return;
12338
12424
  }
@@ -12360,7 +12446,7 @@ const withKeys = (fn, modifiers) => {
12360
12446
  }
12361
12447
  }
12362
12448
  }
12363
- };
12449
+ });
12364
12450
  };
12365
12451
 
12366
12452
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12491,7 +12577,9 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12491
12577
  BaseTransition: BaseTransition,
12492
12578
  BaseTransitionPropsValidators: BaseTransitionPropsValidators,
12493
12579
  Comment: Comment,
12580
+ DeprecationTypes: DeprecationTypes,
12494
12581
  EffectScope: EffectScope,
12582
+ ErrorCodes: ErrorCodes,
12495
12583
  ErrorTypeStrings: ErrorTypeStrings,
12496
12584
  Fragment: Fragment,
12497
12585
  KeepAlive: KeepAlive,
@@ -12500,8 +12588,10 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12500
12588
  Suspense: Suspense,
12501
12589
  Teleport: Teleport,
12502
12590
  Text: Text,
12591
+ TrackOpTypes: TrackOpTypes,
12503
12592
  Transition: Transition,
12504
12593
  TransitionGroup: TransitionGroup,
12594
+ TriggerOpTypes: TriggerOpTypes,
12505
12595
  VueElement: VueElement,
12506
12596
  assertNumber: assertNumber,
12507
12597
  callWithAsyncErrorHandling: callWithAsyncErrorHandling,
@@ -12689,4 +12779,4 @@ var Vue$1 = Vue;
12689
12779
 
12690
12780
  const { configureCompat } = Vue$1;
12691
12781
 
12692
- export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
12782
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };