@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.
package/README.md CHANGED
@@ -308,7 +308,6 @@ Features that start with `COMPILER_` are compiler-specific: if you are using the
308
308
  | OPTIONS_BEFORE_DESTROY | ✔ | `beforeDestroy` -> `beforeUnmount` | |
309
309
  | OPTIONS_DESTROYED | ✔ | `destroyed` -> `unmounted` | |
310
310
  | WATCH_ARRAY | ✔ | watching an array no longer triggers on mutation unless deep | [link](https://v3-migration.vuejs.org/breaking-changes/watch.html) |
311
- | V_FOR_REF | ✔ | `ref` inside `v-for` no longer registers array of refs | [link](https://v3-migration.vuejs.org/breaking-changes/array-refs.html) |
312
311
  | V_ON_KEYCODE_MODIFIER | ✔ | `v-on` no longer supports keyCode modifiers | [link](https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html) |
313
312
  | CUSTOM_DIR | ✔ | Custom directive hook names changed | [link](https://v3-migration.vuejs.org/breaking-changes/custom-directives.html) |
314
313
  | ATTR_FALSE_VALUE | ✔ | No longer removes attribute if binding value is boolean `false` | [link](https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html) |
package/dist/vue.cjs.js CHANGED
@@ -564,8 +564,17 @@ function warn(msg, ...args) {
564
564
  let activeEffectScope;
565
565
  class EffectScope {
566
566
  constructor(detached = false) {
567
+ /**
568
+ * @internal
569
+ */
567
570
  this.active = true;
571
+ /**
572
+ * @internal
573
+ */
568
574
  this.effects = [];
575
+ /**
576
+ * @internal
577
+ */
569
578
  this.cleanups = [];
570
579
  if (!detached && activeEffectScope) {
571
580
  this.parent = activeEffectScope;
@@ -575,21 +584,30 @@ class EffectScope {
575
584
  }
576
585
  run(fn) {
577
586
  if (this.active) {
587
+ const currentEffectScope = activeEffectScope;
578
588
  try {
579
589
  activeEffectScope = this;
580
590
  return fn();
581
591
  }
582
592
  finally {
583
- activeEffectScope = this.parent;
593
+ activeEffectScope = currentEffectScope;
584
594
  }
585
595
  }
586
596
  else {
587
597
  warn(`cannot run an inactive effect scope.`);
588
598
  }
589
599
  }
600
+ /**
601
+ * This should only be called on non-detached scopes
602
+ * @internal
603
+ */
590
604
  on() {
591
605
  activeEffectScope = this;
592
606
  }
607
+ /**
608
+ * This should only be called on non-detached scopes
609
+ * @internal
610
+ */
593
611
  off() {
594
612
  activeEffectScope = this.parent;
595
613
  }
@@ -731,10 +749,17 @@ class ReactiveEffect {
731
749
  activeEffect = this.parent;
732
750
  shouldTrack = lastShouldTrack;
733
751
  this.parent = undefined;
752
+ if (this.deferStop) {
753
+ this.stop();
754
+ }
734
755
  }
735
756
  }
736
757
  stop() {
737
- if (this.active) {
758
+ // stopped while running itself - defer the cleanup
759
+ if (activeEffect === this) {
760
+ this.deferStop = true;
761
+ }
762
+ else if (this.active) {
738
763
  cleanupEffect(this);
739
764
  if (this.onStop) {
740
765
  this.onStop();
@@ -813,9 +838,7 @@ function trackEffects(dep, debuggerEventExtraInfo) {
813
838
  dep.add(activeEffect);
814
839
  activeEffect.deps.push(dep);
815
840
  if (activeEffect.onTrack) {
816
- activeEffect.onTrack(Object.assign({
817
- effect: activeEffect
818
- }, debuggerEventExtraInfo));
841
+ activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo));
819
842
  }
820
843
  }
821
844
  }
@@ -911,7 +934,9 @@ function triggerEffects(dep, debuggerEventExtraInfo) {
911
934
  }
912
935
 
913
936
  const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
914
- const builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol)
937
+ const builtInSymbols = new Set(
938
+ /*#__PURE__*/
939
+ Object.getOwnPropertyNames(Symbol)
915
940
  .map(key => Symbol[key])
916
941
  .filter(isSymbol));
917
942
  const get = /*#__PURE__*/ createGetter();
@@ -1063,13 +1088,13 @@ const readonlyHandlers = {
1063
1088
  get: readonlyGet,
1064
1089
  set(target, key) {
1065
1090
  {
1066
- console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
1091
+ warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
1067
1092
  }
1068
1093
  return true;
1069
1094
  },
1070
1095
  deleteProperty(target, key) {
1071
1096
  {
1072
- console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
1097
+ warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
1073
1098
  }
1074
1099
  return true;
1075
1100
  }
@@ -1897,7 +1922,7 @@ let preFlushIndex = 0;
1897
1922
  const pendingPostFlushCbs = [];
1898
1923
  let activePostFlushCbs = null;
1899
1924
  let postFlushIndex = 0;
1900
- const resolvedPromise = Promise.resolve();
1925
+ const resolvedPromise = /*#__PURE__*/ Promise.resolve();
1901
1926
  let currentFlushPromise = null;
1902
1927
  let currentPreFlushParentJob = null;
1903
1928
  const RECURSION_LIMIT = 100;
@@ -2831,6 +2856,8 @@ function compatModelEmit(instance, event, args) {
2831
2856
  }
2832
2857
 
2833
2858
  function emit$2(instance, event, ...rawArgs) {
2859
+ if (instance.isUnmounted)
2860
+ return;
2834
2861
  const props = instance.vnode.props || EMPTY_OBJ;
2835
2862
  {
2836
2863
  const { emitsOptions, propsOptions: [propsOptions] } = instance;
@@ -3848,12 +3875,10 @@ function watchEffect(effect, options) {
3848
3875
  return doWatch(effect, null, options);
3849
3876
  }
3850
3877
  function watchPostEffect(effect, options) {
3851
- return doWatch(effect, null, (Object.assign(options || {}, { flush: 'post' })
3852
- ));
3878
+ return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'post' }) ));
3853
3879
  }
3854
3880
  function watchSyncEffect(effect, options) {
3855
- return doWatch(effect, null, (Object.assign(options || {}, { flush: 'sync' })
3856
- ));
3881
+ return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'sync' }) ));
3857
3882
  }
3858
3883
  // initial value for watchers to trigger on undefined initial values
3859
3884
  const INITIAL_WATCHER_VALUE = {};
@@ -4169,10 +4194,22 @@ const BaseTransitionImpl = {
4169
4194
  if (!children || !children.length) {
4170
4195
  return;
4171
4196
  }
4172
- // warn multiple elements
4197
+ let child = children[0];
4173
4198
  if (children.length > 1) {
4174
- warn$1('<transition> can only be used on a single element or component. Use ' +
4175
- '<transition-group> for lists.');
4199
+ let hasFound = false;
4200
+ // locate first non-comment child
4201
+ for (const c of children) {
4202
+ if (c.type !== Comment) {
4203
+ if (hasFound) {
4204
+ // warn more than one non-comment child
4205
+ warn$1('<transition> can only be used on a single element or component. ' +
4206
+ 'Use <transition-group> for lists.');
4207
+ break;
4208
+ }
4209
+ child = c;
4210
+ hasFound = true;
4211
+ }
4212
+ }
4176
4213
  }
4177
4214
  // there's no need to track reactivity for these props so use the raw
4178
4215
  // props for a bit better perf
@@ -4180,11 +4217,11 @@ const BaseTransitionImpl = {
4180
4217
  const { mode } = rawProps;
4181
4218
  // check mode
4182
4219
  if (mode &&
4183
- mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
4220
+ mode !== 'in-out' &&
4221
+ mode !== 'out-in' &&
4222
+ mode !== 'default') {
4184
4223
  warn$1(`invalid <transition> mode: ${mode}`);
4185
4224
  }
4186
- // at this point children has a guaranteed length of 1.
4187
- const child = children[0];
4188
4225
  if (state.isLeaving) {
4189
4226
  return emptyPlaceholder(child);
4190
4227
  }
@@ -4410,20 +4447,24 @@ function setTransitionHooks(vnode, hooks) {
4410
4447
  vnode.transition = hooks;
4411
4448
  }
4412
4449
  }
4413
- function getTransitionRawChildren(children, keepComment = false) {
4450
+ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4414
4451
  let ret = [];
4415
4452
  let keyedFragmentCount = 0;
4416
4453
  for (let i = 0; i < children.length; i++) {
4417
- const child = children[i];
4454
+ let child = children[i];
4455
+ // #5360 inherit parent key in case of <template v-for>
4456
+ const key = parentKey == null
4457
+ ? child.key
4458
+ : String(parentKey) + String(child.key != null ? child.key : i);
4418
4459
  // handle fragment children case, e.g. v-for
4419
4460
  if (child.type === Fragment) {
4420
4461
  if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
4421
4462
  keyedFragmentCount++;
4422
- ret = ret.concat(getTransitionRawChildren(child.children, keepComment));
4463
+ ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
4423
4464
  }
4424
4465
  // comment placeholders should be skipped, e.g. v-if
4425
4466
  else if (keepComment || child.type !== Comment) {
4426
- ret.push(child);
4467
+ ret.push(key != null ? cloneVNode(child, { key }) : child);
4427
4468
  }
4428
4469
  }
4429
4470
  // #1126 if a transition children list contains multiple sub fragments, these
@@ -5481,6 +5522,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
5481
5522
  const propsToUpdate = instance.vnode.dynamicProps;
5482
5523
  for (let i = 0; i < propsToUpdate.length; i++) {
5483
5524
  let key = propsToUpdate[i];
5525
+ // skip if the prop key is a declared emit event listener
5526
+ if (isEmitListener(instance.emitsOptions, key)) {
5527
+ continue;
5528
+ }
5484
5529
  // PROPS flag guarantees rawProps to be non-null
5485
5530
  const value = rawProps[key];
5486
5531
  if (options) {
@@ -6066,7 +6111,8 @@ function withDirectives(vnode, directives) {
6066
6111
  warn$1(`withDirectives can only be used inside render functions.`);
6067
6112
  return vnode;
6068
6113
  }
6069
- const instance = internalInstance.proxy;
6114
+ const instance = getExposeProxy(internalInstance) ||
6115
+ internalInstance.proxy;
6070
6116
  const bindings = vnode.dirs || (vnode.dirs = []);
6071
6117
  for (let i = 0; i < directives.length; i++) {
6072
6118
  let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
@@ -6186,7 +6232,7 @@ function createCompatVue(createApp, createSingletonApp) {
6186
6232
  return vm;
6187
6233
  }
6188
6234
  }
6189
- Vue.version = `2.6.14-compat:${"3.2.30"}`;
6235
+ Vue.version = `2.6.14-compat:${"3.2.33"}`;
6190
6236
  Vue.config = singletonApp.config;
6191
6237
  Vue.use = (p, ...options) => {
6192
6238
  if (p && isFunction(p.install)) {
@@ -6613,6 +6659,9 @@ function createAppContext() {
6613
6659
  let uid = 0;
6614
6660
  function createAppAPI(render, hydrate) {
6615
6661
  return function createApp(rootComponent, rootProps = null) {
6662
+ if (!isFunction(rootComponent)) {
6663
+ rootComponent = Object.assign({}, rootComponent);
6664
+ }
6616
6665
  if (rootProps != null && !isObject(rootProps)) {
6617
6666
  warn$1(`root props passed to app.mount() must be an object.`);
6618
6667
  rootProps = null;
@@ -6812,6 +6861,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6812
6861
  if (!isArray(existing)) {
6813
6862
  if (_isString) {
6814
6863
  refs[ref] = [refValue];
6864
+ if (hasOwn(setupState, ref)) {
6865
+ setupState[ref] = refs[ref];
6866
+ }
6815
6867
  }
6816
6868
  else {
6817
6869
  ref.value = [refValue];
@@ -7010,7 +7062,8 @@ function createHydrationFunctions(rendererInternals) {
7010
7062
  // e.g. <option :value="obj">, <input type="checkbox" :true-value="1">
7011
7063
  const forcePatchValue = (type === 'input' && dirs) || type === 'option';
7012
7064
  // skip props & children if this is hoisted static nodes
7013
- if (forcePatchValue || patchFlag !== -1 /* HOISTED */) {
7065
+ // #5405 in dev, always hydrate children for HMR
7066
+ {
7014
7067
  if (dirs) {
7015
7068
  invokeDirectiveHook(vnode, null, parentComponent, 'created');
7016
7069
  }
@@ -7183,7 +7236,7 @@ function startMeasure(instance, type) {
7183
7236
  perf.mark(`vue-${type}-${instance.uid}`);
7184
7237
  }
7185
7238
  {
7186
- devtoolsPerfStart(instance, type, supported ? perf.now() : Date.now());
7239
+ devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
7187
7240
  }
7188
7241
  }
7189
7242
  function endMeasure(instance, type) {
@@ -7196,7 +7249,7 @@ function endMeasure(instance, type) {
7196
7249
  perf.clearMarks(endTag);
7197
7250
  }
7198
7251
  {
7199
- devtoolsPerfEnd(instance, type, supported ? perf.now() : Date.now());
7252
+ devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
7200
7253
  }
7201
7254
  }
7202
7255
  function isSupported() {
@@ -8343,7 +8396,22 @@ function baseCreateRenderer(options, createHydrationFns) {
8343
8396
  const remove = vnode => {
8344
8397
  const { type, el, anchor, transition } = vnode;
8345
8398
  if (type === Fragment) {
8346
- removeFragment(el, anchor);
8399
+ if (vnode.patchFlag > 0 &&
8400
+ vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
8401
+ transition &&
8402
+ !transition.persisted) {
8403
+ vnode.children.forEach(child => {
8404
+ if (child.type === Comment) {
8405
+ hostRemove(child.el);
8406
+ }
8407
+ else {
8408
+ remove(child);
8409
+ }
8410
+ });
8411
+ }
8412
+ else {
8413
+ removeFragment(el, anchor);
8414
+ }
8347
8415
  return;
8348
8416
  }
8349
8417
  if (type === Static) {
@@ -9736,7 +9804,10 @@ function renderSlot(slots, name, props = {},
9736
9804
  // this is not a user-facing function, so the fallback is always generated by
9737
9805
  // the compiler and guaranteed to be a function returning an array
9738
9806
  fallback, noSlotted) {
9739
- if (currentRenderingInstance.isCE) {
9807
+ if (currentRenderingInstance.isCE ||
9808
+ (currentRenderingInstance.parent &&
9809
+ isAsyncWrapper(currentRenderingInstance.parent) &&
9810
+ currentRenderingInstance.parent.isCE)) {
9740
9811
  return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());
9741
9812
  }
9742
9813
  let slot = slots[name];
@@ -10026,7 +10097,10 @@ const getPublicInstance = (i) => {
10026
10097
  return getExposeProxy(i) || i.proxy;
10027
10098
  return getPublicInstance(i.parent);
10028
10099
  };
10029
- const publicPropertiesMap = extend(Object.create(null), {
10100
+ const publicPropertiesMap =
10101
+ // Move PURE marker to new line to workaround compiler discarding it
10102
+ // due to type annotation
10103
+ /*#__PURE__*/ extend(Object.create(null), {
10030
10104
  $: i => i,
10031
10105
  $el: i => i.vnode.el,
10032
10106
  $data: i => i.data,
@@ -10139,7 +10213,9 @@ const PublicInstanceProxyHandlers = {
10139
10213
  }
10140
10214
  else {
10141
10215
  const val = globalProperties[key];
10142
- return isFunction(val) ? val.bind(instance.proxy) : val;
10216
+ return isFunction(val)
10217
+ ? Object.assign(val.bind(instance.proxy), val)
10218
+ : val;
10143
10219
  }
10144
10220
  }
10145
10221
  }
@@ -10164,9 +10240,11 @@ const PublicInstanceProxyHandlers = {
10164
10240
  const { data, setupState, ctx } = instance;
10165
10241
  if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
10166
10242
  setupState[key] = value;
10243
+ return true;
10167
10244
  }
10168
10245
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
10169
10246
  data[key] = value;
10247
+ return true;
10170
10248
  }
10171
10249
  else if (hasOwn(instance.props, key)) {
10172
10250
  warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
@@ -10200,6 +10278,16 @@ const PublicInstanceProxyHandlers = {
10200
10278
  hasOwn(ctx, key) ||
10201
10279
  hasOwn(publicPropertiesMap, key) ||
10202
10280
  hasOwn(appContext.config.globalProperties, key));
10281
+ },
10282
+ defineProperty(target, key, descriptor) {
10283
+ if (descriptor.get != null) {
10284
+ // invalidate key cache of a getter based property #5417
10285
+ target._.accessCache[key] = 0;
10286
+ }
10287
+ else if (hasOwn(descriptor, 'value')) {
10288
+ this.set(target, key, descriptor.value, null);
10289
+ }
10290
+ return Reflect.defineProperty(target, key, descriptor);
10203
10291
  }
10204
10292
  };
10205
10293
  {
@@ -10402,6 +10490,7 @@ function setupComponent(instance, isSSR = false) {
10402
10490
  return setupResult;
10403
10491
  }
10404
10492
  function setupStatefulComponent(instance, isSSR) {
10493
+ var _a;
10405
10494
  const Component = instance.type;
10406
10495
  {
10407
10496
  if (Component.name) {
@@ -10459,6 +10548,13 @@ function setupStatefulComponent(instance, isSSR) {
10459
10548
  // async setup returned Promise.
10460
10549
  // bail here and wait for re-entry.
10461
10550
  instance.asyncDep = setupResult;
10551
+ if (!instance.suspense) {
10552
+ const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
10553
+ warn$1(`Component <${name}>: setup function returned a promise, but no ` +
10554
+ `<Suspense> boundary was found in the parent component tree. ` +
10555
+ `A component with async setup() must be nested in a <Suspense> ` +
10556
+ `in order to be rendered.`);
10557
+ }
10462
10558
  }
10463
10559
  }
10464
10560
  else {
@@ -11094,7 +11190,7 @@ function isMemoSame(cached, memo) {
11094
11190
  }
11095
11191
 
11096
11192
  // Core API ------------------------------------------------------------------
11097
- const version = "3.2.30";
11193
+ const version = "3.2.33";
11098
11194
  const _ssrUtils = {
11099
11195
  createComponentInstance,
11100
11196
  setupComponent,
@@ -11126,7 +11222,7 @@ const compatUtils = (_compatUtils );
11126
11222
 
11127
11223
  const svgNS = 'http://www.w3.org/2000/svg';
11128
11224
  const doc = (typeof document !== 'undefined' ? document : null);
11129
- const templateContainer = doc && doc.createElement('template');
11225
+ const templateContainer = doc && /*#__PURE__*/ doc.createElement('template');
11130
11226
  const nodeOps = {
11131
11227
  insert: (child, parent, anchor) => {
11132
11228
  parent.insertBefore(child, anchor || null);
@@ -11277,6 +11373,8 @@ function setStyle(style, name, val) {
11277
11373
  val.forEach(v => setStyle(style, name, v));
11278
11374
  }
11279
11375
  else {
11376
+ if (val == null)
11377
+ val = '';
11280
11378
  if (name.startsWith('--')) {
11281
11379
  // custom property definition
11282
11380
  style.setProperty(name, val);
@@ -11398,41 +11496,39 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
11398
11496
  }
11399
11497
  return;
11400
11498
  }
11499
+ let needRemove = false;
11401
11500
  if (value === '' || value == null) {
11402
11501
  const type = typeof el[key];
11403
11502
  if (type === 'boolean') {
11404
11503
  // e.g. <select multiple> compiles to { multiple: '' }
11405
- el[key] = includeBooleanAttr(value);
11406
- return;
11504
+ value = includeBooleanAttr(value);
11407
11505
  }
11408
11506
  else if (value == null && type === 'string') {
11409
11507
  // e.g. <div :id="null">
11410
- el[key] = '';
11411
- el.removeAttribute(key);
11412
- return;
11508
+ value = '';
11509
+ needRemove = true;
11413
11510
  }
11414
11511
  else if (type === 'number') {
11415
11512
  // e.g. <img :width="null">
11416
11513
  // the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error
11417
- try {
11418
- el[key] = 0;
11419
- }
11420
- catch (_a) { }
11421
- el.removeAttribute(key);
11422
- return;
11514
+ value = 0;
11515
+ needRemove = true;
11423
11516
  }
11424
11517
  }
11425
- if (value === false &&
11426
- compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent)) {
11427
- const type = typeof el[key];
11428
- if (type === 'string' || type === 'number') {
11429
- compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent, key);
11430
- el[key] = type === 'number' ? 0 : '';
11431
- el.removeAttribute(key);
11432
- return;
11518
+ else {
11519
+ if (value === false &&
11520
+ compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent)) {
11521
+ const type = typeof el[key];
11522
+ if (type === 'string' || type === 'number') {
11523
+ compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent, key);
11524
+ value = type === 'number' ? 0 : '';
11525
+ needRemove = true;
11526
+ }
11433
11527
  }
11434
11528
  }
11435
- // some properties perform value validation and throw
11529
+ // some properties perform value validation and throw,
11530
+ // some properties has getter, no setter, will error in 'use strict'
11531
+ // eg. <select :type="null"></select> <select :willValidate="null"></select>
11436
11532
  try {
11437
11533
  el[key] = value;
11438
11534
  }
@@ -11442,31 +11538,35 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
11442
11538
  `value ${value} is invalid.`, e);
11443
11539
  }
11444
11540
  }
11541
+ needRemove && el.removeAttribute(key);
11445
11542
  }
11446
11543
 
11447
11544
  // Async edge case fix requires storing an event listener's attach timestamp.
11448
- let _getNow = Date.now;
11449
- let skipTimestampCheck = false;
11450
- if (typeof window !== 'undefined') {
11451
- // Determine what event timestamp the browser is using. Annoyingly, the
11452
- // timestamp can either be hi-res (relative to page load) or low-res
11453
- // (relative to UNIX epoch), so in order to compare time we have to use the
11454
- // same timestamp type when saving the flush timestamp.
11455
- if (_getNow() > document.createEvent('Event').timeStamp) {
11456
- // if the low-res timestamp which is bigger than the event timestamp
11457
- // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11458
- // and we need to use the hi-res version for event listeners as well.
11459
- _getNow = () => performance.now();
11460
- }
11461
- // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11462
- // and does not fire microtasks in between event propagation, so safe to exclude.
11463
- const ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i);
11464
- skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);
11465
- }
11545
+ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
11546
+ let _getNow = Date.now;
11547
+ let skipTimestampCheck = false;
11548
+ if (typeof window !== 'undefined') {
11549
+ // Determine what event timestamp the browser is using. Annoyingly, the
11550
+ // timestamp can either be hi-res (relative to page load) or low-res
11551
+ // (relative to UNIX epoch), so in order to compare time we have to use the
11552
+ // same timestamp type when saving the flush timestamp.
11553
+ if (Date.now() > document.createEvent('Event').timeStamp) {
11554
+ // if the low-res timestamp which is bigger than the event timestamp
11555
+ // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11556
+ // and we need to use the hi-res version for event listeners as well.
11557
+ _getNow = () => performance.now();
11558
+ }
11559
+ // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11560
+ // and does not fire microtasks in between event propagation, so safe to exclude.
11561
+ const ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i);
11562
+ skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);
11563
+ }
11564
+ return [_getNow, skipTimestampCheck];
11565
+ })();
11466
11566
  // To avoid the overhead of repeatedly calling performance.now(), we cache
11467
11567
  // and use the same timestamp for all event listeners attached in the same tick.
11468
11568
  let cachedNow = 0;
11469
- const p = Promise.resolve();
11569
+ const p = /*#__PURE__*/ Promise.resolve();
11470
11570
  const reset = () => {
11471
11571
  cachedNow = 0;
11472
11572
  };
@@ -11591,13 +11691,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
11591
11691
  }
11592
11692
  return false;
11593
11693
  }
11594
- // spellcheck and draggable are numerated attrs, however their
11595
- // corresponding DOM properties are actually booleans - this leads to
11596
- // setting it with a string "false" value leading it to be coerced to
11597
- // `true`, so we need to always treat them as attributes.
11694
+ // these are enumerated attrs, however their corresponding DOM properties
11695
+ // are actually booleans - this leads to setting it with a string "false"
11696
+ // value leading it to be coerced to `true`, so we need to always treat
11697
+ // them as attributes.
11598
11698
  // Note that `contentEditable` doesn't have this problem: its DOM
11599
11699
  // property is also enumerated string values.
11600
- if (key === 'spellcheck' || key === 'draggable') {
11700
+ if (key === 'spellcheck' || key === 'draggable' || key === 'translate') {
11601
11701
  return false;
11602
11702
  }
11603
11703
  // #1787, #2840 form property on form elements is readonly and must be set as
@@ -12723,7 +12823,7 @@ function initVShowForSSR() {
12723
12823
  };
12724
12824
  }
12725
12825
 
12726
- const rendererOptions = extend({ patchProp }, nodeOps);
12826
+ const rendererOptions = /*#__PURE__*/ extend({ patchProp }, nodeOps);
12727
12827
  // lazy create the renderer - this makes core renderer logic tree-shakable
12728
12828
  // in case the user only imports reactivity utilities from Vue.
12729
12829
  let renderer;