@vue/compat 3.6.0-beta.13 → 3.6.0-beta.15
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 +2 -2
- package/dist/vue-compat.d.ts +1 -1
- package/dist/vue.cjs.js +107 -48
- package/dist/vue.cjs.prod.js +38 -16
- package/dist/vue.esm-browser.js +103 -47
- package/dist/vue.esm-browser.prod.js +4 -4
- package/dist/vue.esm-bundler.js +103 -47
- package/dist/vue.global.js +103 -47
- package/dist/vue.global.prod.js +4 -4
- package/dist/vue.runtime.esm-browser.js +103 -47
- package/dist/vue.runtime.esm-browser.prod.js +4 -4
- package/dist/vue.runtime.esm-bundler.js +103 -47
- package/dist/vue.runtime.global.js +103 -47
- package/dist/vue.runtime.global.prod.js +4 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ While we've tried hard to make the migration build mimic Vue 2 behavior as much
|
|
|
18
18
|
|
|
19
19
|
- Internet Explorer 11 support: [Vue 3 has officially dropped the plan for IE11 support](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0038-vue3-ie11-support.md). If you still need to support IE11 or below, you will have to stay on Vue 2.
|
|
20
20
|
|
|
21
|
-
- Server-side rendering: the migration build can be used for SSR, but migrating a custom SSR setup is much more involved. The general idea is replacing `vue-server-renderer` with [`@vue/server-renderer`](https://github.com/vuejs/core/tree/main/packages/server-renderer). Vue 3 no longer provides a bundle renderer and it is recommended to use Vue 3 SSR with [Vite](https://
|
|
21
|
+
- Server-side rendering: the migration build can be used for SSR, but migrating a custom SSR setup is much more involved. The general idea is replacing `vue-server-renderer` with [`@vue/server-renderer`](https://github.com/vuejs/core/tree/main/packages/server-renderer). Vue 3 no longer provides a bundle renderer and it is recommended to use Vue 3 SSR with [Vite](https://vite.dev/guide/ssr). If you are using [Nuxt.js](https://nuxtjs.org/), it is probably better to wait for Nuxt 3.
|
|
22
22
|
|
|
23
23
|
### Expectations
|
|
24
24
|
|
|
@@ -43,7 +43,7 @@ The following workflow walks through the steps of migrating an actual Vue 2 app
|
|
|
43
43
|
1. Upgrade tooling if applicable.
|
|
44
44
|
- If using custom webpack setup: Upgrade `vue-loader` to `^16.0.0`.
|
|
45
45
|
- If using `vue-cli`: upgrade to the latest `@vue/cli-service` with `vue upgrade`
|
|
46
|
-
- (Alternative) migrate to [Vite](https://
|
|
46
|
+
- (Alternative) migrate to [Vite](https://vite.dev/) + [vite-plugin-vue2](https://github.com/underfin/vite-plugin-vue2). [[Example commit](https://github.com/vuejs/vue-hackernews-2.0/commit/565b948919eb58f22a32afca7e321b490cb3b074)]
|
|
47
47
|
|
|
48
48
|
2. In `package.json`, update `vue` to 3.1, install `@vue/compat` of the same version, and replace `vue-template-compiler` (if present) with `@vue/compiler-sfc`:
|
|
49
49
|
|
package/dist/vue-compat.d.ts
CHANGED
|
@@ -1027,7 +1027,7 @@ interface VaporInteropInterface {
|
|
|
1027
1027
|
setTransitionHooks(component: ComponentInternalInstance, transition: TransitionHooks): void;
|
|
1028
1028
|
vdomMount: (component: ConcreteComponent, parentComponent: any, props?: any, slots?: any, once?: boolean) => any;
|
|
1029
1029
|
vdomUnmount: UnmountComponentFn;
|
|
1030
|
-
vdomSlot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any, fallback?: any, once?: boolean) => any;
|
|
1030
|
+
vdomSlot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any, fallback?: any, once?: boolean, slotRoot?: boolean) => any;
|
|
1031
1031
|
vdomMountVNode: (vnode: VNode, parentComponent: any) => any;
|
|
1032
1032
|
}
|
|
1033
1033
|
/**
|
package/dist/vue.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-beta.
|
|
2
|
+
* @vue/compat v3.6.0-beta.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -2291,8 +2291,9 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2291
2291
|
if (once && cb) {
|
|
2292
2292
|
const _cb = cb;
|
|
2293
2293
|
cb = (...args) => {
|
|
2294
|
-
_cb(...args);
|
|
2294
|
+
const res = _cb(...args);
|
|
2295
2295
|
this.stop();
|
|
2296
|
+
return res;
|
|
2296
2297
|
};
|
|
2297
2298
|
}
|
|
2298
2299
|
this.cb = cb;
|
|
@@ -2306,7 +2307,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2306
2307
|
if (!this.cb) return;
|
|
2307
2308
|
const { immediate, deep, call } = this.options;
|
|
2308
2309
|
if (initialRun && !immediate) return;
|
|
2309
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2310
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2310
2311
|
cleanup(this);
|
|
2311
2312
|
const currentWatcher = activeWatcher;
|
|
2312
2313
|
activeWatcher = this;
|
|
@@ -2723,6 +2724,7 @@ function flushJobs(seen) {
|
|
|
2723
2724
|
}
|
|
2724
2725
|
flushIndex = 0;
|
|
2725
2726
|
jobsLength = 0;
|
|
2727
|
+
jobs.length = 0;
|
|
2726
2728
|
flushPostFlushCbs(seen);
|
|
2727
2729
|
currentFlushPromise = null;
|
|
2728
2730
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -2780,6 +2782,14 @@ function createRecord(id, initialDef) {
|
|
|
2780
2782
|
function normalizeClassComponent(component) {
|
|
2781
2783
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2782
2784
|
}
|
|
2785
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2786
|
+
let parent = instance.parent;
|
|
2787
|
+
while (parent) {
|
|
2788
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2789
|
+
parent = parent.parent;
|
|
2790
|
+
}
|
|
2791
|
+
return false;
|
|
2792
|
+
}
|
|
2783
2793
|
function rerender(id, newRender) {
|
|
2784
2794
|
const record = map.get(id);
|
|
2785
2795
|
if (!record) return;
|
|
@@ -2811,42 +2821,69 @@ function reload(id, newComp) {
|
|
|
2811
2821
|
const isVapor = record.initialDef.__vapor;
|
|
2812
2822
|
updateComponentDef(record.initialDef, newComp);
|
|
2813
2823
|
const instances = [...record.instances];
|
|
2814
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2824
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2815
2825
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
const
|
|
2819
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2820
|
-
if (!dirtyInstances) {
|
|
2821
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2822
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2823
|
-
}
|
|
2824
|
-
dirtyInstances.add(instance);
|
|
2825
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2826
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
2827
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2828
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2829
|
-
if (instance.ceReload) {
|
|
2830
|
-
dirtyInstances.add(instance);
|
|
2831
|
-
instance.ceReload(newComp.styles);
|
|
2832
|
-
dirtyInstances.delete(instance);
|
|
2833
|
-
} else if (instance.parent) queueJob(() => {
|
|
2834
|
-
isHmrUpdating = true;
|
|
2826
|
+
const dirtyInstances = new Set(instances);
|
|
2827
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2828
|
+
for (const instance of instances) {
|
|
2835
2829
|
const parent = instance.parent;
|
|
2836
|
-
if (parent
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2830
|
+
if (parent) {
|
|
2831
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2832
|
+
rerenderedParents.add(parent);
|
|
2833
|
+
parent.hmrRerender();
|
|
2834
|
+
}
|
|
2835
|
+
} else instance.hmrReload(newComp);
|
|
2836
|
+
}
|
|
2837
|
+
} else {
|
|
2838
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
2839
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2840
|
+
for (const instance of instances) {
|
|
2841
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2842
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2843
|
+
if (!dirtyInstances) {
|
|
2844
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2845
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2840
2846
|
}
|
|
2841
|
-
|
|
2842
|
-
|
|
2847
|
+
dirtyInstances.add(instance);
|
|
2848
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2849
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2850
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2851
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2852
|
+
if (instance.ceReload) {
|
|
2853
|
+
dirtyInstances.add(instance);
|
|
2854
|
+
instance.ceReload(newComp.styles);
|
|
2855
|
+
dirtyInstances.delete(instance);
|
|
2856
|
+
} else if (instance.parent) {
|
|
2857
|
+
const parent = instance.parent;
|
|
2858
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2859
|
+
let updates = parentUpdates.get(parent);
|
|
2860
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2861
|
+
updates.push([instance, dirtyInstances]);
|
|
2862
|
+
}
|
|
2863
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2864
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2865
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2866
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2867
|
+
}
|
|
2868
|
+
parentUpdates.forEach((updates, parent) => {
|
|
2869
|
+
queueJob(() => {
|
|
2870
|
+
isHmrUpdating = true;
|
|
2871
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2872
|
+
else {
|
|
2873
|
+
const i = parent;
|
|
2874
|
+
if (!(i.effect.flags & 1024)) {
|
|
2875
|
+
i.renderCache = [];
|
|
2876
|
+
i.effect.run();
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2879
|
+
nextTick(() => {
|
|
2880
|
+
isHmrUpdating = false;
|
|
2881
|
+
});
|
|
2882
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
2883
|
+
dirtyInstances.delete(instance);
|
|
2884
|
+
});
|
|
2843
2885
|
});
|
|
2844
|
-
dirtyInstances.delete(instance);
|
|
2845
2886
|
});
|
|
2846
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2847
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2848
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2849
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2850
2887
|
}
|
|
2851
2888
|
queuePostFlushCb(() => {
|
|
2852
2889
|
hmrDirtyComponents.clear();
|
|
@@ -4696,11 +4733,16 @@ function defineAsyncComponent(source) {
|
|
|
4696
4733
|
onError(err);
|
|
4697
4734
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
4698
4735
|
});
|
|
4699
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
4736
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
4700
4737
|
load().then(() => {
|
|
4738
|
+
if (instance.isUnmounted) return;
|
|
4701
4739
|
loaded.value = true;
|
|
4702
4740
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
4703
4741
|
}).catch((err) => {
|
|
4742
|
+
if (instance.isUnmounted) {
|
|
4743
|
+
setPendingRequest(null);
|
|
4744
|
+
return;
|
|
4745
|
+
}
|
|
4704
4746
|
onError(err);
|
|
4705
4747
|
error.value = err;
|
|
4706
4748
|
});
|
|
@@ -4758,14 +4800,22 @@ function createAsyncComponentContext(source) {
|
|
|
4758
4800
|
setPendingRequest: (request) => pendingRequest = request
|
|
4759
4801
|
};
|
|
4760
4802
|
}
|
|
4761
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4803
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
4762
4804
|
const loaded = /* @__PURE__ */ ref(false);
|
|
4763
4805
|
const error = /* @__PURE__ */ ref();
|
|
4764
4806
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4765
|
-
|
|
4807
|
+
let timeoutTimer;
|
|
4808
|
+
let delayTimer;
|
|
4809
|
+
if (instance) onUnmounted(() => {
|
|
4810
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4811
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4812
|
+
}, instance);
|
|
4813
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
4814
|
+
if (instance && instance.isUnmounted) return;
|
|
4766
4815
|
delayed.value = false;
|
|
4767
4816
|
}, delay);
|
|
4768
|
-
if (timeout != null) setTimeout(() => {
|
|
4817
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
4818
|
+
if (instance && instance.isUnmounted) return;
|
|
4769
4819
|
if (!loaded.value && !error.value) {
|
|
4770
4820
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
4771
4821
|
onError(err);
|
|
@@ -5387,6 +5437,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
5387
5437
|
slot: vaporSlot,
|
|
5388
5438
|
fallback
|
|
5389
5439
|
};
|
|
5440
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
5390
5441
|
return ret;
|
|
5391
5442
|
}
|
|
5392
5443
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
@@ -6324,7 +6375,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6324
6375
|
if (options.el) return vm.$mount(options.el);
|
|
6325
6376
|
else return vm;
|
|
6326
6377
|
}
|
|
6327
|
-
Vue.version = `2.6.14-compat:3.6.0-beta.
|
|
6378
|
+
Vue.version = `2.6.14-compat:3.6.0-beta.15`;
|
|
6328
6379
|
Vue.config = singletonApp.config;
|
|
6329
6380
|
Vue.use = (plugin, ...options) => {
|
|
6330
6381
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -6579,7 +6630,9 @@ function defineReactive(obj, key, val) {
|
|
|
6579
6630
|
else Object.keys(val).forEach((key) => {
|
|
6580
6631
|
try {
|
|
6581
6632
|
defineReactiveSimple(val, key, val[key]);
|
|
6582
|
-
} catch (e) {
|
|
6633
|
+
} catch (e) {
|
|
6634
|
+
warn$1(`Failed making property "${key}" reactive:`, e);
|
|
6635
|
+
}
|
|
6583
6636
|
});
|
|
6584
6637
|
}
|
|
6585
6638
|
const i = obj.$;
|
|
@@ -6824,12 +6877,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6824
6877
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
6825
6878
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
6826
6879
|
}
|
|
6827
|
-
|
|
6880
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
6881
|
+
if (!hasVModel) {
|
|
6828
6882
|
localValue = value;
|
|
6829
6883
|
trigger();
|
|
6830
6884
|
}
|
|
6831
6885
|
i.emit(`update:${name}`, emittedValue);
|
|
6832
|
-
if (hasChanged(value,
|
|
6886
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
6833
6887
|
prevSetValue = value;
|
|
6834
6888
|
prevEmittedValue = emittedValue;
|
|
6835
6889
|
}
|
|
@@ -9794,7 +9848,7 @@ function isMemoSame(cached, memo) {
|
|
|
9794
9848
|
}
|
|
9795
9849
|
//#endregion
|
|
9796
9850
|
//#region packages/runtime-core/src/index.ts
|
|
9797
|
-
const version = "3.6.0-beta.
|
|
9851
|
+
const version = "3.6.0-beta.15";
|
|
9798
9852
|
const warn = warn$1;
|
|
9799
9853
|
/**
|
|
9800
9854
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -10937,7 +10991,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
10937
10991
|
prevChildren = [];
|
|
10938
10992
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
10939
10993
|
const child = children[i];
|
|
10940
|
-
if (child.el && child.el instanceof Element) {
|
|
10994
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
10941
10995
|
prevChildren.push(child);
|
|
10942
10996
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
10943
10997
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -13909,7 +13963,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
13909
13963
|
}
|
|
13910
13964
|
},
|
|
13911
13965
|
oncdata(start, end) {
|
|
13912
|
-
if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
|
|
13966
|
+
if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
|
|
13913
13967
|
else emitError(1, start - 9);
|
|
13914
13968
|
},
|
|
13915
13969
|
onprocessinginstruction(start) {
|
|
@@ -14414,7 +14468,7 @@ function getSelfName(filename) {
|
|
|
14414
14468
|
const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
|
|
14415
14469
|
return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
|
|
14416
14470
|
}
|
|
14417
|
-
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
14471
|
+
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
14418
14472
|
const context = {
|
|
14419
14473
|
filename,
|
|
14420
14474
|
selfName: getSelfName(filename),
|
|
@@ -14436,6 +14490,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
14436
14490
|
bindingMetadata,
|
|
14437
14491
|
inline,
|
|
14438
14492
|
isTS,
|
|
14493
|
+
eventDelegation,
|
|
14439
14494
|
onError,
|
|
14440
14495
|
onWarn,
|
|
14441
14496
|
compatConfig,
|
|
@@ -14447,6 +14502,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
14447
14502
|
imports: [],
|
|
14448
14503
|
cached: [],
|
|
14449
14504
|
constantCache: /* @__PURE__ */ new WeakMap(),
|
|
14505
|
+
vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
|
|
14450
14506
|
temps: 0,
|
|
14451
14507
|
identifiers: Object.create(null),
|
|
14452
14508
|
identifierScopes: Object.create(null),
|
|
@@ -15217,7 +15273,7 @@ const transformExpression = (node, context) => {
|
|
|
15217
15273
|
if (dir.type === 7 && dir.name !== "for") {
|
|
15218
15274
|
const exp = dir.exp;
|
|
15219
15275
|
const arg = dir.arg;
|
|
15220
|
-
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
15276
|
+
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
15221
15277
|
if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
|
|
15222
15278
|
}
|
|
15223
15279
|
}
|
|
@@ -15477,7 +15533,10 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
15477
15533
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
15478
15534
|
const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
15479
15535
|
if (isTemplate && memo) memo.exp = processExpression(memo.exp, context);
|
|
15480
|
-
if ((isTemplate || memo) && keyProperty && isDirKey)
|
|
15536
|
+
if ((isTemplate || memo) && keyProperty && isDirKey) {
|
|
15537
|
+
keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
|
|
15538
|
+
if (memo) context.vForMemoKeyedNodes.add(node);
|
|
15539
|
+
}
|
|
15481
15540
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
15482
15541
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
15483
15542
|
forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
|
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-beta.
|
|
2
|
+
* @vue/compat v3.6.0-beta.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -2090,8 +2090,9 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2090
2090
|
if (once && cb) {
|
|
2091
2091
|
const _cb = cb;
|
|
2092
2092
|
cb = (...args) => {
|
|
2093
|
-
_cb(...args);
|
|
2093
|
+
const res = _cb(...args);
|
|
2094
2094
|
this.stop();
|
|
2095
|
+
return res;
|
|
2095
2096
|
};
|
|
2096
2097
|
}
|
|
2097
2098
|
this.cb = cb;
|
|
@@ -2103,7 +2104,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2103
2104
|
if (!this.cb) return;
|
|
2104
2105
|
const { immediate, deep, call } = this.options;
|
|
2105
2106
|
if (initialRun && !immediate) return;
|
|
2106
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2107
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2107
2108
|
cleanup(this);
|
|
2108
2109
|
const currentWatcher = activeWatcher;
|
|
2109
2110
|
activeWatcher = this;
|
|
@@ -2407,6 +2408,7 @@ function flushJobs(seen) {
|
|
|
2407
2408
|
}
|
|
2408
2409
|
flushIndex = 0;
|
|
2409
2410
|
jobsLength = 0;
|
|
2411
|
+
jobs.length = 0;
|
|
2410
2412
|
flushPostFlushCbs(seen);
|
|
2411
2413
|
currentFlushPromise = null;
|
|
2412
2414
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -3811,11 +3813,16 @@ function defineAsyncComponent(source) {
|
|
|
3811
3813
|
onError(err);
|
|
3812
3814
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
3813
3815
|
});
|
|
3814
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
3816
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
3815
3817
|
load().then(() => {
|
|
3818
|
+
if (instance.isUnmounted) return;
|
|
3816
3819
|
loaded.value = true;
|
|
3817
3820
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
3818
3821
|
}).catch((err) => {
|
|
3822
|
+
if (instance.isUnmounted) {
|
|
3823
|
+
setPendingRequest(null);
|
|
3824
|
+
return;
|
|
3825
|
+
}
|
|
3819
3826
|
onError(err);
|
|
3820
3827
|
error.value = err;
|
|
3821
3828
|
});
|
|
@@ -3871,14 +3878,22 @@ function createAsyncComponentContext(source) {
|
|
|
3871
3878
|
setPendingRequest: (request) => pendingRequest = request
|
|
3872
3879
|
};
|
|
3873
3880
|
}
|
|
3874
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
3881
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
3875
3882
|
const loaded = /* @__PURE__ */ ref(false);
|
|
3876
3883
|
const error = /* @__PURE__ */ ref();
|
|
3877
3884
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
3878
|
-
|
|
3885
|
+
let timeoutTimer;
|
|
3886
|
+
let delayTimer;
|
|
3887
|
+
if (instance) onUnmounted(() => {
|
|
3888
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
3889
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
3890
|
+
}, instance);
|
|
3891
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
3892
|
+
if (instance && instance.isUnmounted) return;
|
|
3879
3893
|
delayed.value = false;
|
|
3880
3894
|
}, delay);
|
|
3881
|
-
if (timeout != null) setTimeout(() => {
|
|
3895
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
3896
|
+
if (instance && instance.isUnmounted) return;
|
|
3882
3897
|
if (!loaded.value && !error.value) {
|
|
3883
3898
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
3884
3899
|
onError(err);
|
|
@@ -4482,6 +4497,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
4482
4497
|
slot: vaporSlot,
|
|
4483
4498
|
fallback
|
|
4484
4499
|
};
|
|
4500
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
4485
4501
|
return ret;
|
|
4486
4502
|
}
|
|
4487
4503
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
@@ -5253,7 +5269,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
5253
5269
|
if (options.el) return vm.$mount(options.el);
|
|
5254
5270
|
else return vm;
|
|
5255
5271
|
}
|
|
5256
|
-
Vue.version = `2.6.14-compat:3.6.0-beta.
|
|
5272
|
+
Vue.version = `2.6.14-compat:3.6.0-beta.15`;
|
|
5257
5273
|
Vue.config = singletonApp.config;
|
|
5258
5274
|
Vue.use = (plugin, ...options) => {
|
|
5259
5275
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -5688,12 +5704,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
5688
5704
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
5689
5705
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
5690
5706
|
}
|
|
5691
|
-
|
|
5707
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
5708
|
+
if (!hasVModel) {
|
|
5692
5709
|
localValue = value;
|
|
5693
5710
|
trigger();
|
|
5694
5711
|
}
|
|
5695
5712
|
i.emit(`update:${name}`, emittedValue);
|
|
5696
|
-
if (hasChanged(value,
|
|
5713
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
5697
5714
|
prevSetValue = value;
|
|
5698
5715
|
prevEmittedValue = emittedValue;
|
|
5699
5716
|
}
|
|
@@ -8025,7 +8042,7 @@ function isMemoSame(cached, memo) {
|
|
|
8025
8042
|
}
|
|
8026
8043
|
//#endregion
|
|
8027
8044
|
//#region packages/runtime-core/src/index.ts
|
|
8028
|
-
const version = "3.6.0-beta.
|
|
8045
|
+
const version = "3.6.0-beta.15";
|
|
8029
8046
|
const warn = NOOP;
|
|
8030
8047
|
/**
|
|
8031
8048
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9110,7 +9127,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
9110
9127
|
prevChildren = [];
|
|
9111
9128
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
9112
9129
|
const child = children[i];
|
|
9113
|
-
if (child.el && child.el instanceof Element) {
|
|
9130
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
9114
9131
|
prevChildren.push(child);
|
|
9115
9132
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
9116
9133
|
positionMap.set(child, getPosition(child.el));
|
|
@@ -11981,7 +11998,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
11981
11998
|
}
|
|
11982
11999
|
},
|
|
11983
12000
|
oncdata(start, end) {
|
|
11984
|
-
if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
|
|
12001
|
+
if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
|
|
11985
12002
|
else emitError(1, start - 9);
|
|
11986
12003
|
},
|
|
11987
12004
|
onprocessinginstruction(start) {
|
|
@@ -12469,7 +12486,7 @@ function getSelfName(filename) {
|
|
|
12469
12486
|
const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
|
|
12470
12487
|
return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
|
|
12471
12488
|
}
|
|
12472
|
-
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
12489
|
+
function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
|
12473
12490
|
const context = {
|
|
12474
12491
|
filename,
|
|
12475
12492
|
selfName: getSelfName(filename),
|
|
@@ -12491,6 +12508,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
12491
12508
|
bindingMetadata,
|
|
12492
12509
|
inline,
|
|
12493
12510
|
isTS,
|
|
12511
|
+
eventDelegation,
|
|
12494
12512
|
onError,
|
|
12495
12513
|
onWarn,
|
|
12496
12514
|
compatConfig,
|
|
@@ -12502,6 +12520,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
|
|
|
12502
12520
|
imports: [],
|
|
12503
12521
|
cached: [],
|
|
12504
12522
|
constantCache: /* @__PURE__ */ new WeakMap(),
|
|
12523
|
+
vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
|
|
12505
12524
|
temps: 0,
|
|
12506
12525
|
identifiers: Object.create(null),
|
|
12507
12526
|
identifierScopes: Object.create(null),
|
|
@@ -13258,7 +13277,7 @@ const transformExpression = (node, context) => {
|
|
|
13258
13277
|
if (dir.type === 7 && dir.name !== "for") {
|
|
13259
13278
|
const exp = dir.exp;
|
|
13260
13279
|
const arg = dir.arg;
|
|
13261
|
-
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
13280
|
+
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
|
|
13262
13281
|
if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
|
|
13263
13282
|
}
|
|
13264
13283
|
}
|
|
@@ -13511,7 +13530,10 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
|
|
|
13511
13530
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
13512
13531
|
const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
13513
13532
|
if (isTemplate && memo) memo.exp = processExpression(memo.exp, context);
|
|
13514
|
-
if ((isTemplate || memo) && keyProperty && isDirKey)
|
|
13533
|
+
if ((isTemplate || memo) && keyProperty && isDirKey) {
|
|
13534
|
+
keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
|
|
13535
|
+
if (memo) context.vForMemoKeyedNodes.add(node);
|
|
13536
|
+
}
|
|
13515
13537
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
13516
13538
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
13517
13539
|
forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
|