@vue/compat 3.2.30 → 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.
@@ -349,8 +349,17 @@ function warn(msg, ...args) {
349
349
  let activeEffectScope;
350
350
  class EffectScope {
351
351
  constructor(detached = false) {
352
+ /**
353
+ * @internal
354
+ */
352
355
  this.active = true;
356
+ /**
357
+ * @internal
358
+ */
353
359
  this.effects = [];
360
+ /**
361
+ * @internal
362
+ */
354
363
  this.cleanups = [];
355
364
  if (!detached && activeEffectScope) {
356
365
  this.parent = activeEffectScope;
@@ -360,21 +369,30 @@ class EffectScope {
360
369
  }
361
370
  run(fn) {
362
371
  if (this.active) {
372
+ const currentEffectScope = activeEffectScope;
363
373
  try {
364
374
  activeEffectScope = this;
365
375
  return fn();
366
376
  }
367
377
  finally {
368
- activeEffectScope = this.parent;
378
+ activeEffectScope = currentEffectScope;
369
379
  }
370
380
  }
371
381
  else if ((process.env.NODE_ENV !== 'production')) {
372
382
  warn(`cannot run an inactive effect scope.`);
373
383
  }
374
384
  }
385
+ /**
386
+ * This should only be called on non-detached scopes
387
+ * @internal
388
+ */
375
389
  on() {
376
390
  activeEffectScope = this;
377
391
  }
392
+ /**
393
+ * This should only be called on non-detached scopes
394
+ * @internal
395
+ */
378
396
  off() {
379
397
  activeEffectScope = this.parent;
380
398
  }
@@ -516,10 +534,17 @@ class ReactiveEffect {
516
534
  activeEffect = this.parent;
517
535
  shouldTrack = lastShouldTrack;
518
536
  this.parent = undefined;
537
+ if (this.deferStop) {
538
+ this.stop();
539
+ }
519
540
  }
520
541
  }
521
542
  stop() {
522
- if (this.active) {
543
+ // stopped while running itself - defer the cleanup
544
+ if (activeEffect === this) {
545
+ this.deferStop = true;
546
+ }
547
+ else if (this.active) {
523
548
  cleanupEffect(this);
524
549
  if (this.onStop) {
525
550
  this.onStop();
@@ -599,9 +624,7 @@ function trackEffects(dep, debuggerEventExtraInfo) {
599
624
  dep.add(activeEffect);
600
625
  activeEffect.deps.push(dep);
601
626
  if ((process.env.NODE_ENV !== 'production') && activeEffect.onTrack) {
602
- activeEffect.onTrack(Object.assign({
603
- effect: activeEffect
604
- }, debuggerEventExtraInfo));
627
+ activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo));
605
628
  }
606
629
  }
607
630
  }
@@ -704,7 +727,9 @@ function triggerEffects(dep, debuggerEventExtraInfo) {
704
727
  }
705
728
 
706
729
  const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
707
- const builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol)
730
+ const builtInSymbols = new Set(
731
+ /*#__PURE__*/
732
+ Object.getOwnPropertyNames(Symbol)
708
733
  .map(key => Symbol[key])
709
734
  .filter(isSymbol));
710
735
  const get = /*#__PURE__*/ createGetter();
@@ -856,13 +881,13 @@ const readonlyHandlers = {
856
881
  get: readonlyGet,
857
882
  set(target, key) {
858
883
  if ((process.env.NODE_ENV !== 'production')) {
859
- console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
884
+ warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
860
885
  }
861
886
  return true;
862
887
  },
863
888
  deleteProperty(target, key) {
864
889
  if ((process.env.NODE_ENV !== 'production')) {
865
- console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
890
+ warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
866
891
  }
867
892
  return true;
868
893
  }
@@ -1702,7 +1727,7 @@ let preFlushIndex = 0;
1702
1727
  const pendingPostFlushCbs = [];
1703
1728
  let activePostFlushCbs = null;
1704
1729
  let postFlushIndex = 0;
1705
- const resolvedPromise = Promise.resolve();
1730
+ const resolvedPromise = /*#__PURE__*/ Promise.resolve();
1706
1731
  let currentFlushPromise = null;
1707
1732
  let currentPreFlushParentJob = null;
1708
1733
  const RECURSION_LIMIT = 100;
@@ -2642,6 +2667,8 @@ function compatModelEmit(instance, event, args) {
2642
2667
  }
2643
2668
 
2644
2669
  function emit$2(instance, event, ...rawArgs) {
2670
+ if (instance.isUnmounted)
2671
+ return;
2645
2672
  const props = instance.vnode.props || EMPTY_OBJ;
2646
2673
  if ((process.env.NODE_ENV !== 'production')) {
2647
2674
  const { emitsOptions, propsOptions: [propsOptions] } = instance;
@@ -3661,13 +3688,11 @@ function watchEffect(effect, options) {
3661
3688
  }
3662
3689
  function watchPostEffect(effect, options) {
3663
3690
  return doWatch(effect, null, ((process.env.NODE_ENV !== 'production')
3664
- ? Object.assign(options || {}, { flush: 'post' })
3665
- : { flush: 'post' }));
3691
+ ? Object.assign(Object.assign({}, options), { flush: 'post' }) : { flush: 'post' }));
3666
3692
  }
3667
3693
  function watchSyncEffect(effect, options) {
3668
3694
  return doWatch(effect, null, ((process.env.NODE_ENV !== 'production')
3669
- ? Object.assign(options || {}, { flush: 'sync' })
3670
- : { flush: 'sync' }));
3695
+ ? Object.assign(Object.assign({}, options), { flush: 'sync' }) : { flush: 'sync' }));
3671
3696
  }
3672
3697
  // initial value for watchers to trigger on undefined initial values
3673
3698
  const INITIAL_WATCHER_VALUE = {};
@@ -3983,10 +4008,24 @@ const BaseTransitionImpl = {
3983
4008
  if (!children || !children.length) {
3984
4009
  return;
3985
4010
  }
3986
- // warn multiple elements
3987
- if ((process.env.NODE_ENV !== 'production') && children.length > 1) {
3988
- warn$1('<transition> can only be used on a single element or component. Use ' +
3989
- '<transition-group> for lists.');
4011
+ let child = children[0];
4012
+ if (children.length > 1) {
4013
+ let hasFound = false;
4014
+ // locate first non-comment child
4015
+ for (const c of children) {
4016
+ if (c.type !== Comment) {
4017
+ if ((process.env.NODE_ENV !== 'production') && hasFound) {
4018
+ // warn more than one non-comment child
4019
+ warn$1('<transition> can only be used on a single element or component. ' +
4020
+ 'Use <transition-group> for lists.');
4021
+ break;
4022
+ }
4023
+ child = c;
4024
+ hasFound = true;
4025
+ if (!(process.env.NODE_ENV !== 'production'))
4026
+ break;
4027
+ }
4028
+ }
3990
4029
  }
3991
4030
  // there's no need to track reactivity for these props so use the raw
3992
4031
  // props for a bit better perf
@@ -3995,11 +4034,11 @@ const BaseTransitionImpl = {
3995
4034
  // check mode
3996
4035
  if ((process.env.NODE_ENV !== 'production') &&
3997
4036
  mode &&
3998
- mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
4037
+ mode !== 'in-out' &&
4038
+ mode !== 'out-in' &&
4039
+ mode !== 'default') {
3999
4040
  warn$1(`invalid <transition> mode: ${mode}`);
4000
4041
  }
4001
- // at this point children has a guaranteed length of 1.
4002
- const child = children[0];
4003
4042
  if (state.isLeaving) {
4004
4043
  return emptyPlaceholder(child);
4005
4044
  }
@@ -4225,20 +4264,24 @@ function setTransitionHooks(vnode, hooks) {
4225
4264
  vnode.transition = hooks;
4226
4265
  }
4227
4266
  }
4228
- function getTransitionRawChildren(children, keepComment = false) {
4267
+ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4229
4268
  let ret = [];
4230
4269
  let keyedFragmentCount = 0;
4231
4270
  for (let i = 0; i < children.length; i++) {
4232
- const child = children[i];
4271
+ let child = children[i];
4272
+ // #5360 inherit parent key in case of <template v-for>
4273
+ const key = parentKey == null
4274
+ ? child.key
4275
+ : String(parentKey) + String(child.key != null ? child.key : i);
4233
4276
  // handle fragment children case, e.g. v-for
4234
4277
  if (child.type === Fragment) {
4235
4278
  if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
4236
4279
  keyedFragmentCount++;
4237
- ret = ret.concat(getTransitionRawChildren(child.children, keepComment));
4280
+ ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
4238
4281
  }
4239
4282
  // comment placeholders should be skipped, e.g. v-if
4240
4283
  else if (keepComment || child.type !== Comment) {
4241
- ret.push(child);
4284
+ ret.push(key != null ? cloneVNode(child, { key }) : child);
4242
4285
  }
4243
4286
  }
4244
4287
  // #1126 if a transition children list contains multiple sub fragments, these
@@ -5303,6 +5346,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
5303
5346
  const propsToUpdate = instance.vnode.dynamicProps;
5304
5347
  for (let i = 0; i < propsToUpdate.length; i++) {
5305
5348
  let key = propsToUpdate[i];
5349
+ // skip if the prop key is a declared emit event listener
5350
+ if (isEmitListener(instance.emitsOptions, key)) {
5351
+ continue;
5352
+ }
5306
5353
  // PROPS flag guarantees rawProps to be non-null
5307
5354
  const value = rawProps[key];
5308
5355
  if (options) {
@@ -5890,7 +5937,8 @@ function withDirectives(vnode, directives) {
5890
5937
  (process.env.NODE_ENV !== 'production') && warn$1(`withDirectives can only be used inside render functions.`);
5891
5938
  return vnode;
5892
5939
  }
5893
- const instance = internalInstance.proxy;
5940
+ const instance = getExposeProxy(internalInstance) ||
5941
+ internalInstance.proxy;
5894
5942
  const bindings = vnode.dirs || (vnode.dirs = []);
5895
5943
  for (let i = 0; i < directives.length; i++) {
5896
5944
  let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
@@ -6010,7 +6058,7 @@ function createCompatVue(createApp, createSingletonApp) {
6010
6058
  return vm;
6011
6059
  }
6012
6060
  }
6013
- Vue.version = `2.6.14-compat:${"3.2.30"}`;
6061
+ Vue.version = `2.6.14-compat:${"3.2.33"}`;
6014
6062
  Vue.config = singletonApp.config;
6015
6063
  Vue.use = (p, ...options) => {
6016
6064
  if (p && isFunction(p.install)) {
@@ -6439,6 +6487,9 @@ function createAppContext() {
6439
6487
  let uid = 0;
6440
6488
  function createAppAPI(render, hydrate) {
6441
6489
  return function createApp(rootComponent, rootProps = null) {
6490
+ if (!isFunction(rootComponent)) {
6491
+ rootComponent = Object.assign({}, rootComponent);
6492
+ }
6442
6493
  if (rootProps != null && !isObject(rootProps)) {
6443
6494
  (process.env.NODE_ENV !== 'production') && warn$1(`root props passed to app.mount() must be an object.`);
6444
6495
  rootProps = null;
@@ -6641,6 +6692,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6641
6692
  if (!isArray(existing)) {
6642
6693
  if (_isString) {
6643
6694
  refs[ref] = [refValue];
6695
+ if (hasOwn(setupState, ref)) {
6696
+ setupState[ref] = refs[ref];
6697
+ }
6644
6698
  }
6645
6699
  else {
6646
6700
  ref.value = [refValue];
@@ -6841,7 +6895,8 @@ function createHydrationFunctions(rendererInternals) {
6841
6895
  // e.g. <option :value="obj">, <input type="checkbox" :true-value="1">
6842
6896
  const forcePatchValue = (type === 'input' && dirs) || type === 'option';
6843
6897
  // skip props & children if this is hoisted static nodes
6844
- if (forcePatchValue || patchFlag !== -1 /* HOISTED */) {
6898
+ // #5405 in dev, always hydrate children for HMR
6899
+ if ((process.env.NODE_ENV !== 'production') || forcePatchValue || patchFlag !== -1 /* HOISTED */) {
6845
6900
  if (dirs) {
6846
6901
  invokeDirectiveHook(vnode, null, parentComponent, 'created');
6847
6902
  }
@@ -7016,7 +7071,7 @@ function startMeasure(instance, type) {
7016
7071
  perf.mark(`vue-${type}-${instance.uid}`);
7017
7072
  }
7018
7073
  if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
7019
- devtoolsPerfStart(instance, type, supported ? perf.now() : Date.now());
7074
+ devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
7020
7075
  }
7021
7076
  }
7022
7077
  function endMeasure(instance, type) {
@@ -7029,7 +7084,7 @@ function endMeasure(instance, type) {
7029
7084
  perf.clearMarks(endTag);
7030
7085
  }
7031
7086
  if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {
7032
- devtoolsPerfEnd(instance, type, supported ? perf.now() : Date.now());
7087
+ devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
7033
7088
  }
7034
7089
  }
7035
7090
  function isSupported() {
@@ -8218,7 +8273,23 @@ function baseCreateRenderer(options, createHydrationFns) {
8218
8273
  const remove = vnode => {
8219
8274
  const { type, el, anchor, transition } = vnode;
8220
8275
  if (type === Fragment) {
8221
- removeFragment(el, anchor);
8276
+ if ((process.env.NODE_ENV !== 'production') &&
8277
+ vnode.patchFlag > 0 &&
8278
+ vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
8279
+ transition &&
8280
+ !transition.persisted) {
8281
+ vnode.children.forEach(child => {
8282
+ if (child.type === Comment) {
8283
+ hostRemove(child.el);
8284
+ }
8285
+ else {
8286
+ remove(child);
8287
+ }
8288
+ });
8289
+ }
8290
+ else {
8291
+ removeFragment(el, anchor);
8292
+ }
8222
8293
  return;
8223
8294
  }
8224
8295
  if (type === Static) {
@@ -9616,7 +9687,10 @@ function renderSlot(slots, name, props = {},
9616
9687
  // this is not a user-facing function, so the fallback is always generated by
9617
9688
  // the compiler and guaranteed to be a function returning an array
9618
9689
  fallback, noSlotted) {
9619
- if (currentRenderingInstance.isCE) {
9690
+ if (currentRenderingInstance.isCE ||
9691
+ (currentRenderingInstance.parent &&
9692
+ isAsyncWrapper(currentRenderingInstance.parent) &&
9693
+ currentRenderingInstance.parent.isCE)) {
9620
9694
  return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());
9621
9695
  }
9622
9696
  let slot = slots[name];
@@ -9906,7 +9980,10 @@ const getPublicInstance = (i) => {
9906
9980
  return getExposeProxy(i) || i.proxy;
9907
9981
  return getPublicInstance(i.parent);
9908
9982
  };
9909
- const publicPropertiesMap = extend(Object.create(null), {
9983
+ const publicPropertiesMap =
9984
+ // Move PURE marker to new line to workaround compiler discarding it
9985
+ // due to type annotation
9986
+ /*#__PURE__*/ extend(Object.create(null), {
9910
9987
  $: i => i,
9911
9988
  $el: i => i.vnode.el,
9912
9989
  $data: i => i.data,
@@ -10020,7 +10097,9 @@ const PublicInstanceProxyHandlers = {
10020
10097
  }
10021
10098
  else {
10022
10099
  const val = globalProperties[key];
10023
- return isFunction(val) ? val.bind(instance.proxy) : val;
10100
+ return isFunction(val)
10101
+ ? Object.assign(val.bind(instance.proxy), val)
10102
+ : val;
10024
10103
  }
10025
10104
  }
10026
10105
  }
@@ -10046,9 +10125,11 @@ const PublicInstanceProxyHandlers = {
10046
10125
  const { data, setupState, ctx } = instance;
10047
10126
  if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
10048
10127
  setupState[key] = value;
10128
+ return true;
10049
10129
  }
10050
10130
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
10051
10131
  data[key] = value;
10132
+ return true;
10052
10133
  }
10053
10134
  else if (hasOwn(instance.props, key)) {
10054
10135
  (process.env.NODE_ENV !== 'production') &&
@@ -10084,6 +10165,16 @@ const PublicInstanceProxyHandlers = {
10084
10165
  hasOwn(ctx, key) ||
10085
10166
  hasOwn(publicPropertiesMap, key) ||
10086
10167
  hasOwn(appContext.config.globalProperties, key));
10168
+ },
10169
+ defineProperty(target, key, descriptor) {
10170
+ if (descriptor.get != null) {
10171
+ // invalidate key cache of a getter based property #5417
10172
+ target._.accessCache[key] = 0;
10173
+ }
10174
+ else if (hasOwn(descriptor, 'value')) {
10175
+ this.set(target, key, descriptor.value, null);
10176
+ }
10177
+ return Reflect.defineProperty(target, key, descriptor);
10087
10178
  }
10088
10179
  };
10089
10180
  if ((process.env.NODE_ENV !== 'production') && !false) {
@@ -10289,6 +10380,7 @@ function setupComponent(instance, isSSR = false) {
10289
10380
  return setupResult;
10290
10381
  }
10291
10382
  function setupStatefulComponent(instance, isSSR) {
10383
+ var _a;
10292
10384
  const Component = instance.type;
10293
10385
  if ((process.env.NODE_ENV !== 'production')) {
10294
10386
  if (Component.name) {
@@ -10346,6 +10438,13 @@ function setupStatefulComponent(instance, isSSR) {
10346
10438
  // async setup returned Promise.
10347
10439
  // bail here and wait for re-entry.
10348
10440
  instance.asyncDep = setupResult;
10441
+ if ((process.env.NODE_ENV !== 'production') && !instance.suspense) {
10442
+ const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
10443
+ warn$1(`Component <${name}>: setup function returned a promise, but no ` +
10444
+ `<Suspense> boundary was found in the parent component tree. ` +
10445
+ `A component with async setup() must be nested in a <Suspense> ` +
10446
+ `in order to be rendered.`);
10447
+ }
10349
10448
  }
10350
10449
  }
10351
10450
  else {
@@ -10998,7 +11097,7 @@ function isMemoSame(cached, memo) {
10998
11097
  }
10999
11098
 
11000
11099
  // Core API ------------------------------------------------------------------
11001
- const version = "3.2.30";
11100
+ const version = "3.2.33";
11002
11101
  const _ssrUtils = {
11003
11102
  createComponentInstance,
11004
11103
  setupComponent,
@@ -11030,7 +11129,7 @@ const compatUtils = (_compatUtils );
11030
11129
 
11031
11130
  const svgNS = 'http://www.w3.org/2000/svg';
11032
11131
  const doc = (typeof document !== 'undefined' ? document : null);
11033
- const templateContainer = doc && doc.createElement('template');
11132
+ const templateContainer = doc && /*#__PURE__*/ doc.createElement('template');
11034
11133
  const nodeOps = {
11035
11134
  insert: (child, parent, anchor) => {
11036
11135
  parent.insertBefore(child, anchor || null);
@@ -11181,6 +11280,8 @@ function setStyle(style, name, val) {
11181
11280
  val.forEach(v => setStyle(style, name, v));
11182
11281
  }
11183
11282
  else {
11283
+ if (val == null)
11284
+ val = '';
11184
11285
  if (name.startsWith('--')) {
11185
11286
  // custom property definition
11186
11287
  style.setProperty(name, val);
@@ -11302,42 +11403,40 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
11302
11403
  }
11303
11404
  return;
11304
11405
  }
11406
+ let needRemove = false;
11305
11407
  if (value === '' || value == null) {
11306
11408
  const type = typeof el[key];
11307
11409
  if (type === 'boolean') {
11308
11410
  // e.g. <select multiple> compiles to { multiple: '' }
11309
- el[key] = includeBooleanAttr(value);
11310
- return;
11411
+ value = includeBooleanAttr(value);
11311
11412
  }
11312
11413
  else if (value == null && type === 'string') {
11313
11414
  // e.g. <div :id="null">
11314
- el[key] = '';
11315
- el.removeAttribute(key);
11316
- return;
11415
+ value = '';
11416
+ needRemove = true;
11317
11417
  }
11318
11418
  else if (type === 'number') {
11319
11419
  // e.g. <img :width="null">
11320
11420
  // the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error
11321
- try {
11322
- el[key] = 0;
11323
- }
11324
- catch (_a) { }
11325
- el.removeAttribute(key);
11326
- return;
11421
+ value = 0;
11422
+ needRemove = true;
11327
11423
  }
11328
11424
  }
11329
- if (value === false &&
11330
- compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent)) {
11331
- const type = typeof el[key];
11332
- if (type === 'string' || type === 'number') {
11333
- (process.env.NODE_ENV !== 'production') &&
11334
- compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent, key);
11335
- el[key] = type === 'number' ? 0 : '';
11336
- el.removeAttribute(key);
11337
- return;
11425
+ else {
11426
+ if (value === false &&
11427
+ compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent)) {
11428
+ const type = typeof el[key];
11429
+ if (type === 'string' || type === 'number') {
11430
+ (process.env.NODE_ENV !== 'production') &&
11431
+ compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent, key);
11432
+ value = type === 'number' ? 0 : '';
11433
+ needRemove = true;
11434
+ }
11338
11435
  }
11339
11436
  }
11340
- // some properties perform value validation and throw
11437
+ // some properties perform value validation and throw,
11438
+ // some properties has getter, no setter, will error in 'use strict'
11439
+ // eg. <select :type="null"></select> <select :willValidate="null"></select>
11341
11440
  try {
11342
11441
  el[key] = value;
11343
11442
  }
@@ -11347,31 +11446,35 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
11347
11446
  `value ${value} is invalid.`, e);
11348
11447
  }
11349
11448
  }
11449
+ needRemove && el.removeAttribute(key);
11350
11450
  }
11351
11451
 
11352
11452
  // Async edge case fix requires storing an event listener's attach timestamp.
11353
- let _getNow = Date.now;
11354
- let skipTimestampCheck = false;
11355
- if (typeof window !== 'undefined') {
11356
- // Determine what event timestamp the browser is using. Annoyingly, the
11357
- // timestamp can either be hi-res (relative to page load) or low-res
11358
- // (relative to UNIX epoch), so in order to compare time we have to use the
11359
- // same timestamp type when saving the flush timestamp.
11360
- if (_getNow() > document.createEvent('Event').timeStamp) {
11361
- // if the low-res timestamp which is bigger than the event timestamp
11362
- // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11363
- // and we need to use the hi-res version for event listeners as well.
11364
- _getNow = () => performance.now();
11365
- }
11366
- // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11367
- // and does not fire microtasks in between event propagation, so safe to exclude.
11368
- const ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i);
11369
- skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);
11370
- }
11453
+ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
11454
+ let _getNow = Date.now;
11455
+ let skipTimestampCheck = false;
11456
+ if (typeof window !== 'undefined') {
11457
+ // Determine what event timestamp the browser is using. Annoyingly, the
11458
+ // timestamp can either be hi-res (relative to page load) or low-res
11459
+ // (relative to UNIX epoch), so in order to compare time we have to use the
11460
+ // same timestamp type when saving the flush timestamp.
11461
+ if (Date.now() > document.createEvent('Event').timeStamp) {
11462
+ // if the low-res timestamp which is bigger than the event timestamp
11463
+ // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11464
+ // and we need to use the hi-res version for event listeners as well.
11465
+ _getNow = () => performance.now();
11466
+ }
11467
+ // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11468
+ // and does not fire microtasks in between event propagation, so safe to exclude.
11469
+ const ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i);
11470
+ skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);
11471
+ }
11472
+ return [_getNow, skipTimestampCheck];
11473
+ })();
11371
11474
  // To avoid the overhead of repeatedly calling performance.now(), we cache
11372
11475
  // and use the same timestamp for all event listeners attached in the same tick.
11373
11476
  let cachedNow = 0;
11374
- const p = Promise.resolve();
11477
+ const p = /*#__PURE__*/ Promise.resolve();
11375
11478
  const reset = () => {
11376
11479
  cachedNow = 0;
11377
11480
  };
@@ -11496,13 +11599,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
11496
11599
  }
11497
11600
  return false;
11498
11601
  }
11499
- // spellcheck and draggable are numerated attrs, however their
11500
- // corresponding DOM properties are actually booleans - this leads to
11501
- // setting it with a string "false" value leading it to be coerced to
11502
- // `true`, so we need to always treat them as attributes.
11602
+ // these are enumerated attrs, however their corresponding DOM properties
11603
+ // are actually booleans - this leads to setting it with a string "false"
11604
+ // value leading it to be coerced to `true`, so we need to always treat
11605
+ // them as attributes.
11503
11606
  // Note that `contentEditable` doesn't have this problem: its DOM
11504
11607
  // property is also enumerated string values.
11505
- if (key === 'spellcheck' || key === 'draggable') {
11608
+ if (key === 'spellcheck' || key === 'draggable' || key === 'translate') {
11506
11609
  return false;
11507
11610
  }
11508
11611
  // #1787, #2840 form property on form elements is readonly and must be set as
@@ -12682,7 +12785,7 @@ function initVShowForSSR() {
12682
12785
  };
12683
12786
  }
12684
12787
 
12685
- const rendererOptions = extend({ patchProp }, nodeOps);
12788
+ const rendererOptions = /*#__PURE__*/ extend({ patchProp }, nodeOps);
12686
12789
  // lazy create the renderer - this makes core renderer logic tree-shakable
12687
12790
  // in case the user only imports reactivity utilities from Vue.
12688
12791
  let renderer;