@vue/compat 3.2.13 → 3.2.17

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.
@@ -931,8 +931,6 @@ var Vue = (function () {
931
931
  get: shallowReadonlyGet
932
932
  });
933
933
 
934
- const toReactive = (value) => isObject(value) ? reactive(value) : value;
935
- const toReadonly = (value) => isObject(value) ? readonly(value) : value;
936
934
  const toShallow = (value) => value;
937
935
  const getProto = (v) => Reflect.getPrototypeOf(v);
938
936
  function get$1(target, key, isReadonly = false, isShallow = false) {
@@ -1320,7 +1318,9 @@ var Vue = (function () {
1320
1318
  function markRaw(value) {
1321
1319
  def(value, "__v_skip" /* SKIP */, true);
1322
1320
  return value;
1323
- }
1321
+ }
1322
+ const toReactive = (value) => isObject(value) ? reactive(value) : value;
1323
+ const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1324
1324
 
1325
1325
  function trackRefValue(ref) {
1326
1326
  if (isTracking()) {
@@ -1350,7 +1350,6 @@ var Vue = (function () {
1350
1350
  }
1351
1351
  }
1352
1352
  }
1353
- const convert = (val) => isObject(val) ? reactive(val) : val;
1354
1353
  function isRef(r) {
1355
1354
  return Boolean(r && r.__v_isRef === true);
1356
1355
  }
@@ -1360,13 +1359,19 @@ var Vue = (function () {
1360
1359
  function shallowRef(value) {
1361
1360
  return createRef(value, true);
1362
1361
  }
1362
+ function createRef(rawValue, shallow) {
1363
+ if (isRef(rawValue)) {
1364
+ return rawValue;
1365
+ }
1366
+ return new RefImpl(rawValue, shallow);
1367
+ }
1363
1368
  class RefImpl {
1364
1369
  constructor(value, _shallow) {
1365
1370
  this._shallow = _shallow;
1366
1371
  this.dep = undefined;
1367
1372
  this.__v_isRef = true;
1368
1373
  this._rawValue = _shallow ? value : toRaw(value);
1369
- this._value = _shallow ? value : convert(value);
1374
+ this._value = _shallow ? value : toReactive(value);
1370
1375
  }
1371
1376
  get value() {
1372
1377
  trackRefValue(this);
@@ -1376,17 +1381,11 @@ var Vue = (function () {
1376
1381
  newVal = this._shallow ? newVal : toRaw(newVal);
1377
1382
  if (hasChanged(newVal, this._rawValue)) {
1378
1383
  this._rawValue = newVal;
1379
- this._value = this._shallow ? newVal : convert(newVal);
1384
+ this._value = this._shallow ? newVal : toReactive(newVal);
1380
1385
  triggerRefValue(this, newVal);
1381
1386
  }
1382
1387
  }
1383
1388
  }
1384
- function createRef(rawValue, shallow) {
1385
- if (isRef(rawValue)) {
1386
- return rawValue;
1387
- }
1388
- return new RefImpl(rawValue, shallow);
1389
- }
1390
1389
  function triggerRef(ref) {
1391
1390
  triggerRefValue(ref, ref.value );
1392
1391
  }
@@ -1517,14 +1516,7 @@ var Vue = (function () {
1517
1516
  // Note: for a component to be eligible for HMR it also needs the __hmrId option
1518
1517
  // to be set so that its instances can be registered / removed.
1519
1518
  {
1520
- const globalObject = typeof global !== 'undefined'
1521
- ? global
1522
- : typeof self !== 'undefined'
1523
- ? self
1524
- : typeof window !== 'undefined'
1525
- ? window
1526
- : {};
1527
- globalObject.__VUE_HMR_RUNTIME__ = {
1519
+ getGlobalThis().__VUE_HMR_RUNTIME__ = {
1528
1520
  createRecord: tryWrap(createRecord),
1529
1521
  rerender: tryWrap(rerender),
1530
1522
  reload: tryWrap(reload)
@@ -1645,14 +1637,32 @@ var Vue = (function () {
1645
1637
  }
1646
1638
 
1647
1639
  let devtools;
1648
- function setDevtoolsHook(hook) {
1640
+ let buffer = [];
1641
+ function emit(event, ...args) {
1642
+ if (devtools) {
1643
+ devtools.emit(event, ...args);
1644
+ }
1645
+ else {
1646
+ buffer.push({ event, args });
1647
+ }
1648
+ }
1649
+ function setDevtoolsHook(hook, target) {
1649
1650
  devtools = hook;
1651
+ if (devtools) {
1652
+ devtools.enabled = true;
1653
+ buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
1654
+ buffer = [];
1655
+ }
1656
+ else {
1657
+ const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
1658
+ target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
1659
+ replay.push((newHook) => {
1660
+ setDevtoolsHook(newHook, target);
1661
+ });
1662
+ }
1650
1663
  }
1651
1664
  function devtoolsInitApp(app, version) {
1652
- // TODO queue if devtools is undefined
1653
- if (!devtools)
1654
- return;
1655
- devtools.emit("app:init" /* APP_INIT */, app, version, {
1665
+ emit("app:init" /* APP_INIT */, app, version, {
1656
1666
  Fragment,
1657
1667
  Text,
1658
1668
  Comment,
@@ -1660,9 +1670,7 @@ var Vue = (function () {
1660
1670
  });
1661
1671
  }
1662
1672
  function devtoolsUnmountApp(app) {
1663
- if (!devtools)
1664
- return;
1665
- devtools.emit("app:unmount" /* APP_UNMOUNT */, app);
1673
+ emit("app:unmount" /* APP_UNMOUNT */, app);
1666
1674
  }
1667
1675
  const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
1668
1676
  const devtoolsComponentUpdated =
@@ -1671,24 +1679,18 @@ var Vue = (function () {
1671
1679
  /*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* COMPONENT_REMOVED */);
1672
1680
  function createDevtoolsComponentHook(hook) {
1673
1681
  return (component) => {
1674
- if (!devtools)
1675
- return;
1676
- devtools.emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
1682
+ emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
1677
1683
  };
1678
1684
  }
1679
1685
  const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
1680
1686
  const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
1681
1687
  function createDevtoolsPerformanceHook(hook) {
1682
1688
  return (component, type, time) => {
1683
- if (!devtools)
1684
- return;
1685
- devtools.emit(hook, component.appContext.app, component.uid, component, type, time);
1689
+ emit(hook, component.appContext.app, component.uid, component, type, time);
1686
1690
  };
1687
1691
  }
1688
1692
  function devtoolsComponentEmit(component, event, params) {
1689
- if (!devtools)
1690
- return;
1691
- devtools.emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
1693
+ emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
1692
1694
  }
1693
1695
 
1694
1696
  const deprecationData = {
@@ -2148,7 +2150,7 @@ var Vue = (function () {
2148
2150
  events[event] = cbs.filter(cb => !(cb === fn || cb.fn === fn));
2149
2151
  return vm;
2150
2152
  }
2151
- function emit(instance, event, args) {
2153
+ function emit$1(instance, event, args) {
2152
2154
  const cbs = getRegistry(instance)[event];
2153
2155
  if (cbs) {
2154
2156
  callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
@@ -2201,7 +2203,7 @@ var Vue = (function () {
2201
2203
  }
2202
2204
  }
2203
2205
 
2204
- function emit$1(instance, event, ...rawArgs) {
2206
+ function emit$2(instance, event, ...rawArgs) {
2205
2207
  const props = instance.vnode.props || EMPTY_OBJ;
2206
2208
  {
2207
2209
  const { emitsOptions, propsOptions: [propsOptions] } = instance;
@@ -2277,7 +2279,7 @@ var Vue = (function () {
2277
2279
  }
2278
2280
  {
2279
2281
  compatModelEmit(instance, event, args);
2280
- return emit(instance, event, args);
2282
+ return emit$1(instance, event, args);
2281
2283
  }
2282
2284
  }
2283
2285
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
@@ -5276,7 +5278,7 @@ var Vue = (function () {
5276
5278
  return vm;
5277
5279
  }
5278
5280
  }
5279
- Vue.version = "3.2.13";
5281
+ Vue.version = "3.2.17";
5280
5282
  Vue.config = singletonApp.config;
5281
5283
  Vue.use = (p, ...options) => {
5282
5284
  if (p && isFunction(p.install)) {
@@ -6274,10 +6276,10 @@ var Vue = (function () {
6274
6276
  }
6275
6277
  // implementation
6276
6278
  function baseCreateRenderer(options, createHydrationFns) {
6279
+ const target = getGlobalThis();
6280
+ target.__VUE__ = true;
6277
6281
  {
6278
- const target = getGlobalThis();
6279
- target.__VUE__ = true;
6280
- setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__);
6282
+ setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
6281
6283
  }
6282
6284
  const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;
6283
6285
  // Note: functions inside this closure should use `const xxx = () => {}`
@@ -9462,7 +9464,7 @@ var Vue = (function () {
9462
9464
  instance.ctx = createDevRenderContext(instance);
9463
9465
  }
9464
9466
  instance.root = parent ? parent.root : instance;
9465
- instance.emit = emit$1.bind(null, instance);
9467
+ instance.emit = emit$2.bind(null, instance);
9466
9468
  // apply custom element special handling
9467
9469
  if (vnode.ce) {
9468
9470
  vnode.ce(instance);
@@ -9622,9 +9624,11 @@ var Vue = (function () {
9622
9624
  }
9623
9625
  }
9624
9626
  // template / render function normalization
9627
+ // could be already set when returned from setup()
9625
9628
  if (!instance.render) {
9626
- // could be set from setup()
9627
- if (compile && !Component.render) {
9629
+ // only do on-the-fly compile if not in SSR - SSR on-the-fly compliation
9630
+ // is done by server-renderer
9631
+ if (!isSSR && compile && !Component.render) {
9628
9632
  const template = (instance.vnode.props &&
9629
9633
  instance.vnode.props['inline-template']) ||
9630
9634
  Component.template;
@@ -10840,7 +10844,7 @@ var Vue = (function () {
10840
10844
  }
10841
10845
 
10842
10846
  // Core API ------------------------------------------------------------------
10843
- const version = "3.2.13";
10847
+ const version = "3.2.17";
10844
10848
  /**
10845
10849
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
10846
10850
  * @internal
@@ -12579,7 +12583,11 @@ var Vue = (function () {
12579
12583
  warn$1(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
12580
12584
  }
12581
12585
  return container;
12582
- }
12586
+ }
12587
+ /**
12588
+ * @internal
12589
+ */
12590
+ const initDirectivesForSSR = NOOP;
12583
12591
 
12584
12592
  var runtimeDom = /*#__PURE__*/Object.freeze({
12585
12593
  __proto__: null,
@@ -12587,6 +12595,7 @@ var Vue = (function () {
12587
12595
  hydrate: hydrate,
12588
12596
  createApp: createApp,
12589
12597
  createSSRApp: createSSRApp,
12598
+ initDirectivesForSSR: initDirectivesForSSR,
12590
12599
  defineCustomElement: defineCustomElement,
12591
12600
  defineSSRCustomElement: defineSSRCustomElement,
12592
12601
  VueElement: VueElement,
@@ -12836,7 +12845,7 @@ var Vue = (function () {
12836
12845
  [47 /* X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
12837
12846
  [48 /* X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
12838
12847
  [49 /* X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
12839
- // just to fullfill types
12848
+ // just to fulfill types
12840
12849
  [50 /* __EXTEND_POINT__ */]: ``
12841
12850
  };
12842
12851
 
@@ -14872,7 +14881,7 @@ var Vue = (function () {
14872
14881
  }
14873
14882
 
14874
14883
  const PURE_ANNOTATION = `/*#__PURE__*/`;
14875
- function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssr = false, isTS = false, inSSR = false }) {
14884
+ function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssrRuntimeModuleName = 'vue/server-renderer', ssr = false, isTS = false, inSSR = false }) {
14876
14885
  const context = {
14877
14886
  mode,
14878
14887
  prefixIdentifiers,
@@ -14882,6 +14891,7 @@ var Vue = (function () {
14882
14891
  optimizeImports,
14883
14892
  runtimeGlobalName,
14884
14893
  runtimeModuleName,
14894
+ ssrRuntimeModuleName,
14885
14895
  ssr,
14886
14896
  isTS,
14887
14897
  inSSR,
@@ -15007,7 +15017,7 @@ var Vue = (function () {
15007
15017
  };
15008
15018
  }
15009
15019
  function genFunctionPreamble(ast, context) {
15010
- const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName } = context;
15020
+ const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName, ssrRuntimeModuleName } = context;
15011
15021
  const VueBinding = runtimeGlobalName;
15012
15022
  const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
15013
15023
  // Generate const declaration for helpers
@@ -17086,9 +17096,9 @@ var Vue = (function () {
17086
17096
  const eventArg = context.isTS ? `($event: any)` : `$event`;
17087
17097
  {
17088
17098
  assignmentExp = createCompoundExpression([
17089
- `${eventArg} => (`,
17099
+ `${eventArg} => ((`,
17090
17100
  exp,
17091
- ` = $event)`
17101
+ `) = $event)`
17092
17102
  ]);
17093
17103
  }
17094
17104
  const props = [