提交 9685bed3 编写于 作者: fxy060608's avatar fxy060608

chore: bump vue from 3.2.41 to 3.2.45

上级 0b2f7742
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"@dcloudio/uni-app": "../../uni-app", "@dcloudio/uni-app": "../../uni-app",
"@dcloudio/uni-components": "../../uni-components", "@dcloudio/uni-components": "../../uni-components",
"@dcloudio/uni-h5": "../../uni-h5", "@dcloudio/uni-h5": "../../uni-h5",
"vue": "3.2.41", "vue": "3.2.45",
"vue-router": "^4.1.6", "vue-router": "^4.1.6",
"vuex": "^4.1.0" "vuex": "^4.1.0"
}, },
......
...@@ -10,7 +10,7 @@ declare module '@vue/runtime-core' { ...@@ -10,7 +10,7 @@ declare module '@vue/runtime-core' {
// 目前 H5,APP 平台 getCurrentPages 中获取的 page 对象调整为 vm 对象 // 目前 H5,APP 平台 getCurrentPages 中获取的 page 对象调整为 vm 对象
$getAppWebview?: () => PlusWebviewWebviewObject $getAppWebview?: () => PlusWebviewWebviewObject
$requireNativePlugin?: (name: string) => unknown $requireNativePlugin?: (name: string) => unknown
getOpenerEventChannel: () => EventChannel getOpenerEventChannel: () => EventChannel | undefined
$page: Page.PageInstance['$page'] $page: Page.PageInstance['$page']
$mpType?: 'app' | 'page' $mpType?: 'app' | 'page'
$locale?: string $locale?: string
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"url": "https://github.com/dcloudio/uni-app/issues" "url": "https://github.com/dcloudio/uni-app/issues"
}, },
"dependencies": { "dependencies": {
"@vue/shared": "3.2.41" "@vue/shared": "3.2.45"
}, },
"devDependencies": { "devDependencies": {
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002" "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002"
......
...@@ -34,11 +34,11 @@ ...@@ -34,11 +34,11 @@
"@dcloudio/uni-i18n": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-i18n": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@types/pako": "1.0.2", "@types/pako": "1.0.2",
"@vue/compiler-sfc": "3.2.41", "@vue/compiler-sfc": "3.2.45",
"autoprefixer": "^10.4.13", "autoprefixer": "^10.4.13",
"pako": "^1.0.11", "pako": "^1.0.11",
"postcss": "^8.4.16", "postcss": "^8.4.16",
"vue": "3.2.41" "vue": "3.2.45"
}, },
"dependencies": { "dependencies": {
"@dcloudio/uni-app-vite": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-app-vite": "3.0.0-alpha-3060920221111002",
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@rollup/pluginutils": "^4.2.0", "@rollup/pluginutils": "^4.2.0",
"@vitejs/plugin-vue": "^3.2.0", "@vitejs/plugin-vue": "^3.2.0",
"@vue/compiler-dom": "3.2.41", "@vue/compiler-dom": "3.2.45",
"@vue/compiler-sfc": "3.2.41", "@vue/compiler-sfc": "3.2.45",
"debug": "^4.3.3", "debug": "^4.3.3",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
"devDependencies": { "devDependencies": {
"@types/debug": "^4.1.7", "@types/debug": "^4.1.7",
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^9.0.13",
"@vue/compiler-core": "3.2.41", "@vue/compiler-core": "3.2.45",
"esbuild": "^0.15.9", "esbuild": "^0.15.9",
"postcss": "^8.4.16", "postcss": "^8.4.16",
"vite": "3.2.3", "vite": "3.2.3",
"vue": "3.2.41" "vue": "3.2.45"
} }
} }
...@@ -12,6 +12,8 @@ function popWarningContext() { ...@@ -12,6 +12,8 @@ function popWarningContext() {
stack.pop(); stack.pop();
} }
function warn(msg, ...args) { function warn(msg, ...args) {
if (!(process.env.NODE_ENV !== 'production'))
return;
// avoid props formatting or warn handler tracking deps that might be mutated // avoid props formatting or warn handler tracking deps that might be mutated
// during patch, leading to infinite recursion. // during patch, leading to infinite recursion.
pauseTracking(); pauseTracking();
...@@ -520,12 +522,6 @@ function reload(id, newComp) { ...@@ -520,12 +522,6 @@ function reload(id, newComp) {
// components to be unmounted and re-mounted. Queue the update so that we // components to be unmounted and re-mounted. Queue the update so that we
// don't end up forcing the same parent to re-render multiple times. // don't end up forcing the same parent to re-render multiple times.
queueJob(instance.parent.update); queueJob(instance.parent.update);
// instance is the inner component of an async custom element
// invoke to reset styles
if (instance.parent.type.__asyncLoader &&
instance.parent.ceReload) {
instance.parent.ceReload(newComp.styles);
}
} }
else if (instance.appContext.reload) { else if (instance.appContext.reload) {
// root instance mounted via createApp() has a reload method // root instance mounted via createApp() has a reload method
...@@ -688,7 +684,7 @@ function emit$1(instance, event, ...rawArgs) { ...@@ -688,7 +684,7 @@ function emit$1(instance, event, ...rawArgs) {
const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`; const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;
const { number, trim } = props[modifiersKey] || EMPTY_OBJ; const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
if (trim) { if (trim) {
args = rawArgs.map(a => a.trim()); args = rawArgs.map(a => (isString(a) ? a.trim() : a));
} }
if (number) { if (number) {
args = rawArgs.map(toNumber); args = rawArgs.map(toNumber);
...@@ -1758,7 +1754,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM ...@@ -1758,7 +1754,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
}; };
}; };
// in SSR there is no need to setup an actual effect, and it should be noop // in SSR there is no need to setup an actual effect, and it should be noop
// unless it's eager // unless it's eager or sync flush
let ssrCleanup;
if (isInSSRComponentSetup) { if (isInSSRComponentSetup) {
// we will also not call the invalidate callback (+ runner is not set up) // we will also not call the invalidate callback (+ runner is not set up)
onCleanup = NOOP; onCleanup = NOOP;
...@@ -1772,9 +1769,17 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM ...@@ -1772,9 +1769,17 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
onCleanup onCleanup
]); ]);
} }
return NOOP; if (flush === 'sync') {
const ctx = useSSRContext();
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
}
else {
return NOOP;
}
} }
let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE; let oldValue = isMultiSource
? new Array(source.length).fill(INITIAL_WATCHER_VALUE)
: INITIAL_WATCHER_VALUE;
const job = () => { const job = () => {
if (!effect.active) { if (!effect.active) {
return; return;
...@@ -1795,7 +1800,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM ...@@ -1795,7 +1800,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [ callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
newValue, newValue,
// pass undefined as the old value when it's changed for the first time // pass undefined as the old value when it's changed for the first time
oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue, oldValue === INITIAL_WATCHER_VALUE
? undefined
: (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
? []
: oldValue,
onCleanup onCleanup
]); ]);
oldValue = newValue; oldValue = newValue;
...@@ -1843,12 +1852,15 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM ...@@ -1843,12 +1852,15 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
else { else {
effect.run(); effect.run();
} }
return () => { const unwatch = () => {
effect.stop(); effect.stop();
if (instance && instance.scope) { if (instance && instance.scope) {
remove(instance.scope.effects, effect); remove(instance.scope.effects, effect);
} }
}; };
if (ssrCleanup)
ssrCleanup.push(unwatch);
return unwatch;
} }
// this.$watch // this.$watch
function instanceWatch(source, value, options) { function instanceWatch(source, value, options) {
...@@ -2033,7 +2045,11 @@ const BaseTransitionImpl = { ...@@ -2033,7 +2045,11 @@ const BaseTransitionImpl = {
// return placeholder node and queue update when leave finishes // return placeholder node and queue update when leave finishes
leavingHooks.afterLeave = () => { leavingHooks.afterLeave = () => {
state.isLeaving = false; state.isLeaving = false;
instance.update(); // #6835
// it also needs to be updated when active is undefined
if (instance.update.active !== false) {
instance.update();
}
}; };
return emptyPlaceholder(child); return emptyPlaceholder(child);
} }
...@@ -2390,10 +2406,15 @@ function defineAsyncComponent(source) { ...@@ -2390,10 +2406,15 @@ function defineAsyncComponent(source) {
} }
}); });
} }
function createInnerComp(comp, { vnode: { ref, props, children, shapeFlag }, parent }) { function createInnerComp(comp, parent) {
const { ref, props, children, ce } = parent.vnode;
const vnode = createVNode(comp, props, children); const vnode = createVNode(comp, props, children);
// ensure inner component inherits the async wrapper's ref owner // ensure inner component inherits the async wrapper's ref owner
vnode.ref = ref; vnode.ref = ref;
// pass the custom element callback on to the inner comp
// and remove it from the async wrapper
vnode.ce = ce;
delete parent.vnode.ce;
return vnode; return vnode;
} }
...@@ -2669,14 +2690,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { ...@@ -2669,14 +2690,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
}, target); }, target);
} }
function resetShapeFlag(vnode) { function resetShapeFlag(vnode) {
let shapeFlag = vnode.shapeFlag; // bitwise operations to remove keep alive flags
if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) { vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */; vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
}
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
}
vnode.shapeFlag = shapeFlag;
} }
function getInnerChild(vnode) { function getInnerChild(vnode) {
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode; return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
...@@ -2781,23 +2797,25 @@ function withDirectives(vnode, directives) { ...@@ -2781,23 +2797,25 @@ function withDirectives(vnode, directives) {
const bindings = vnode.dirs || (vnode.dirs = []); const bindings = vnode.dirs || (vnode.dirs = []);
for (let i = 0; i < directives.length; i++) { for (let i = 0; i < directives.length; i++) {
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
if (isFunction(dir)) { if (dir) {
dir = { if (isFunction(dir)) {
mounted: dir, dir = {
updated: dir mounted: dir,
}; updated: dir
} };
if (dir.deep) { }
traverse(value); if (dir.deep) {
traverse(value);
}
bindings.push({
dir,
instance,
value,
oldValue: void 0,
arg,
modifiers
});
} }
bindings.push({
dir,
instance,
value,
oldValue: void 0,
arg,
modifiers
});
} }
return vnode; return vnode;
} }
...@@ -2983,7 +3001,9 @@ fallback, noSlotted) { ...@@ -2983,7 +3001,9 @@ fallback, noSlotted) {
(currentRenderingInstance.parent && (currentRenderingInstance.parent &&
isAsyncWrapper(currentRenderingInstance.parent) && isAsyncWrapper(currentRenderingInstance.parent) &&
currentRenderingInstance.parent.isCE)) { currentRenderingInstance.parent.isCE)) {
return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback()); if (name !== 'default')
props.name = name;
return createVNode('slot', props, fallback && fallback());
} }
let slot = slots[name]; let slot = slots[name];
if ((process.env.NODE_ENV !== 'production') && slot && slot.length > 1) { if ((process.env.NODE_ENV !== 'production') && slot && slot.length > 1) {
...@@ -3083,6 +3103,7 @@ const publicPropertiesMap = ...@@ -3083,6 +3103,7 @@ const publicPropertiesMap =
$watch: i => (__VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP) $watch: i => (__VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP)
}); });
const isReservedPrefix = (key) => key === '_' || key === '$'; const isReservedPrefix = (key) => key === '_' || key === '$';
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
const PublicInstanceProxyHandlers = { const PublicInstanceProxyHandlers = {
get({ _: instance }, key) { get({ _: instance }, key) {
const { ctx, setupState, data, props, accessCache, type, appContext } = instance; const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
...@@ -3090,16 +3111,6 @@ const PublicInstanceProxyHandlers = { ...@@ -3090,16 +3111,6 @@ const PublicInstanceProxyHandlers = {
if ((process.env.NODE_ENV !== 'production') && key === '__isVue') { if ((process.env.NODE_ENV !== 'production') && key === '__isVue') {
return true; return true;
} }
// prioritize <script setup> bindings during dev.
// this allows even properties that start with _ or $ to be used - so that
// it aligns with the production behavior where the render fn is inlined and
// indeed has access to all declared variables.
if ((process.env.NODE_ENV !== 'production') &&
setupState !== EMPTY_OBJ &&
setupState.__isScriptSetup &&
hasOwn(setupState, key)) {
return setupState[key];
}
// data / props / ctx // data / props / ctx
// This getter gets called for every property access on the render context // This getter gets called for every property access on the render context
// during render and is a major hotspot. The most expensive part of this // during render and is a major hotspot. The most expensive part of this
...@@ -3122,7 +3133,7 @@ const PublicInstanceProxyHandlers = { ...@@ -3122,7 +3133,7 @@ const PublicInstanceProxyHandlers = {
// default: just fallthrough // default: just fallthrough
} }
} }
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) { else if (hasSetupBinding(setupState, key)) {
accessCache[key] = 1 /* AccessTypes.SETUP */; accessCache[key] = 1 /* AccessTypes.SETUP */;
return setupState[key]; return setupState[key];
} }
...@@ -3193,23 +3204,28 @@ const PublicInstanceProxyHandlers = { ...@@ -3193,23 +3204,28 @@ const PublicInstanceProxyHandlers = {
}, },
set({ _: instance }, key, value) { set({ _: instance }, key, value) {
const { data, setupState, ctx } = instance; const { data, setupState, ctx } = instance;
if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) { if (hasSetupBinding(setupState, key)) {
setupState[key] = value; setupState[key] = value;
return true; return true;
} }
else if ((process.env.NODE_ENV !== 'production') &&
setupState.__isScriptSetup &&
hasOwn(setupState, key)) {
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
return false;
}
else if (data !== EMPTY_OBJ && hasOwn(data, key)) { else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
data[key] = value; data[key] = value;
return true; return true;
} }
else if (hasOwn(instance.props, key)) { else if (hasOwn(instance.props, key)) {
(process.env.NODE_ENV !== 'production') && (process.env.NODE_ENV !== 'production') && warn(`Attempting to mutate prop "${key}". Props are readonly.`);
warn(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
return false; return false;
} }
if (key[0] === '$' && key.slice(1) in instance) { if (key[0] === '$' && key.slice(1) in instance) {
(process.env.NODE_ENV !== 'production') && (process.env.NODE_ENV !== 'production') &&
warn(`Attempting to mutate public property "${key}". ` + warn(`Attempting to mutate public property "${key}". ` +
`Properties starting with $ are reserved and readonly.`, instance); `Properties starting with $ are reserved and readonly.`);
return false; return false;
} }
else { else {
...@@ -3230,7 +3246,7 @@ const PublicInstanceProxyHandlers = { ...@@ -3230,7 +3246,7 @@ const PublicInstanceProxyHandlers = {
let normalizedProps; let normalizedProps;
return (!!accessCache[key] || return (!!accessCache[key] ||
(data !== EMPTY_OBJ && hasOwn(data, key)) || (data !== EMPTY_OBJ && hasOwn(data, key)) ||
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) || hasSetupBinding(setupState, key) ||
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) || ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
hasOwn(ctx, key) || hasOwn(ctx, key) ||
hasOwn(publicPropertiesMap, key) || hasOwn(publicPropertiesMap, key) ||
...@@ -4025,7 +4041,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) { ...@@ -4025,7 +4041,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
if (validatePropName(normalizedKey)) { if (validatePropName(normalizedKey)) {
const opt = raw[key]; const opt = raw[key];
const prop = (normalized[normalizedKey] = const prop = (normalized[normalizedKey] =
isArray(opt) || isFunction(opt) ? { type: opt } : opt); isArray(opt) || isFunction(opt) ? { type: opt } : Object.assign({}, opt));
if (prop) { if (prop) {
const booleanIndex = getTypeIndex(Boolean, prop.type); const booleanIndex = getTypeIndex(Boolean, prop.type);
const stringIndex = getTypeIndex(String, prop.type); const stringIndex = getTypeIndex(String, prop.type);
...@@ -6350,6 +6366,10 @@ function traverseStaticChildren(n1, n2, shallow = false) { ...@@ -6350,6 +6366,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
if (!shallow) if (!shallow)
traverseStaticChildren(c1, c2); traverseStaticChildren(c1, c2);
} }
// #6852 also inherit for text nodes
if (c2.type === Text) {
c2.el = c1.el;
}
// also inherit for comment nodes, but not placeholders (e.g. v-if which // also inherit for comment nodes, but not placeholders (e.g. v-if which
// would have received .el during block patch) // would have received .el during block patch)
if ((process.env.NODE_ENV !== 'production') && c2.type === Comment && !c2.el) { if ((process.env.NODE_ENV !== 'production') && c2.type === Comment && !c2.el) {
...@@ -6524,6 +6544,7 @@ const TeleportImpl = { ...@@ -6524,6 +6544,7 @@ const TeleportImpl = {
} }
} }
} }
updateCssVars(n2);
}, },
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) { remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode; const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
...@@ -6602,11 +6623,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope ...@@ -6602,11 +6623,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized); hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
} }
} }
updateCssVars(vnode);
} }
return vnode.anchor && nextSibling(vnode.anchor); return vnode.anchor && nextSibling(vnode.anchor);
} }
// Force-casted public typing for h and TSX props inference // Force-casted public typing for h and TSX props inference
const Teleport = TeleportImpl; const Teleport = TeleportImpl;
function updateCssVars(vnode) {
// presence of .ut method indicates owner component uses css vars.
// code path here can assume browser environment.
const ctx = vnode.ctx;
if (ctx && ctx.ut) {
let node = vnode.children[0].el;
while (node !== vnode.targetAnchor) {
if (node.nodeType === 1)
node.setAttribute('data-v-owner', ctx.uid);
node = node.nextSibling;
}
ctx.ut();
}
}
const Fragment = Symbol((process.env.NODE_ENV !== 'production') ? 'Fragment' : undefined); const Fragment = Symbol((process.env.NODE_ENV !== 'production') ? 'Fragment' : undefined);
const Text = Symbol((process.env.NODE_ENV !== 'production') ? 'Text' : undefined); const Text = Symbol((process.env.NODE_ENV !== 'production') ? 'Text' : undefined);
...@@ -6702,6 +6738,10 @@ function isSameVNodeType(n1, n2) { ...@@ -6702,6 +6738,10 @@ function isSameVNodeType(n1, n2) {
if ((process.env.NODE_ENV !== 'production') && if ((process.env.NODE_ENV !== 'production') &&
n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
hmrDirtyComponents.has(n2.type)) { hmrDirtyComponents.has(n2.type)) {
// #7042, ensure the vnode being unmounted during HMR
// bitwise operations to remove keep alive flags
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
// HMR only: if the component has been hot-updated, force a reload. // HMR only: if the component has been hot-updated, force a reload.
return false; return false;
} }
...@@ -6759,7 +6799,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn ...@@ -6759,7 +6799,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
dynamicChildren: null, dynamicChildren: null,
appContext: null, appContext: null,
// fixed by xxxxxx // fixed by xxxxxx
hostInstance: currentRenderingInstance hostInstance: currentRenderingInstance,
ctx: currentRenderingInstance
}; };
if (needFullChildrenNormalization) { if (needFullChildrenNormalization) {
normalizeChildren(vnode, children); normalizeChildren(vnode, children);
...@@ -6928,7 +6969,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) { ...@@ -6928,7 +6969,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
el: vnode.el, el: vnode.el,
anchor: vnode.anchor anchor: vnode.anchor,
ctx: vnode.ctx
}; };
return cloned; return cloned;
} }
...@@ -7465,6 +7507,9 @@ function getExposeProxy(instance) { ...@@ -7465,6 +7507,9 @@ function getExposeProxy(instance) {
else if (key in publicPropertiesMap) { else if (key in publicPropertiesMap) {
return publicPropertiesMap[key](instance); return publicPropertiesMap[key](instance);
} }
},
has(target, key) {
return key in target || key in publicPropertiesMap;
} }
}))); })));
} }
...@@ -7694,8 +7739,9 @@ const useSSRContext = () => { ...@@ -7694,8 +7739,9 @@ const useSSRContext = () => {
{ {
const ctx = inject(ssrContextKey); const ctx = inject(ssrContextKey);
if (!ctx) { if (!ctx) {
warn(`Server rendering context not provided. Make sure to only call ` + (process.env.NODE_ENV !== 'production') &&
`useSSRContext() conditionally in the server build.`); warn(`Server rendering context not provided. Make sure to only call ` +
`useSSRContext() conditionally in the server build.`);
} }
return ctx; return ctx;
} }
...@@ -7922,7 +7968,7 @@ function isMemoSame(cached, memo) { ...@@ -7922,7 +7968,7 @@ function isMemoSame(cached, memo) {
} }
// Core API ------------------------------------------------------------------ // Core API ------------------------------------------------------------------
const version = "3.2.41"; const version = "3.2.45";
/** /**
* @internal only exposed in compat builds * @internal only exposed in compat builds
*/ */
......
...@@ -12,6 +12,8 @@ function popWarningContext() { ...@@ -12,6 +12,8 @@ function popWarningContext() {
stack.pop(); stack.pop();
} }
function warn(msg, ...args) { function warn(msg, ...args) {
if (!(process.env.NODE_ENV !== 'production'))
return;
// avoid props formatting or warn handler tracking deps that might be mutated // avoid props formatting or warn handler tracking deps that might be mutated
// during patch, leading to infinite recursion. // during patch, leading to infinite recursion.
pauseTracking(); pauseTracking();
...@@ -528,12 +530,6 @@ function reload(id, newComp) { ...@@ -528,12 +530,6 @@ function reload(id, newComp) {
// components to be unmounted and re-mounted. Queue the update so that we // components to be unmounted and re-mounted. Queue the update so that we
// don't end up forcing the same parent to re-render multiple times. // don't end up forcing the same parent to re-render multiple times.
queueJob(instance.parent.update); queueJob(instance.parent.update);
// instance is the inner component of an async custom element
// invoke to reset styles
if (instance.parent.type.__asyncLoader &&
instance.parent.ceReload) {
instance.parent.ceReload(newComp.styles);
}
} }
else if (instance.appContext.reload) { else if (instance.appContext.reload) {
// root instance mounted via createApp() has a reload method // root instance mounted via createApp() has a reload method
...@@ -698,7 +694,7 @@ function emit$1(instance, event, ...rawArgs) { ...@@ -698,7 +694,7 @@ function emit$1(instance, event, ...rawArgs) {
const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`; const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;
const { number, trim } = props[modifiersKey] || EMPTY_OBJ; const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
if (trim) { if (trim) {
args = rawArgs.map(a => a.trim()); args = rawArgs.map(a => (isString(a) ? a.trim() : a));
} }
if (number) { if (number) {
args = rawArgs.map(toNumber); args = rawArgs.map(toNumber);
...@@ -1768,7 +1764,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM ...@@ -1768,7 +1764,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
}; };
}; };
// in SSR there is no need to setup an actual effect, and it should be noop // in SSR there is no need to setup an actual effect, and it should be noop
// unless it's eager // unless it's eager or sync flush
let ssrCleanup;
if (isInSSRComponentSetup) { if (isInSSRComponentSetup) {
// we will also not call the invalidate callback (+ runner is not set up) // we will also not call the invalidate callback (+ runner is not set up)
onCleanup = NOOP; onCleanup = NOOP;
...@@ -1782,9 +1779,17 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM ...@@ -1782,9 +1779,17 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
onCleanup onCleanup
]); ]);
} }
return NOOP; if (flush === 'sync') {
const ctx = useSSRContext();
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
}
else {
return NOOP;
}
} }
let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE; let oldValue = isMultiSource
? new Array(source.length).fill(INITIAL_WATCHER_VALUE)
: INITIAL_WATCHER_VALUE;
const job = () => { const job = () => {
if (!effect.active) { if (!effect.active) {
return; return;
...@@ -1805,7 +1810,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM ...@@ -1805,7 +1810,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [ callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
newValue, newValue,
// pass undefined as the old value when it's changed for the first time // pass undefined as the old value when it's changed for the first time
oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue, oldValue === INITIAL_WATCHER_VALUE
? undefined
: (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
? []
: oldValue,
onCleanup onCleanup
]); ]);
oldValue = newValue; oldValue = newValue;
...@@ -1853,12 +1862,15 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM ...@@ -1853,12 +1862,15 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
else { else {
effect.run(); effect.run();
} }
return () => { const unwatch = () => {
effect.stop(); effect.stop();
if (instance && instance.scope) { if (instance && instance.scope) {
remove(instance.scope.effects, effect); remove(instance.scope.effects, effect);
} }
}; };
if (ssrCleanup)
ssrCleanup.push(unwatch);
return unwatch;
} }
// this.$watch // this.$watch
function instanceWatch(source, value, options) { function instanceWatch(source, value, options) {
...@@ -2043,7 +2055,11 @@ const BaseTransitionImpl = { ...@@ -2043,7 +2055,11 @@ const BaseTransitionImpl = {
// return placeholder node and queue update when leave finishes // return placeholder node and queue update when leave finishes
leavingHooks.afterLeave = () => { leavingHooks.afterLeave = () => {
state.isLeaving = false; state.isLeaving = false;
instance.update(); // #6835
// it also needs to be updated when active is undefined
if (instance.update.active !== false) {
instance.update();
}
}; };
return emptyPlaceholder(child); return emptyPlaceholder(child);
} }
...@@ -2400,10 +2416,15 @@ function defineAsyncComponent(source) { ...@@ -2400,10 +2416,15 @@ function defineAsyncComponent(source) {
} }
}); });
} }
function createInnerComp(comp, { vnode: { ref, props, children, shapeFlag }, parent }) { function createInnerComp(comp, parent) {
const { ref, props, children, ce } = parent.vnode;
const vnode = createVNode(comp, props, children); const vnode = createVNode(comp, props, children);
// ensure inner component inherits the async wrapper's ref owner // ensure inner component inherits the async wrapper's ref owner
vnode.ref = ref; vnode.ref = ref;
// pass the custom element callback on to the inner comp
// and remove it from the async wrapper
vnode.ce = ce;
delete parent.vnode.ce;
return vnode; return vnode;
} }
...@@ -2679,14 +2700,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { ...@@ -2679,14 +2700,9 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
}, target); }, target);
} }
function resetShapeFlag(vnode) { function resetShapeFlag(vnode) {
let shapeFlag = vnode.shapeFlag; // bitwise operations to remove keep alive flags
if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) { vnode.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */; vnode.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
}
if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
}
vnode.shapeFlag = shapeFlag;
} }
function getInnerChild(vnode) { function getInnerChild(vnode) {
return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode; return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
...@@ -2795,23 +2811,25 @@ function withDirectives(vnode, directives) { ...@@ -2795,23 +2811,25 @@ function withDirectives(vnode, directives) {
const bindings = vnode.dirs || (vnode.dirs = []); const bindings = vnode.dirs || (vnode.dirs = []);
for (let i = 0; i < directives.length; i++) { for (let i = 0; i < directives.length; i++) {
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
if (isFunction(dir)) { if (dir) {
dir = { if (isFunction(dir)) {
mounted: dir, dir = {
updated: dir mounted: dir,
}; updated: dir
} };
if (dir.deep) { }
traverse(value); if (dir.deep) {
traverse(value);
}
bindings.push({
dir,
instance,
value,
oldValue: void 0,
arg,
modifiers
});
} }
bindings.push({
dir,
instance,
value,
oldValue: void 0,
arg,
modifiers
});
} }
return vnode; return vnode;
} }
...@@ -2997,7 +3015,9 @@ fallback, noSlotted) { ...@@ -2997,7 +3015,9 @@ fallback, noSlotted) {
(currentRenderingInstance.parent && (currentRenderingInstance.parent &&
isAsyncWrapper(currentRenderingInstance.parent) && isAsyncWrapper(currentRenderingInstance.parent) &&
currentRenderingInstance.parent.isCE)) { currentRenderingInstance.parent.isCE)) {
return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback()); if (name !== 'default')
props.name = name;
return createVNode('slot', props, fallback && fallback());
} }
let slot = slots[name]; let slot = slots[name];
if ((process.env.NODE_ENV !== 'production') && slot && slot.length > 1) { if ((process.env.NODE_ENV !== 'production') && slot && slot.length > 1) {
...@@ -3097,6 +3117,7 @@ const publicPropertiesMap = ...@@ -3097,6 +3117,7 @@ const publicPropertiesMap =
$watch: i => (__VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP) $watch: i => (__VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP)
}); });
const isReservedPrefix = (key) => key === '_' || key === '$'; const isReservedPrefix = (key) => key === '_' || key === '$';
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
const PublicInstanceProxyHandlers = { const PublicInstanceProxyHandlers = {
get({ _: instance }, key) { get({ _: instance }, key) {
const { ctx, setupState, data, props, accessCache, type, appContext } = instance; const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
...@@ -3104,16 +3125,6 @@ const PublicInstanceProxyHandlers = { ...@@ -3104,16 +3125,6 @@ const PublicInstanceProxyHandlers = {
if ((process.env.NODE_ENV !== 'production') && key === '__isVue') { if ((process.env.NODE_ENV !== 'production') && key === '__isVue') {
return true; return true;
} }
// prioritize <script setup> bindings during dev.
// this allows even properties that start with _ or $ to be used - so that
// it aligns with the production behavior where the render fn is inlined and
// indeed has access to all declared variables.
if ((process.env.NODE_ENV !== 'production') &&
setupState !== EMPTY_OBJ &&
setupState.__isScriptSetup &&
hasOwn(setupState, key)) {
return setupState[key];
}
// data / props / ctx // data / props / ctx
// This getter gets called for every property access on the render context // This getter gets called for every property access on the render context
// during render and is a major hotspot. The most expensive part of this // during render and is a major hotspot. The most expensive part of this
...@@ -3136,7 +3147,7 @@ const PublicInstanceProxyHandlers = { ...@@ -3136,7 +3147,7 @@ const PublicInstanceProxyHandlers = {
// default: just fallthrough // default: just fallthrough
} }
} }
else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) { else if (hasSetupBinding(setupState, key)) {
accessCache[key] = 1 /* AccessTypes.SETUP */; accessCache[key] = 1 /* AccessTypes.SETUP */;
return setupState[key]; return setupState[key];
} }
...@@ -3207,23 +3218,28 @@ const PublicInstanceProxyHandlers = { ...@@ -3207,23 +3218,28 @@ const PublicInstanceProxyHandlers = {
}, },
set({ _: instance }, key, value) { set({ _: instance }, key, value) {
const { data, setupState, ctx } = instance; const { data, setupState, ctx } = instance;
if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) { if (hasSetupBinding(setupState, key)) {
setupState[key] = value; setupState[key] = value;
return true; return true;
} }
else if ((process.env.NODE_ENV !== 'production') &&
setupState.__isScriptSetup &&
hasOwn(setupState, key)) {
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
return false;
}
else if (data !== EMPTY_OBJ && hasOwn(data, key)) { else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
data[key] = value; data[key] = value;
return true; return true;
} }
else if (hasOwn(instance.props, key)) { else if (hasOwn(instance.props, key)) {
(process.env.NODE_ENV !== 'production') && (process.env.NODE_ENV !== 'production') && warn(`Attempting to mutate prop "${key}". Props are readonly.`);
warn(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
return false; return false;
} }
if (key[0] === '$' && key.slice(1) in instance) { if (key[0] === '$' && key.slice(1) in instance) {
(process.env.NODE_ENV !== 'production') && (process.env.NODE_ENV !== 'production') &&
warn(`Attempting to mutate public property "${key}". ` + warn(`Attempting to mutate public property "${key}". ` +
`Properties starting with $ are reserved and readonly.`, instance); `Properties starting with $ are reserved and readonly.`);
return false; return false;
} }
else { else {
...@@ -3244,7 +3260,7 @@ const PublicInstanceProxyHandlers = { ...@@ -3244,7 +3260,7 @@ const PublicInstanceProxyHandlers = {
let normalizedProps; let normalizedProps;
return (!!accessCache[key] || return (!!accessCache[key] ||
(data !== EMPTY_OBJ && hasOwn(data, key)) || (data !== EMPTY_OBJ && hasOwn(data, key)) ||
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) || hasSetupBinding(setupState, key) ||
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) || ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
hasOwn(ctx, key) || hasOwn(ctx, key) ||
hasOwn(publicPropertiesMap, key) || hasOwn(publicPropertiesMap, key) ||
...@@ -4039,7 +4055,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) { ...@@ -4039,7 +4055,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
if (validatePropName(normalizedKey)) { if (validatePropName(normalizedKey)) {
const opt = raw[key]; const opt = raw[key];
const prop = (normalized[normalizedKey] = const prop = (normalized[normalizedKey] =
isArray(opt) || isFunction(opt) ? { type: opt } : opt); isArray(opt) || isFunction(opt) ? { type: opt } : Object.assign({}, opt));
if (prop) { if (prop) {
const booleanIndex = getTypeIndex(Boolean, prop.type); const booleanIndex = getTypeIndex(Boolean, prop.type);
const stringIndex = getTypeIndex(String, prop.type); const stringIndex = getTypeIndex(String, prop.type);
...@@ -6364,6 +6380,10 @@ function traverseStaticChildren(n1, n2, shallow = false) { ...@@ -6364,6 +6380,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
if (!shallow) if (!shallow)
traverseStaticChildren(c1, c2); traverseStaticChildren(c1, c2);
} }
// #6852 also inherit for text nodes
if (c2.type === Text) {
c2.el = c1.el;
}
// also inherit for comment nodes, but not placeholders (e.g. v-if which // also inherit for comment nodes, but not placeholders (e.g. v-if which
// would have received .el during block patch) // would have received .el during block patch)
if ((process.env.NODE_ENV !== 'production') && c2.type === Comment && !c2.el) { if ((process.env.NODE_ENV !== 'production') && c2.type === Comment && !c2.el) {
...@@ -6538,6 +6558,7 @@ const TeleportImpl = { ...@@ -6538,6 +6558,7 @@ const TeleportImpl = {
} }
} }
} }
updateCssVars(n2);
}, },
remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) { remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode; const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
...@@ -6616,11 +6637,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope ...@@ -6616,11 +6637,26 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized); hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
} }
} }
updateCssVars(vnode);
} }
return vnode.anchor && nextSibling(vnode.anchor); return vnode.anchor && nextSibling(vnode.anchor);
} }
// Force-casted public typing for h and TSX props inference // Force-casted public typing for h and TSX props inference
const Teleport = TeleportImpl; const Teleport = TeleportImpl;
function updateCssVars(vnode) {
// presence of .ut method indicates owner component uses css vars.
// code path here can assume browser environment.
const ctx = vnode.ctx;
if (ctx && ctx.ut) {
let node = vnode.children[0].el;
while (node !== vnode.targetAnchor) {
if (node.nodeType === 1)
node.setAttribute('data-v-owner', ctx.uid);
node = node.nextSibling;
}
ctx.ut();
}
}
const Fragment = Symbol((process.env.NODE_ENV !== 'production') ? 'Fragment' : undefined); const Fragment = Symbol((process.env.NODE_ENV !== 'production') ? 'Fragment' : undefined);
const Text = Symbol((process.env.NODE_ENV !== 'production') ? 'Text' : undefined); const Text = Symbol((process.env.NODE_ENV !== 'production') ? 'Text' : undefined);
...@@ -6716,6 +6752,10 @@ function isSameVNodeType(n1, n2) { ...@@ -6716,6 +6752,10 @@ function isSameVNodeType(n1, n2) {
if ((process.env.NODE_ENV !== 'production') && if ((process.env.NODE_ENV !== 'production') &&
n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
hmrDirtyComponents.has(n2.type)) { hmrDirtyComponents.has(n2.type)) {
// #7042, ensure the vnode being unmounted during HMR
// bitwise operations to remove keep alive flags
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
// HMR only: if the component has been hot-updated, force a reload. // HMR only: if the component has been hot-updated, force a reload.
return false; return false;
} }
...@@ -6771,7 +6811,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn ...@@ -6771,7 +6811,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
patchFlag, patchFlag,
dynamicProps, dynamicProps,
dynamicChildren: null, dynamicChildren: null,
appContext: null appContext: null,
ctx: currentRenderingInstance
}; };
if (needFullChildrenNormalization) { if (needFullChildrenNormalization) {
normalizeChildren(vnode, children); normalizeChildren(vnode, children);
...@@ -6938,7 +6979,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) { ...@@ -6938,7 +6979,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
el: vnode.el, el: vnode.el,
anchor: vnode.anchor anchor: vnode.anchor,
ctx: vnode.ctx
}; };
return cloned; return cloned;
} }
...@@ -7475,6 +7517,9 @@ function getExposeProxy(instance) { ...@@ -7475,6 +7517,9 @@ function getExposeProxy(instance) {
else if (key in publicPropertiesMap) { else if (key in publicPropertiesMap) {
return publicPropertiesMap[key](instance); return publicPropertiesMap[key](instance);
} }
},
has(target, key) {
return key in target || key in publicPropertiesMap;
} }
}))); })));
} }
...@@ -7704,8 +7749,9 @@ const useSSRContext = () => { ...@@ -7704,8 +7749,9 @@ const useSSRContext = () => {
{ {
const ctx = inject(ssrContextKey); const ctx = inject(ssrContextKey);
if (!ctx) { if (!ctx) {
warn(`Server rendering context not provided. Make sure to only call ` + (process.env.NODE_ENV !== 'production') &&
`useSSRContext() conditionally in the server build.`); warn(`Server rendering context not provided. Make sure to only call ` +
`useSSRContext() conditionally in the server build.`);
} }
return ctx; return ctx;
} }
...@@ -7932,7 +7978,7 @@ function isMemoSame(cached, memo) { ...@@ -7932,7 +7978,7 @@ function isMemoSame(cached, memo) {
} }
// Core API ------------------------------------------------------------------ // Core API ------------------------------------------------------------------
const version = "3.2.41"; const version = "3.2.45";
const _ssrUtils = { const _ssrUtils = {
createComponentInstance, createComponentInstance,
setupComponent, setupComponent,
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"@dcloudio/uni-push": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-push": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-stat": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-stat": "3.0.0-alpha-3060920221111002",
"@vue/shared": "3.2.41" "@vue/shared": "3.2.45"
}, },
"peerDependencies": { "peerDependencies": {
"@dcloudio/types": "^3.0.19" "@dcloudio/types": "^3.0.19"
......
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
"@intlify/shared": "9.1.9", "@intlify/shared": "9.1.9",
"@intlify/vue-devtools": "9.1.9", "@intlify/vue-devtools": "9.1.9",
"@rollup/pluginutils": "^4.2.0", "@rollup/pluginutils": "^4.2.0",
"@vue/compiler-core": "3.2.41", "@vue/compiler-core": "3.2.45",
"@vue/compiler-dom": "3.2.41", "@vue/compiler-dom": "3.2.45",
"@vue/compiler-sfc": "3.2.41", "@vue/compiler-sfc": "3.2.45",
"@vue/server-renderer": "3.2.41", "@vue/server-renderer": "3.2.45",
"@vue/shared": "3.2.41", "@vue/shared": "3.2.45",
"autoprefixer": "^10.4.13", "autoprefixer": "^10.4.13",
"base64url": "^3.0.1", "base64url": "^3.0.1",
"chokidar": "^3.5.3", "chokidar": "^3.5.3",
...@@ -77,6 +77,6 @@ ...@@ -77,6 +77,6 @@
"@types/sass": "^1.43.1", "@types/sass": "^1.43.1",
"@types/stylus": "^0.48.36", "@types/stylus": "^0.48.36",
"postcss": "^8.4.16", "postcss": "^8.4.16",
"vue": "3.2.41" "vue": "3.2.45"
} }
} }
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-cli-shared": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-i18n": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-i18n": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@vue/shared": "3.2.41", "@vue/shared": "3.2.45",
"fast-glob": "^3.2.11" "fast-glob": "^3.2.11"
} }
} }
import { EventChannel } from '@dcloudio/uni-shared' import { EventChannel } from '@dcloudio/uni-shared'
import { ComponentPublicInstance } from 'vue' import { ComponentPublicInstance } from 'vue'
export function getOpenerEventChannel(this: ComponentPublicInstance) { export function getOpenerEventChannel(
this: ComponentPublicInstance
): EventChannel | undefined {
if (__PLATFORM__ === 'h5') { if (__PLATFORM__ === 'h5') {
if (this.$route) { if (this.$route) {
const meta = this.$route.meta const meta = this.$route.meta
if (!meta.eventChannel) { if (!meta.eventChannel) {
meta.eventChannel = new EventChannel(this.$page.id) meta.eventChannel = new EventChannel(this.$page.id)
} }
return meta.eventChannel return meta.eventChannel as EventChannel
} }
} }
// TODO App // TODO App
......
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-cli-shared": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@rollup/pluginutils": "^4.2.0", "@rollup/pluginutils": "^4.2.0",
"@vue/compiler-dom": "3.2.41", "@vue/compiler-dom": "3.2.45",
"@vue/compiler-sfc": "3.2.41", "@vue/compiler-sfc": "3.2.45",
"@vue/server-renderer": "3.2.41", "@vue/server-renderer": "3.2.45",
"@vue/shared": "3.2.41", "@vue/shared": "3.2.45",
"debug": "^4.3.3", "debug": "^4.3.3",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
"mime": "^3.0.0", "mime": "^3.0.0",
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
"@types/mime": "^2.0.3", "@types/mime": "^2.0.3",
"@types/module-alias": "^2.0.1", "@types/module-alias": "^2.0.1",
"@types/resolve": "^1.20.2", "@types/resolve": "^1.20.2",
"@vue/compiler-core": "3.2.41", "@vue/compiler-core": "3.2.45",
"esbuild": "^0.15.9", "esbuild": "^0.15.9",
"vue": "3.2.41" "vue": "3.2.45"
} }
} }
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
"@dcloudio/uni-h5-vue": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-h5-vue": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-i18n": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-i18n": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@vue/server-renderer": "3.2.41", "@vue/server-renderer": "3.2.45",
"@vue/shared": "3.2.41", "@vue/shared": "3.2.45",
"localstorage-polyfill": "^1.0.1", "localstorage-polyfill": "^1.0.1",
"safe-area-insets": "^1.4.1", "safe-area-insets": "^1.4.1",
"vue-router": "^4.1.6", "vue-router": "^4.1.6",
...@@ -49,6 +49,6 @@ ...@@ -49,6 +49,6 @@
"acorn-loose": "^8.2.1", "acorn-loose": "^8.2.1",
"acorn-walk": "^8.2.0", "acorn-walk": "^8.2.0",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"vue": "3.2.41" "vue": "3.2.45"
} }
} }
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-vite": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-vue": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@vue/compiler-core": "3.2.41", "@vue/compiler-core": "3.2.45",
"@vue/shared": "3.2.41" "@vue/shared": "3.2.45"
} }
} }
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-vue": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-weixin": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@vue/compiler-core": "3.2.41", "@vue/compiler-core": "3.2.45",
"@vue/shared": "3.2.41" "@vue/shared": "3.2.45"
} }
} }
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
"@babel/types": "^7.20.0", "@babel/types": "^7.20.0",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-cli-shared": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@vue/compiler-core": "3.2.41", "@vue/compiler-core": "3.2.45",
"@vue/compiler-dom": "3.2.41", "@vue/compiler-dom": "3.2.45",
"@vue/shared": "3.2.41", "@vue/shared": "3.2.45",
"estree-walker": "^2.0.2" "estree-walker": "^2.0.2"
}, },
"devDependencies": { "devDependencies": {
"@types/babel__generator": "^7.6.4", "@types/babel__generator": "^7.6.4",
"@vue/compiler-sfc": "3.2.41", "@vue/compiler-sfc": "3.2.45",
"source-map": "^0.6.1" "source-map": "^0.6.1"
} }
} }
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-vue": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-weixin": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@vue/compiler-core": "3.2.41", "@vue/compiler-core": "3.2.45",
"@vue/shared": "3.2.41" "@vue/shared": "3.2.45"
} }
} }
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-vite": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-vue": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@vue/compiler-core": "3.2.41", "@vue/compiler-core": "3.2.45",
"@vue/shared": "3.2.41" "@vue/shared": "3.2.45"
} }
} }
...@@ -28,14 +28,14 @@ ...@@ -28,14 +28,14 @@
"devDependencies": { "devDependencies": {
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-weixin": "3.0.0-alpha-3060920221111002",
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^9.0.13",
"@vue/compiler-core": "3.2.41" "@vue/compiler-core": "3.2.45"
}, },
"dependencies": { "dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-cli-shared": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-vite": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-mp-vue": "3.0.0-alpha-3060920221111002",
"@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002", "@dcloudio/uni-shared": "3.0.0-alpha-3060920221111002",
"@vue/shared": "3.2.41", "@vue/shared": "3.2.45",
"fs-extra": "^10.0.0" "fs-extra": "^10.0.0"
} }
} }
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册