@vue/runtime-dom 3.6.0-alpha.5 → 3.6.0-alpha.7
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/dist/runtime-dom.cjs.js +1 -1
- package/dist/runtime-dom.cjs.prod.js +1 -1
- package/dist/runtime-dom.d.ts +1 -1
- package/dist/runtime-dom.esm-browser.js +105 -74
- package/dist/runtime-dom.esm-browser.prod.js +3 -3
- package/dist/runtime-dom.esm-bundler.js +1 -1
- package/dist/runtime-dom.global.js +105 -74
- package/dist/runtime-dom.global.prod.js +3 -3
- package/package.json +4 -4
package/dist/runtime-dom.cjs.js
CHANGED
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-alpha.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-alpha.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1997,6 +1997,16 @@ class EffectScope {
|
|
|
1997
1997
|
return;
|
|
1998
1998
|
}
|
|
1999
1999
|
this.flags = 1024;
|
|
2000
|
+
this.reset();
|
|
2001
|
+
const sub = this.subs;
|
|
2002
|
+
if (sub !== void 0) {
|
|
2003
|
+
unlink(sub);
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
/**
|
|
2007
|
+
* @internal
|
|
2008
|
+
*/
|
|
2009
|
+
reset() {
|
|
2000
2010
|
let dep = this.deps;
|
|
2001
2011
|
while (dep !== void 0) {
|
|
2002
2012
|
const node = dep.dep;
|
|
@@ -2007,10 +2017,6 @@ class EffectScope {
|
|
|
2007
2017
|
dep = unlink(dep, this);
|
|
2008
2018
|
}
|
|
2009
2019
|
}
|
|
2010
|
-
const sub = this.subs;
|
|
2011
|
-
if (sub !== void 0) {
|
|
2012
|
-
unlink(sub);
|
|
2013
|
-
}
|
|
2014
2020
|
cleanup(this);
|
|
2015
2021
|
}
|
|
2016
2022
|
}
|
|
@@ -2822,6 +2828,7 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
2822
2828
|
|
|
2823
2829
|
let isHmrUpdating = false;
|
|
2824
2830
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
2831
|
+
const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
|
|
2825
2832
|
{
|
|
2826
2833
|
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
2827
2834
|
createRecord: tryWrap(createRecord),
|
|
@@ -2885,9 +2892,10 @@ function reload(id, newComp) {
|
|
|
2885
2892
|
const record = map.get(id);
|
|
2886
2893
|
if (!record) return;
|
|
2887
2894
|
newComp = normalizeClassComponent(newComp);
|
|
2895
|
+
const isVapor = record.initialDef.__vapor;
|
|
2888
2896
|
updateComponentDef(record.initialDef, newComp);
|
|
2889
2897
|
const instances = [...record.instances];
|
|
2890
|
-
if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2898
|
+
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2891
2899
|
for (const instance of instances) {
|
|
2892
2900
|
if (instance.root && instance.root.ce && instance !== instance.root) {
|
|
2893
2901
|
instance.root.ce._removeChildStyle(instance.type);
|
|
@@ -2907,6 +2915,7 @@ function reload(id, newComp) {
|
|
|
2907
2915
|
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2908
2916
|
}
|
|
2909
2917
|
dirtyInstances.add(instance);
|
|
2918
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2910
2919
|
instance.appContext.propsCache.delete(instance.type);
|
|
2911
2920
|
instance.appContext.emitsCache.delete(instance.type);
|
|
2912
2921
|
instance.appContext.optionsCache.delete(instance.type);
|
|
@@ -2947,6 +2956,7 @@ function reload(id, newComp) {
|
|
|
2947
2956
|
}
|
|
2948
2957
|
queuePostFlushCb(() => {
|
|
2949
2958
|
hmrDirtyComponents.clear();
|
|
2959
|
+
hmrDirtyComponentsMode.clear();
|
|
2950
2960
|
});
|
|
2951
2961
|
}
|
|
2952
2962
|
function updateComponentDef(oldComp, newComp) {
|
|
@@ -3577,7 +3587,7 @@ const BaseTransitionPropsValidators = {
|
|
|
3577
3587
|
onAppearCancelled: TransitionHookValidator
|
|
3578
3588
|
};
|
|
3579
3589
|
const recursiveGetSubtree = (instance) => {
|
|
3580
|
-
const subTree = instance.type
|
|
3590
|
+
const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
|
|
3581
3591
|
return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
|
|
3582
3592
|
};
|
|
3583
3593
|
const BaseTransitionImpl = {
|
|
@@ -3884,7 +3894,7 @@ function getInnerChild$1(vnode) {
|
|
|
3884
3894
|
}
|
|
3885
3895
|
function setTransitionHooks(vnode, hooks) {
|
|
3886
3896
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
3887
|
-
if (vnode.type
|
|
3897
|
+
if (isVaporComponent(vnode.type)) {
|
|
3888
3898
|
getVaporInterface(vnode.component, vnode).setTransitionHooks(
|
|
3889
3899
|
vnode.component,
|
|
3890
3900
|
hooks
|
|
@@ -4293,7 +4303,8 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4293
4303
|
node,
|
|
4294
4304
|
container,
|
|
4295
4305
|
null,
|
|
4296
|
-
parentComponent
|
|
4306
|
+
parentComponent,
|
|
4307
|
+
parentSuspense
|
|
4297
4308
|
);
|
|
4298
4309
|
} else {
|
|
4299
4310
|
mountComponent(
|
|
@@ -7146,29 +7157,7 @@ function renderComponentRoot(instance) {
|
|
|
7146
7157
|
}
|
|
7147
7158
|
root = cloneVNode(root, fallthroughAttrs, false, true);
|
|
7148
7159
|
} else if (!accessedAttrs && root.type !== Comment) {
|
|
7149
|
-
|
|
7150
|
-
const eventAttrs = [];
|
|
7151
|
-
const extraAttrs = [];
|
|
7152
|
-
for (let i = 0, l = allAttrs.length; i < l; i++) {
|
|
7153
|
-
const key = allAttrs[i];
|
|
7154
|
-
if (isOn(key)) {
|
|
7155
|
-
if (!isModelListener(key)) {
|
|
7156
|
-
eventAttrs.push(key[2].toLowerCase() + key.slice(3));
|
|
7157
|
-
}
|
|
7158
|
-
} else {
|
|
7159
|
-
extraAttrs.push(key);
|
|
7160
|
-
}
|
|
7161
|
-
}
|
|
7162
|
-
if (extraAttrs.length) {
|
|
7163
|
-
warn$1(
|
|
7164
|
-
`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
|
|
7165
|
-
);
|
|
7166
|
-
}
|
|
7167
|
-
if (eventAttrs.length) {
|
|
7168
|
-
warn$1(
|
|
7169
|
-
`Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
|
|
7170
|
-
);
|
|
7171
|
-
}
|
|
7160
|
+
warnExtraneousAttributes(attrs);
|
|
7172
7161
|
}
|
|
7173
7162
|
}
|
|
7174
7163
|
}
|
|
@@ -7220,6 +7209,31 @@ const getChildRoot = (vnode) => {
|
|
|
7220
7209
|
};
|
|
7221
7210
|
return [normalizeVNode(childRoot), setRoot];
|
|
7222
7211
|
};
|
|
7212
|
+
function warnExtraneousAttributes(attrs) {
|
|
7213
|
+
const allAttrs = Object.keys(attrs);
|
|
7214
|
+
const eventAttrs = [];
|
|
7215
|
+
const extraAttrs = [];
|
|
7216
|
+
for (let i = 0, l = allAttrs.length; i < l; i++) {
|
|
7217
|
+
const key = allAttrs[i];
|
|
7218
|
+
if (isOn(key)) {
|
|
7219
|
+
if (!isModelListener(key)) {
|
|
7220
|
+
eventAttrs.push(key[2].toLowerCase() + key.slice(3));
|
|
7221
|
+
}
|
|
7222
|
+
} else {
|
|
7223
|
+
extraAttrs.push(key);
|
|
7224
|
+
}
|
|
7225
|
+
}
|
|
7226
|
+
if (extraAttrs.length) {
|
|
7227
|
+
warn$1(
|
|
7228
|
+
`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
|
|
7229
|
+
);
|
|
7230
|
+
}
|
|
7231
|
+
if (eventAttrs.length) {
|
|
7232
|
+
warn$1(
|
|
7233
|
+
`Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
|
|
7234
|
+
);
|
|
7235
|
+
}
|
|
7236
|
+
}
|
|
7223
7237
|
function filterSingleRoot(children, recurse = true) {
|
|
7224
7238
|
let singleRoot;
|
|
7225
7239
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -7969,7 +7983,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7969
7983
|
);
|
|
7970
7984
|
break;
|
|
7971
7985
|
case VaporSlot:
|
|
7972
|
-
getVaporInterface(parentComponent, n2).slot(
|
|
7986
|
+
getVaporInterface(parentComponent, n2).slot(
|
|
7987
|
+
n1,
|
|
7988
|
+
n2,
|
|
7989
|
+
container,
|
|
7990
|
+
anchor,
|
|
7991
|
+
parentComponent
|
|
7992
|
+
);
|
|
7973
7993
|
break;
|
|
7974
7994
|
default:
|
|
7975
7995
|
if (shapeFlag & 1) {
|
|
@@ -8472,7 +8492,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8472
8492
|
n2,
|
|
8473
8493
|
container,
|
|
8474
8494
|
anchor,
|
|
8475
|
-
parentComponent
|
|
8495
|
+
parentComponent,
|
|
8496
|
+
parentSuspense
|
|
8476
8497
|
);
|
|
8477
8498
|
}
|
|
8478
8499
|
} else {
|
|
@@ -8533,7 +8554,42 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8533
8554
|
}
|
|
8534
8555
|
if (isHmrUpdating) initialVNode.el = null;
|
|
8535
8556
|
if (instance.asyncDep) {
|
|
8536
|
-
|
|
8557
|
+
if (parentSuspense) {
|
|
8558
|
+
const hydratedEl = instance.vnode.el;
|
|
8559
|
+
parentSuspense.registerDep(instance, (setupResult) => {
|
|
8560
|
+
const { vnode } = instance;
|
|
8561
|
+
{
|
|
8562
|
+
pushWarningContext(vnode);
|
|
8563
|
+
}
|
|
8564
|
+
handleSetupResult(instance, setupResult, false);
|
|
8565
|
+
if (hydratedEl) {
|
|
8566
|
+
vnode.el = hydratedEl;
|
|
8567
|
+
}
|
|
8568
|
+
const placeholder = !hydratedEl && instance.subTree.el;
|
|
8569
|
+
setupRenderEffect(
|
|
8570
|
+
instance,
|
|
8571
|
+
vnode,
|
|
8572
|
+
// component may have been moved before resolve.
|
|
8573
|
+
// if this is not a hydration, instance.subTree will be the comment
|
|
8574
|
+
// placeholder.
|
|
8575
|
+
hostParentNode(hydratedEl || instance.subTree.el),
|
|
8576
|
+
// anchor will not be used if this is hydration, so only need to
|
|
8577
|
+
// consider the comment placeholder case.
|
|
8578
|
+
hydratedEl ? null : getNextHostNode(instance.subTree),
|
|
8579
|
+
parentSuspense,
|
|
8580
|
+
namespace,
|
|
8581
|
+
optimized
|
|
8582
|
+
);
|
|
8583
|
+
if (placeholder) {
|
|
8584
|
+
vnode.placeholder = null;
|
|
8585
|
+
hostRemove(placeholder);
|
|
8586
|
+
}
|
|
8587
|
+
updateHOCHostEl(instance, vnode.el);
|
|
8588
|
+
{
|
|
8589
|
+
popWarningContext();
|
|
8590
|
+
}
|
|
8591
|
+
});
|
|
8592
|
+
}
|
|
8537
8593
|
if (!initialVNode.el) {
|
|
8538
8594
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
8539
8595
|
processCommentNode(null, placeholder, container, anchor);
|
|
@@ -9114,7 +9170,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9114
9170
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
9115
9171
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
9116
9172
|
if (shapeFlag & 6) {
|
|
9117
|
-
if (type
|
|
9173
|
+
if (isVaporComponent(type)) {
|
|
9118
9174
|
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
|
|
9119
9175
|
} else {
|
|
9120
9176
|
move(
|
|
@@ -9224,7 +9280,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9224
9280
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
9225
9281
|
}
|
|
9226
9282
|
if (shapeFlag & 256) {
|
|
9227
|
-
if (vnode.type
|
|
9283
|
+
if (isVaporComponent(vnode.type)) {
|
|
9228
9284
|
getVaporInterface(parentComponent, vnode).deactivate(
|
|
9229
9285
|
vnode,
|
|
9230
9286
|
parentComponent.ctx.getStorageContainer()
|
|
@@ -9241,7 +9297,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9241
9297
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
9242
9298
|
}
|
|
9243
9299
|
if (shapeFlag & 6) {
|
|
9244
|
-
if (type
|
|
9300
|
+
if (isVaporComponent(type)) {
|
|
9245
9301
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
9246
9302
|
return;
|
|
9247
9303
|
} else {
|
|
@@ -9373,7 +9429,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9373
9429
|
};
|
|
9374
9430
|
const getNextHostNode = (vnode) => {
|
|
9375
9431
|
if (vnode.shapeFlag & 6) {
|
|
9376
|
-
if (vnode.type
|
|
9432
|
+
if (isVaporComponent(vnode.type)) {
|
|
9377
9433
|
return hostNextSibling(vnode.anchor);
|
|
9378
9434
|
}
|
|
9379
9435
|
return getNextHostNode(vnode.component.subTree);
|
|
@@ -9563,6 +9619,12 @@ app.use(vaporInteropPlugin)
|
|
|
9563
9619
|
}
|
|
9564
9620
|
return res;
|
|
9565
9621
|
}
|
|
9622
|
+
function isVaporComponent(type) {
|
|
9623
|
+
if (isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
|
|
9624
|
+
return hmrDirtyComponentsMode.get(type);
|
|
9625
|
+
}
|
|
9626
|
+
return type.__vapor;
|
|
9627
|
+
}
|
|
9566
9628
|
function getInheritedScopeIds(vnode, parentComponent) {
|
|
9567
9629
|
const inheritedScopeIds = [];
|
|
9568
9630
|
let currentParent = parentComponent;
|
|
@@ -9862,7 +9924,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9862
9924
|
m: move,
|
|
9863
9925
|
um: unmount,
|
|
9864
9926
|
n: next,
|
|
9865
|
-
o: { parentNode
|
|
9927
|
+
o: { parentNode }
|
|
9866
9928
|
} = rendererInternals;
|
|
9867
9929
|
let parentSuspenseId;
|
|
9868
9930
|
const isSuspensible = isVNodeSuspensible(vnode);
|
|
@@ -10037,12 +10099,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
10037
10099
|
next() {
|
|
10038
10100
|
return suspense.activeBranch && next(suspense.activeBranch);
|
|
10039
10101
|
},
|
|
10040
|
-
registerDep(instance,
|
|
10102
|
+
registerDep(instance, onResolve) {
|
|
10041
10103
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
10042
10104
|
if (isInPendingSuspense) {
|
|
10043
10105
|
suspense.deps++;
|
|
10044
10106
|
}
|
|
10045
|
-
const hydratedEl = instance.vnode.el;
|
|
10046
10107
|
instance.asyncDep.catch((err) => {
|
|
10047
10108
|
handleError(err, instance, 0);
|
|
10048
10109
|
}).then((asyncSetupResult) => {
|
|
@@ -10050,37 +10111,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
10050
10111
|
return;
|
|
10051
10112
|
}
|
|
10052
10113
|
instance.asyncResolved = true;
|
|
10053
|
-
|
|
10054
|
-
{
|
|
10055
|
-
pushWarningContext(vnode2);
|
|
10056
|
-
}
|
|
10057
|
-
handleSetupResult(instance, asyncSetupResult, false);
|
|
10058
|
-
if (hydratedEl) {
|
|
10059
|
-
vnode2.el = hydratedEl;
|
|
10060
|
-
}
|
|
10061
|
-
const placeholder = !hydratedEl && instance.subTree.el;
|
|
10062
|
-
setupRenderEffect(
|
|
10063
|
-
instance,
|
|
10064
|
-
vnode2,
|
|
10065
|
-
// component may have been moved before resolve.
|
|
10066
|
-
// if this is not a hydration, instance.subTree will be the comment
|
|
10067
|
-
// placeholder.
|
|
10068
|
-
parentNode(hydratedEl || instance.subTree.el),
|
|
10069
|
-
// anchor will not be used if this is hydration, so only need to
|
|
10070
|
-
// consider the comment placeholder case.
|
|
10071
|
-
hydratedEl ? null : next(instance.subTree),
|
|
10072
|
-
suspense,
|
|
10073
|
-
namespace,
|
|
10074
|
-
optimized2
|
|
10075
|
-
);
|
|
10076
|
-
if (placeholder) {
|
|
10077
|
-
vnode2.placeholder = null;
|
|
10078
|
-
remove(placeholder);
|
|
10079
|
-
}
|
|
10080
|
-
updateHOCHostEl(instance, vnode2.el);
|
|
10081
|
-
{
|
|
10082
|
-
popWarningContext();
|
|
10083
|
-
}
|
|
10114
|
+
onResolve(asyncSetupResult);
|
|
10084
10115
|
if (isInPendingSuspense && --suspense.deps === 0) {
|
|
10085
10116
|
suspense.resolve();
|
|
10086
10117
|
}
|
|
@@ -11262,7 +11293,7 @@ function isMemoSame(cached, memo) {
|
|
|
11262
11293
|
return true;
|
|
11263
11294
|
}
|
|
11264
11295
|
|
|
11265
|
-
const version = "3.6.0-alpha.
|
|
11296
|
+
const version = "3.6.0-alpha.7";
|
|
11266
11297
|
const warn = warn$1 ;
|
|
11267
11298
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
11268
11299
|
const devtools = devtools$1 ;
|