@vue/compat 3.2.34-beta.1 → 3.2.36
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/vue.cjs.js +90 -42
- package/dist/vue.cjs.prod.js +85 -39
- package/dist/vue.esm-browser.js +70 -43
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +86 -39
- package/dist/vue.global.js +70 -43
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +57 -37
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +73 -33
- package/dist/vue.runtime.global.js +57 -37
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.cjs.js
CHANGED
|
@@ -2301,6 +2301,7 @@ function emit(event, ...args) {
|
|
|
2301
2301
|
}
|
|
2302
2302
|
}
|
|
2303
2303
|
function setDevtoolsHook(hook, target) {
|
|
2304
|
+
var _a, _b;
|
|
2304
2305
|
devtools = hook;
|
|
2305
2306
|
if (devtools) {
|
|
2306
2307
|
devtools.enabled = true;
|
|
@@ -2315,7 +2316,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
2315
2316
|
// some envs mock window but not fully
|
|
2316
2317
|
window.HTMLElement &&
|
|
2317
2318
|
// also exclude jsdom
|
|
2318
|
-
!window.navigator
|
|
2319
|
+
!((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
|
|
2319
2320
|
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
|
|
2320
2321
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
|
|
2321
2322
|
replay.push((newHook) => {
|
|
@@ -4677,7 +4678,10 @@ const KeepAliveImpl = {
|
|
|
4677
4678
|
// if the internal renderer is not registered, it indicates that this is server-side rendering,
|
|
4678
4679
|
// for KeepAlive, we just need to render its children
|
|
4679
4680
|
if (!sharedContext.renderer) {
|
|
4680
|
-
return
|
|
4681
|
+
return () => {
|
|
4682
|
+
const children = slots.default && slots.default();
|
|
4683
|
+
return children && children.length === 1 ? children[0] : children;
|
|
4684
|
+
};
|
|
4681
4685
|
}
|
|
4682
4686
|
const cache = new Map();
|
|
4683
4687
|
const keys = new Set();
|
|
@@ -7277,7 +7281,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
7277
7281
|
return vm;
|
|
7278
7282
|
}
|
|
7279
7283
|
}
|
|
7280
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
7284
|
+
Vue.version = `2.6.14-compat:${"3.2.36"}`;
|
|
7281
7285
|
Vue.config = singletonApp.config;
|
|
7282
7286
|
Vue.use = (p, ...options) => {
|
|
7283
7287
|
if (p && isFunction(p.install)) {
|
|
@@ -7443,9 +7447,11 @@ function installLegacyAPIs(app) {
|
|
|
7443
7447
|
});
|
|
7444
7448
|
}
|
|
7445
7449
|
function applySingletonAppMutations(app) {
|
|
7446
|
-
|
|
7450
|
+
// copy over asset registries and deopt flag
|
|
7451
|
+
app._context.mixins = [...singletonApp._context.mixins];
|
|
7452
|
+
['components', 'directives', 'filters'].forEach(key => {
|
|
7447
7453
|
// @ts-ignore
|
|
7448
|
-
app._context[key] = singletonApp._context[key];
|
|
7454
|
+
app._context[key] = Object.create(singletonApp._context[key]);
|
|
7449
7455
|
});
|
|
7450
7456
|
// copy over global config mutations
|
|
7451
7457
|
isCopyingConfig = true;
|
|
@@ -7458,7 +7464,7 @@ function applySingletonAppMutations(app) {
|
|
|
7458
7464
|
}
|
|
7459
7465
|
const val = singletonApp.config[key];
|
|
7460
7466
|
// @ts-ignore
|
|
7461
|
-
app.config[key] = val;
|
|
7467
|
+
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
7462
7468
|
// compat for runtime ignoredElements -> isCustomElement
|
|
7463
7469
|
if (key === 'ignoredElements' &&
|
|
7464
7470
|
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
@@ -7963,7 +7969,7 @@ const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
|
7963
7969
|
// Hydration also depends on some renderer internal logic which needs to be
|
|
7964
7970
|
// passed in via arguments.
|
|
7965
7971
|
function createHydrationFunctions(rendererInternals) {
|
|
7966
|
-
const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
7972
|
+
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
7967
7973
|
const hydrate = (vnode, container) => {
|
|
7968
7974
|
if (!container.hasChildNodes()) {
|
|
7969
7975
|
warn$1(`Attempting to hydrate existing markup but container is empty. ` +
|
|
@@ -7994,7 +8000,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7994
8000
|
switch (type) {
|
|
7995
8001
|
case Text:
|
|
7996
8002
|
if (domType !== 3 /* TEXT */) {
|
|
7997
|
-
|
|
8003
|
+
// #5728 empty text node inside a slot can cause hydration failure
|
|
8004
|
+
// because the server rendered HTML won't contain a text node
|
|
8005
|
+
if (vnode.children === '') {
|
|
8006
|
+
insert((vnode.el = createText('')), parentNode(node), node);
|
|
8007
|
+
nextNode = node;
|
|
8008
|
+
}
|
|
8009
|
+
else {
|
|
8010
|
+
nextNode = onMismatch();
|
|
8011
|
+
}
|
|
7998
8012
|
}
|
|
7999
8013
|
else {
|
|
8000
8014
|
if (node.data !== vnode.children) {
|
|
@@ -8068,6 +8082,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
8068
8082
|
nextNode = isFragmentStart
|
|
8069
8083
|
? locateClosingAsyncAnchor(node)
|
|
8070
8084
|
: nextSibling(node);
|
|
8085
|
+
// #4293 teleport as component root
|
|
8086
|
+
if (nextNode &&
|
|
8087
|
+
isComment(nextNode) &&
|
|
8088
|
+
nextNode.data === 'teleport end') {
|
|
8089
|
+
nextNode = nextSibling(nextNode);
|
|
8090
|
+
}
|
|
8071
8091
|
// #3787
|
|
8072
8092
|
// if component is async, it may get moved / unmounted before its
|
|
8073
8093
|
// inner component is loaded, so we need to give it a placeholder
|
|
@@ -8731,8 +8751,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8731
8751
|
const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));
|
|
8732
8752
|
const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
|
|
8733
8753
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
8734
|
-
if (
|
|
8735
|
-
|
|
8754
|
+
if (// #5523 dev root fragment may inherit directives
|
|
8755
|
+
(isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
|
|
8756
|
+
// HMR updated / Dev root fragment (w/ comments), force full diff
|
|
8736
8757
|
patchFlag = 0;
|
|
8737
8758
|
optimized = false;
|
|
8738
8759
|
dynamicChildren = null;
|
|
@@ -8754,8 +8775,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8754
8775
|
else {
|
|
8755
8776
|
if (patchFlag > 0 &&
|
|
8756
8777
|
patchFlag & 64 /* STABLE_FRAGMENT */ &&
|
|
8757
|
-
// #5523 dev root fragment may inherit directives so always force update
|
|
8758
|
-
!(patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) &&
|
|
8759
8778
|
dynamicChildren &&
|
|
8760
8779
|
// #2715 the previous fragment could've been a BAILed one as a result
|
|
8761
8780
|
// of renderSlot() with no valid children
|
|
@@ -9866,10 +9885,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
9866
9885
|
}
|
|
9867
9886
|
else {
|
|
9868
9887
|
vnode.anchor = nextSibling(node);
|
|
9869
|
-
|
|
9888
|
+
// lookahead until we find the target anchor
|
|
9889
|
+
// we cannot rely on return value of hydrateChildren() because there
|
|
9890
|
+
// could be nested teleports
|
|
9891
|
+
let targetAnchor = targetNode;
|
|
9892
|
+
while (targetAnchor) {
|
|
9893
|
+
targetAnchor = nextSibling(targetAnchor);
|
|
9894
|
+
if (targetAnchor &&
|
|
9895
|
+
targetAnchor.nodeType === 8 &&
|
|
9896
|
+
targetAnchor.data === 'teleport anchor') {
|
|
9897
|
+
vnode.targetAnchor = targetAnchor;
|
|
9898
|
+
target._lpa =
|
|
9899
|
+
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
9900
|
+
break;
|
|
9901
|
+
}
|
|
9902
|
+
}
|
|
9903
|
+
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
9870
9904
|
}
|
|
9871
|
-
target._lpa =
|
|
9872
|
-
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
9873
9905
|
}
|
|
9874
9906
|
}
|
|
9875
9907
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
@@ -10544,6 +10576,7 @@ function setupComponent(instance, isSSR = false) {
|
|
|
10544
10576
|
return setupResult;
|
|
10545
10577
|
}
|
|
10546
10578
|
function setupStatefulComponent(instance, isSSR) {
|
|
10579
|
+
var _a;
|
|
10547
10580
|
const Component = instance.type;
|
|
10548
10581
|
{
|
|
10549
10582
|
if (Component.name) {
|
|
@@ -10602,7 +10635,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10602
10635
|
// bail here and wait for re-entry.
|
|
10603
10636
|
instance.asyncDep = setupResult;
|
|
10604
10637
|
if (!instance.suspense) {
|
|
10605
|
-
const name = Component.name
|
|
10638
|
+
const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
|
|
10606
10639
|
warn$1(`Component <${name}>: setup function returned a promise, but no ` +
|
|
10607
10640
|
`<Suspense> boundary was found in the parent component tree. ` +
|
|
10608
10641
|
`A component with async setup() must be nested in a <Suspense> ` +
|
|
@@ -11243,7 +11276,7 @@ function isMemoSame(cached, memo) {
|
|
|
11243
11276
|
}
|
|
11244
11277
|
|
|
11245
11278
|
// Core API ------------------------------------------------------------------
|
|
11246
|
-
const version = "3.2.
|
|
11279
|
+
const version = "3.2.36";
|
|
11247
11280
|
const _ssrUtils = {
|
|
11248
11281
|
createComponentInstance,
|
|
11249
11282
|
setupComponent,
|
|
@@ -11607,7 +11640,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
|
|
|
11607
11640
|
// if the low-res timestamp which is bigger than the event timestamp
|
|
11608
11641
|
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
|
|
11609
11642
|
// and we need to use the hi-res version for event listeners as well.
|
|
11610
|
-
_getNow =
|
|
11643
|
+
_getNow = performance.now.bind(performance);
|
|
11611
11644
|
}
|
|
11612
11645
|
// #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
|
|
11613
11646
|
// and does not fire microtasks in between event propagation, so safe to exclude.
|
|
@@ -12107,9 +12140,8 @@ function resolveTransitionProps(rawProps) {
|
|
|
12107
12140
|
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
12108
12141
|
done && done();
|
|
12109
12142
|
};
|
|
12110
|
-
let isLeaving = false;
|
|
12111
12143
|
const finishLeave = (el, done) => {
|
|
12112
|
-
|
|
12144
|
+
el._isLeaving = false;
|
|
12113
12145
|
removeTransitionClass(el, leaveFromClass);
|
|
12114
12146
|
removeTransitionClass(el, leaveToClass);
|
|
12115
12147
|
removeTransitionClass(el, leaveActiveClass);
|
|
@@ -12152,7 +12184,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12152
12184
|
onEnter: makeEnterHook(false),
|
|
12153
12185
|
onAppear: makeEnterHook(true),
|
|
12154
12186
|
onLeave(el, done) {
|
|
12155
|
-
|
|
12187
|
+
el._isLeaving = true;
|
|
12156
12188
|
const resolve = () => finishLeave(el, done);
|
|
12157
12189
|
addTransitionClass(el, leaveFromClass);
|
|
12158
12190
|
if (legacyClassEnabled) {
|
|
@@ -12162,7 +12194,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
12162
12194
|
forceReflow();
|
|
12163
12195
|
addTransitionClass(el, leaveActiveClass);
|
|
12164
12196
|
nextFrame(() => {
|
|
12165
|
-
if (!
|
|
12197
|
+
if (!el._isLeaving) {
|
|
12166
12198
|
// cancelled
|
|
12167
12199
|
return;
|
|
12168
12200
|
}
|
|
@@ -12693,27 +12725,25 @@ const vModelDynamic = {
|
|
|
12693
12725
|
callModelHook(el, binding, vnode, prevVNode, 'updated');
|
|
12694
12726
|
}
|
|
12695
12727
|
};
|
|
12696
|
-
function
|
|
12697
|
-
|
|
12698
|
-
switch (el.tagName) {
|
|
12728
|
+
function resolveDynamicModel(tagName, type) {
|
|
12729
|
+
switch (tagName) {
|
|
12699
12730
|
case 'SELECT':
|
|
12700
|
-
|
|
12701
|
-
break;
|
|
12731
|
+
return vModelSelect;
|
|
12702
12732
|
case 'TEXTAREA':
|
|
12703
|
-
|
|
12704
|
-
break;
|
|
12733
|
+
return vModelText;
|
|
12705
12734
|
default:
|
|
12706
|
-
switch (
|
|
12735
|
+
switch (type) {
|
|
12707
12736
|
case 'checkbox':
|
|
12708
|
-
|
|
12709
|
-
break;
|
|
12737
|
+
return vModelCheckbox;
|
|
12710
12738
|
case 'radio':
|
|
12711
|
-
|
|
12712
|
-
break;
|
|
12739
|
+
return vModelRadio;
|
|
12713
12740
|
default:
|
|
12714
|
-
|
|
12741
|
+
return vModelText;
|
|
12715
12742
|
}
|
|
12716
12743
|
}
|
|
12744
|
+
}
|
|
12745
|
+
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
12746
|
+
const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
|
|
12717
12747
|
const fn = modelToUse[hook];
|
|
12718
12748
|
fn && fn(el, binding, vnode, prevVNode);
|
|
12719
12749
|
}
|
|
@@ -12741,6 +12771,17 @@ function initVModelForSSR() {
|
|
|
12741
12771
|
return { checked: true };
|
|
12742
12772
|
}
|
|
12743
12773
|
};
|
|
12774
|
+
vModelDynamic.getSSRProps = (binding, vnode) => {
|
|
12775
|
+
if (typeof vnode.type !== 'string') {
|
|
12776
|
+
return;
|
|
12777
|
+
}
|
|
12778
|
+
const modelToUse = resolveDynamicModel(
|
|
12779
|
+
// resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
|
|
12780
|
+
vnode.type.toUpperCase(), vnode.props && vnode.props.type);
|
|
12781
|
+
if (modelToUse.getSSRProps) {
|
|
12782
|
+
return modelToUse.getSSRProps(binding, vnode);
|
|
12783
|
+
}
|
|
12784
|
+
};
|
|
12744
12785
|
}
|
|
12745
12786
|
|
|
12746
12787
|
const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];
|
|
@@ -14863,6 +14904,14 @@ function getConstantType(node, context) {
|
|
|
14863
14904
|
// static then they don't need to be blocks since there will be no
|
|
14864
14905
|
// nested updates.
|
|
14865
14906
|
if (codegenNode.isBlock) {
|
|
14907
|
+
// except set custom directives.
|
|
14908
|
+
for (let i = 0; i < node.props.length; i++) {
|
|
14909
|
+
const p = node.props[i];
|
|
14910
|
+
if (p.type === 7 /* DIRECTIVE */) {
|
|
14911
|
+
constantCache.set(node, 0 /* NOT_CONSTANT */);
|
|
14912
|
+
return 0 /* NOT_CONSTANT */;
|
|
14913
|
+
}
|
|
14914
|
+
}
|
|
14866
14915
|
context.removeHelper(OPEN_BLOCK);
|
|
14867
14916
|
context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
|
|
14868
14917
|
codegenNode.isBlock = false;
|
|
@@ -16323,7 +16372,7 @@ function isReferenced(node, parent, grandparent) {
|
|
|
16323
16372
|
// no: export { NODE as foo } from "foo";
|
|
16324
16373
|
case 'ExportSpecifier':
|
|
16325
16374
|
// @ts-expect-error
|
|
16326
|
-
if (grandparent
|
|
16375
|
+
if (grandparent === null || grandparent === void 0 ? void 0 : grandparent.source) {
|
|
16327
16376
|
return false;
|
|
16328
16377
|
}
|
|
16329
16378
|
return parent.local === node;
|
|
@@ -17409,7 +17458,7 @@ const transformElement = (node, context) => {
|
|
|
17409
17458
|
(tag === 'svg' || tag === 'foreignObject'));
|
|
17410
17459
|
// props
|
|
17411
17460
|
if (props.length > 0) {
|
|
17412
|
-
const propsBuildResult = buildProps(node, context);
|
|
17461
|
+
const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
|
|
17413
17462
|
vnodeProps = propsBuildResult.props;
|
|
17414
17463
|
patchFlag = propsBuildResult.patchFlag;
|
|
17415
17464
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
@@ -17610,9 +17659,8 @@ function resolveSetupReference(name, context) {
|
|
|
17610
17659
|
: `$setup[${JSON.stringify(fromMaybeRef)}]`;
|
|
17611
17660
|
}
|
|
17612
17661
|
}
|
|
17613
|
-
function buildProps(node, context, props = node.props, ssr = false) {
|
|
17662
|
+
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
|
|
17614
17663
|
const { tag, loc: elementLoc, children } = node;
|
|
17615
|
-
const isComponent = node.tagType === 1 /* COMPONENT */;
|
|
17616
17664
|
let properties = [];
|
|
17617
17665
|
const mergeArgs = [];
|
|
17618
17666
|
const runtimeDirectives = [];
|
|
@@ -17631,8 +17679,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
17631
17679
|
if (isStaticExp(key)) {
|
|
17632
17680
|
const name = key.content;
|
|
17633
17681
|
const isEventHandler = isOn(name);
|
|
17634
|
-
if (
|
|
17635
|
-
|
|
17682
|
+
if (isEventHandler &&
|
|
17683
|
+
(!isComponent || isDynamicComponent) &&
|
|
17636
17684
|
// omit the flag for click handlers because hydration gives click
|
|
17637
17685
|
// dedicated fast path.
|
|
17638
17686
|
name.toLowerCase() !== 'onclick' &&
|
|
@@ -18085,7 +18133,7 @@ function processSlotOutlet(node, context) {
|
|
|
18085
18133
|
}
|
|
18086
18134
|
}
|
|
18087
18135
|
if (nonNameProps.length > 0) {
|
|
18088
|
-
const { props, directives } = buildProps(node, context, nonNameProps);
|
|
18136
|
+
const { props, directives } = buildProps(node, context, nonNameProps, false, false);
|
|
18089
18137
|
slotProps = props;
|
|
18090
18138
|
if (directives.length) {
|
|
18091
18139
|
context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
|
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -1909,6 +1909,7 @@ function flushJobs(seen) {
|
|
|
1909
1909
|
let devtools;
|
|
1910
1910
|
let buffer = [];
|
|
1911
1911
|
function setDevtoolsHook(hook, target) {
|
|
1912
|
+
var _a, _b;
|
|
1912
1913
|
devtools = hook;
|
|
1913
1914
|
if (devtools) {
|
|
1914
1915
|
devtools.enabled = true;
|
|
@@ -1923,7 +1924,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
1923
1924
|
// some envs mock window but not fully
|
|
1924
1925
|
window.HTMLElement &&
|
|
1925
1926
|
// also exclude jsdom
|
|
1926
|
-
!window.navigator
|
|
1927
|
+
!((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
|
|
1927
1928
|
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
|
|
1928
1929
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
|
|
1929
1930
|
replay.push((newHook) => {
|
|
@@ -3688,7 +3689,10 @@ const KeepAliveImpl = {
|
|
|
3688
3689
|
// if the internal renderer is not registered, it indicates that this is server-side rendering,
|
|
3689
3690
|
// for KeepAlive, we just need to render its children
|
|
3690
3691
|
if (!sharedContext.renderer) {
|
|
3691
|
-
return
|
|
3692
|
+
return () => {
|
|
3693
|
+
const children = slots.default && slots.default();
|
|
3694
|
+
return children && children.length === 1 ? children[0] : children;
|
|
3695
|
+
};
|
|
3692
3696
|
}
|
|
3693
3697
|
const cache = new Map();
|
|
3694
3698
|
const keys = new Set();
|
|
@@ -5848,7 +5852,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
5848
5852
|
return vm;
|
|
5849
5853
|
}
|
|
5850
5854
|
}
|
|
5851
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
5855
|
+
Vue.version = `2.6.14-compat:${"3.2.36"}`;
|
|
5852
5856
|
Vue.config = singletonApp.config;
|
|
5853
5857
|
Vue.use = (p, ...options) => {
|
|
5854
5858
|
if (p && isFunction(p.install)) {
|
|
@@ -6009,9 +6013,11 @@ function installLegacyAPIs(app) {
|
|
|
6009
6013
|
});
|
|
6010
6014
|
}
|
|
6011
6015
|
function applySingletonAppMutations(app) {
|
|
6012
|
-
|
|
6016
|
+
// copy over asset registries and deopt flag
|
|
6017
|
+
app._context.mixins = [...singletonApp._context.mixins];
|
|
6018
|
+
['components', 'directives', 'filters'].forEach(key => {
|
|
6013
6019
|
// @ts-ignore
|
|
6014
|
-
app._context[key] = singletonApp._context[key];
|
|
6020
|
+
app._context[key] = Object.create(singletonApp._context[key]);
|
|
6015
6021
|
});
|
|
6016
6022
|
for (const key in singletonApp.config) {
|
|
6017
6023
|
if (key === 'isNativeTag')
|
|
@@ -6022,7 +6028,7 @@ function applySingletonAppMutations(app) {
|
|
|
6022
6028
|
}
|
|
6023
6029
|
const val = singletonApp.config[key];
|
|
6024
6030
|
// @ts-ignore
|
|
6025
|
-
app.config[key] = val;
|
|
6031
|
+
app.config[key] = isObject(val) ? Object.create(val) : val;
|
|
6026
6032
|
// compat for runtime ignoredElements -> isCustomElement
|
|
6027
6033
|
if (key === 'ignoredElements' &&
|
|
6028
6034
|
isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
|
|
@@ -6426,7 +6432,7 @@ const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
|
6426
6432
|
// Hydration also depends on some renderer internal logic which needs to be
|
|
6427
6433
|
// passed in via arguments.
|
|
6428
6434
|
function createHydrationFunctions(rendererInternals) {
|
|
6429
|
-
const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
6435
|
+
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
6430
6436
|
const hydrate = (vnode, container) => {
|
|
6431
6437
|
if (!container.hasChildNodes()) {
|
|
6432
6438
|
patch(null, vnode, container);
|
|
@@ -6455,7 +6461,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6455
6461
|
switch (type) {
|
|
6456
6462
|
case Text:
|
|
6457
6463
|
if (domType !== 3 /* TEXT */) {
|
|
6458
|
-
|
|
6464
|
+
// #5728 empty text node inside a slot can cause hydration failure
|
|
6465
|
+
// because the server rendered HTML won't contain a text node
|
|
6466
|
+
if (vnode.children === '') {
|
|
6467
|
+
insert((vnode.el = createText('')), parentNode(node), node);
|
|
6468
|
+
nextNode = node;
|
|
6469
|
+
}
|
|
6470
|
+
else {
|
|
6471
|
+
nextNode = onMismatch();
|
|
6472
|
+
}
|
|
6459
6473
|
}
|
|
6460
6474
|
else {
|
|
6461
6475
|
if (node.data !== vnode.children) {
|
|
@@ -6526,6 +6540,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6526
6540
|
nextNode = isFragmentStart
|
|
6527
6541
|
? locateClosingAsyncAnchor(node)
|
|
6528
6542
|
: nextSibling(node);
|
|
6543
|
+
// #4293 teleport as component root
|
|
6544
|
+
if (nextNode &&
|
|
6545
|
+
isComment(nextNode) &&
|
|
6546
|
+
nextNode.data === 'teleport end') {
|
|
6547
|
+
nextNode = nextSibling(nextNode);
|
|
6548
|
+
}
|
|
6529
6549
|
// #3787
|
|
6530
6550
|
// if component is async, it may get moved / unmounted before its
|
|
6531
6551
|
// inner component is loaded, so we need to give it a placeholder
|
|
@@ -7107,8 +7127,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7107
7127
|
else {
|
|
7108
7128
|
if (patchFlag > 0 &&
|
|
7109
7129
|
patchFlag & 64 /* STABLE_FRAGMENT */ &&
|
|
7110
|
-
// #5523 dev root fragment may inherit directives so always force update
|
|
7111
|
-
!(false /* DEV_ROOT_FRAGMENT */) &&
|
|
7112
7130
|
dynamicChildren &&
|
|
7113
7131
|
// #2715 the previous fragment could've been a BAILed one as a result
|
|
7114
7132
|
// of renderSlot() with no valid children
|
|
@@ -8081,10 +8099,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
8081
8099
|
}
|
|
8082
8100
|
else {
|
|
8083
8101
|
vnode.anchor = nextSibling(node);
|
|
8084
|
-
|
|
8102
|
+
// lookahead until we find the target anchor
|
|
8103
|
+
// we cannot rely on return value of hydrateChildren() because there
|
|
8104
|
+
// could be nested teleports
|
|
8105
|
+
let targetAnchor = targetNode;
|
|
8106
|
+
while (targetAnchor) {
|
|
8107
|
+
targetAnchor = nextSibling(targetAnchor);
|
|
8108
|
+
if (targetAnchor &&
|
|
8109
|
+
targetAnchor.nodeType === 8 &&
|
|
8110
|
+
targetAnchor.data === 'teleport anchor') {
|
|
8111
|
+
vnode.targetAnchor = targetAnchor;
|
|
8112
|
+
target._lpa =
|
|
8113
|
+
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
8114
|
+
break;
|
|
8115
|
+
}
|
|
8116
|
+
}
|
|
8117
|
+
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
8085
8118
|
}
|
|
8086
|
-
target._lpa =
|
|
8087
|
-
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
8088
8119
|
}
|
|
8089
8120
|
}
|
|
8090
8121
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
@@ -9118,7 +9149,7 @@ function isMemoSame(cached, memo) {
|
|
|
9118
9149
|
}
|
|
9119
9150
|
|
|
9120
9151
|
// Core API ------------------------------------------------------------------
|
|
9121
|
-
const version = "3.2.
|
|
9152
|
+
const version = "3.2.36";
|
|
9122
9153
|
const _ssrUtils = {
|
|
9123
9154
|
createComponentInstance,
|
|
9124
9155
|
setupComponent,
|
|
@@ -9477,7 +9508,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
|
|
|
9477
9508
|
// if the low-res timestamp which is bigger than the event timestamp
|
|
9478
9509
|
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
|
|
9479
9510
|
// and we need to use the hi-res version for event listeners as well.
|
|
9480
|
-
_getNow =
|
|
9511
|
+
_getNow = performance.now.bind(performance);
|
|
9481
9512
|
}
|
|
9482
9513
|
// #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
|
|
9483
9514
|
// and does not fire microtasks in between event propagation, so safe to exclude.
|
|
@@ -9948,9 +9979,8 @@ function resolveTransitionProps(rawProps) {
|
|
|
9948
9979
|
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
9949
9980
|
done && done();
|
|
9950
9981
|
};
|
|
9951
|
-
let isLeaving = false;
|
|
9952
9982
|
const finishLeave = (el, done) => {
|
|
9953
|
-
|
|
9983
|
+
el._isLeaving = false;
|
|
9954
9984
|
removeTransitionClass(el, leaveFromClass);
|
|
9955
9985
|
removeTransitionClass(el, leaveToClass);
|
|
9956
9986
|
removeTransitionClass(el, leaveActiveClass);
|
|
@@ -9993,7 +10023,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
9993
10023
|
onEnter: makeEnterHook(false),
|
|
9994
10024
|
onAppear: makeEnterHook(true),
|
|
9995
10025
|
onLeave(el, done) {
|
|
9996
|
-
|
|
10026
|
+
el._isLeaving = true;
|
|
9997
10027
|
const resolve = () => finishLeave(el, done);
|
|
9998
10028
|
addTransitionClass(el, leaveFromClass);
|
|
9999
10029
|
if (legacyClassEnabled) {
|
|
@@ -10003,7 +10033,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
10003
10033
|
forceReflow();
|
|
10004
10034
|
addTransitionClass(el, leaveActiveClass);
|
|
10005
10035
|
nextFrame(() => {
|
|
10006
|
-
if (!
|
|
10036
|
+
if (!el._isLeaving) {
|
|
10007
10037
|
// cancelled
|
|
10008
10038
|
return;
|
|
10009
10039
|
}
|
|
@@ -10518,27 +10548,25 @@ const vModelDynamic = {
|
|
|
10518
10548
|
callModelHook(el, binding, vnode, prevVNode, 'updated');
|
|
10519
10549
|
}
|
|
10520
10550
|
};
|
|
10521
|
-
function
|
|
10522
|
-
|
|
10523
|
-
switch (el.tagName) {
|
|
10551
|
+
function resolveDynamicModel(tagName, type) {
|
|
10552
|
+
switch (tagName) {
|
|
10524
10553
|
case 'SELECT':
|
|
10525
|
-
|
|
10526
|
-
break;
|
|
10554
|
+
return vModelSelect;
|
|
10527
10555
|
case 'TEXTAREA':
|
|
10528
|
-
|
|
10529
|
-
break;
|
|
10556
|
+
return vModelText;
|
|
10530
10557
|
default:
|
|
10531
|
-
switch (
|
|
10558
|
+
switch (type) {
|
|
10532
10559
|
case 'checkbox':
|
|
10533
|
-
|
|
10534
|
-
break;
|
|
10560
|
+
return vModelCheckbox;
|
|
10535
10561
|
case 'radio':
|
|
10536
|
-
|
|
10537
|
-
break;
|
|
10562
|
+
return vModelRadio;
|
|
10538
10563
|
default:
|
|
10539
|
-
|
|
10564
|
+
return vModelText;
|
|
10540
10565
|
}
|
|
10541
10566
|
}
|
|
10567
|
+
}
|
|
10568
|
+
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
10569
|
+
const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
|
|
10542
10570
|
const fn = modelToUse[hook];
|
|
10543
10571
|
fn && fn(el, binding, vnode, prevVNode);
|
|
10544
10572
|
}
|
|
@@ -10566,6 +10594,17 @@ function initVModelForSSR() {
|
|
|
10566
10594
|
return { checked: true };
|
|
10567
10595
|
}
|
|
10568
10596
|
};
|
|
10597
|
+
vModelDynamic.getSSRProps = (binding, vnode) => {
|
|
10598
|
+
if (typeof vnode.type !== 'string') {
|
|
10599
|
+
return;
|
|
10600
|
+
}
|
|
10601
|
+
const modelToUse = resolveDynamicModel(
|
|
10602
|
+
// resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
|
|
10603
|
+
vnode.type.toUpperCase(), vnode.props && vnode.props.type);
|
|
10604
|
+
if (modelToUse.getSSRProps) {
|
|
10605
|
+
return modelToUse.getSSRProps(binding, vnode);
|
|
10606
|
+
}
|
|
10607
|
+
};
|
|
10569
10608
|
}
|
|
10570
10609
|
|
|
10571
10610
|
const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];
|
|
@@ -12520,6 +12559,14 @@ function getConstantType(node, context) {
|
|
|
12520
12559
|
// static then they don't need to be blocks since there will be no
|
|
12521
12560
|
// nested updates.
|
|
12522
12561
|
if (codegenNode.isBlock) {
|
|
12562
|
+
// except set custom directives.
|
|
12563
|
+
for (let i = 0; i < node.props.length; i++) {
|
|
12564
|
+
const p = node.props[i];
|
|
12565
|
+
if (p.type === 7 /* DIRECTIVE */) {
|
|
12566
|
+
constantCache.set(node, 0 /* NOT_CONSTANT */);
|
|
12567
|
+
return 0 /* NOT_CONSTANT */;
|
|
12568
|
+
}
|
|
12569
|
+
}
|
|
12523
12570
|
context.removeHelper(OPEN_BLOCK);
|
|
12524
12571
|
context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
|
|
12525
12572
|
codegenNode.isBlock = false;
|
|
@@ -13944,7 +13991,7 @@ function isReferenced(node, parent, grandparent) {
|
|
|
13944
13991
|
// no: export { NODE as foo } from "foo";
|
|
13945
13992
|
case 'ExportSpecifier':
|
|
13946
13993
|
// @ts-expect-error
|
|
13947
|
-
if (grandparent
|
|
13994
|
+
if (grandparent === null || grandparent === void 0 ? void 0 : grandparent.source) {
|
|
13948
13995
|
return false;
|
|
13949
13996
|
}
|
|
13950
13997
|
return parent.local === node;
|
|
@@ -15008,7 +15055,7 @@ const transformElement = (node, context) => {
|
|
|
15008
15055
|
(tag === 'svg' || tag === 'foreignObject'));
|
|
15009
15056
|
// props
|
|
15010
15057
|
if (props.length > 0) {
|
|
15011
|
-
const propsBuildResult = buildProps(node, context);
|
|
15058
|
+
const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
|
|
15012
15059
|
vnodeProps = propsBuildResult.props;
|
|
15013
15060
|
patchFlag = propsBuildResult.patchFlag;
|
|
15014
15061
|
dynamicPropNames = propsBuildResult.dynamicPropNames;
|
|
@@ -15190,9 +15237,8 @@ function resolveSetupReference(name, context) {
|
|
|
15190
15237
|
: `$setup[${JSON.stringify(fromMaybeRef)}]`;
|
|
15191
15238
|
}
|
|
15192
15239
|
}
|
|
15193
|
-
function buildProps(node, context, props = node.props, ssr = false) {
|
|
15240
|
+
function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
|
|
15194
15241
|
const { tag, loc: elementLoc, children } = node;
|
|
15195
|
-
const isComponent = node.tagType === 1 /* COMPONENT */;
|
|
15196
15242
|
let properties = [];
|
|
15197
15243
|
const mergeArgs = [];
|
|
15198
15244
|
const runtimeDirectives = [];
|
|
@@ -15211,8 +15257,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
|
|
|
15211
15257
|
if (isStaticExp(key)) {
|
|
15212
15258
|
const name = key.content;
|
|
15213
15259
|
const isEventHandler = isOn(name);
|
|
15214
|
-
if (
|
|
15215
|
-
|
|
15260
|
+
if (isEventHandler &&
|
|
15261
|
+
(!isComponent || isDynamicComponent) &&
|
|
15216
15262
|
// omit the flag for click handlers because hydration gives click
|
|
15217
15263
|
// dedicated fast path.
|
|
15218
15264
|
name.toLowerCase() !== 'onclick' &&
|
|
@@ -15642,7 +15688,7 @@ function processSlotOutlet(node, context) {
|
|
|
15642
15688
|
}
|
|
15643
15689
|
}
|
|
15644
15690
|
if (nonNameProps.length > 0) {
|
|
15645
|
-
const { props, directives } = buildProps(node, context, nonNameProps);
|
|
15691
|
+
const { props, directives } = buildProps(node, context, nonNameProps, false, false);
|
|
15646
15692
|
slotProps = props;
|
|
15647
15693
|
if (directives.length) {
|
|
15648
15694
|
context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
|