vue 2.7.0-alpha.2 → 2.7.0-alpha.5
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.common.dev.js +30 -20
- package/dist/vue.common.prod.js +3 -3
- package/dist/vue.esm.browser.js +30 -21
- package/dist/vue.esm.browser.min.js +3 -3
- package/dist/vue.esm.js +30 -21
- package/dist/vue.js +30 -20
- package/dist/vue.min.js +3 -3
- package/dist/vue.runtime.common.dev.js +30 -20
- package/dist/vue.runtime.common.prod.js +3 -3
- package/dist/vue.runtime.esm.js +30 -21
- package/dist/vue.runtime.js +30 -20
- package/dist/vue.runtime.min.js +3 -3
- package/dist/vue.runtime.mjs +8486 -0
- package/package.json +3 -2
- package/packages/compiler-sfc/package.json +1 -1
- package/{src/sfc → packages/compiler-sfc/src}/parser.ts +0 -0
- package/src/core/instance/inject.ts +4 -1
- package/src/core/instance/render.ts +2 -1
- package/src/core/vdom/helpers/normalize-scoped-slots.ts +23 -18
- package/src/types/component.ts +2 -1
- package/src/types/options.ts +2 -10
- package/src/v3/apiSetup.ts +9 -1
- package/src/v3/index.ts +7 -0
- package/types/common.d.ts +15 -0
- package/types/index.d.ts +32 -1
- package/types/options.d.ts +3 -23
- package/types/v3-component-options.d.ts +120 -0
- package/types/v3-component-props.d.ts +100 -0
- package/types/v3-component-proxy.d.ts +189 -0
- package/types/v3-define-component.d.ts +119 -0
- package/types/v3-generated.d.ts +2 -0
- package/types/{v3.d.ts → v3-manual-apis.d.ts} +1 -7
- package/types/v3-setup-context.d.ts +42 -0
package/dist/vue.common.dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.7.0-alpha.
|
|
2
|
+
* Vue.js v2.7.0-alpha.5
|
|
3
3
|
* (c) 2014-2022 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -1943,6 +1943,9 @@ function initProvide(vm) {
|
|
|
1943
1943
|
var provided = isFunction(provideOption)
|
|
1944
1944
|
? provideOption.call(vm)
|
|
1945
1945
|
: provideOption;
|
|
1946
|
+
if (!isObject(provided)) {
|
|
1947
|
+
return;
|
|
1948
|
+
}
|
|
1946
1949
|
var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
|
|
1947
1950
|
setCurrentInstance(vm);
|
|
1948
1951
|
for (var i = 0; i < keys.length; i++) {
|
|
@@ -2258,34 +2261,33 @@ function isAsyncPlaceholder(node) {
|
|
|
2258
2261
|
return node.isComment && node.asyncFactory;
|
|
2259
2262
|
}
|
|
2260
2263
|
|
|
2261
|
-
function normalizeScopedSlots(ownerVm,
|
|
2264
|
+
function normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {
|
|
2262
2265
|
var res;
|
|
2263
|
-
var prevSlots = ownerVm.$scopedSlots;
|
|
2264
2266
|
var hasNormalSlots = Object.keys(normalSlots).length > 0;
|
|
2265
|
-
var isStable =
|
|
2266
|
-
var key =
|
|
2267
|
-
if (!
|
|
2267
|
+
var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;
|
|
2268
|
+
var key = scopedSlots && scopedSlots.$key;
|
|
2269
|
+
if (!scopedSlots) {
|
|
2268
2270
|
res = {};
|
|
2269
2271
|
}
|
|
2270
|
-
else if (
|
|
2272
|
+
else if (scopedSlots._normalized) {
|
|
2271
2273
|
// fast path 1: child component re-render only, parent did not change
|
|
2272
|
-
return
|
|
2274
|
+
return scopedSlots._normalized;
|
|
2273
2275
|
}
|
|
2274
2276
|
else if (isStable &&
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
key ===
|
|
2277
|
+
prevScopedSlots &&
|
|
2278
|
+
prevScopedSlots !== emptyObject &&
|
|
2279
|
+
key === prevScopedSlots.$key &&
|
|
2278
2280
|
!hasNormalSlots &&
|
|
2279
|
-
!
|
|
2281
|
+
!prevScopedSlots.$hasNormal) {
|
|
2280
2282
|
// fast path 2: stable scoped slots w/ no normal slots to proxy,
|
|
2281
2283
|
// only need to normalize once
|
|
2282
|
-
return
|
|
2284
|
+
return prevScopedSlots;
|
|
2283
2285
|
}
|
|
2284
2286
|
else {
|
|
2285
2287
|
res = {};
|
|
2286
|
-
for (var key_1 in
|
|
2287
|
-
if (
|
|
2288
|
-
res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1,
|
|
2288
|
+
for (var key_1 in scopedSlots) {
|
|
2289
|
+
if (scopedSlots[key_1] && key_1[0] !== '$') {
|
|
2290
|
+
res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);
|
|
2289
2291
|
}
|
|
2290
2292
|
}
|
|
2291
2293
|
}
|
|
@@ -2297,8 +2299,8 @@ function normalizeScopedSlots(ownerVm, slots, normalSlots) {
|
|
|
2297
2299
|
}
|
|
2298
2300
|
// avoriaz seems to mock a non-extensible $scopedSlots object
|
|
2299
2301
|
// and when that is passed down this would cause an error
|
|
2300
|
-
if (
|
|
2301
|
-
|
|
2302
|
+
if (scopedSlots && Object.isExtensible(scopedSlots)) {
|
|
2303
|
+
scopedSlots._normalized = res;
|
|
2302
2304
|
}
|
|
2303
2305
|
def(res, '$stable', isStable);
|
|
2304
2306
|
def(res, '$key', key);
|
|
@@ -3084,7 +3086,7 @@ function renderMixin(Vue) {
|
|
|
3084
3086
|
var vm = this;
|
|
3085
3087
|
var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
|
|
3086
3088
|
if (_parentVnode) {
|
|
3087
|
-
vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots);
|
|
3089
|
+
vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
|
|
3088
3090
|
if (vm._slotsProxy) {
|
|
3089
3091
|
syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
|
|
3090
3092
|
}
|
|
@@ -4552,8 +4554,16 @@ var onServerPrefetch = createLifeCycle('serverPrefetch');
|
|
|
4552
4554
|
var onRenderTracked = createLifeCycle('renderTracked');
|
|
4553
4555
|
var onRenderTriggered = createLifeCycle('renderTriggered');
|
|
4554
4556
|
|
|
4557
|
+
/**
|
|
4558
|
+
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
|
4559
|
+
*/
|
|
4560
|
+
function defineComponent(options) {
|
|
4561
|
+
return options;
|
|
4562
|
+
}
|
|
4563
|
+
|
|
4555
4564
|
var vca = /*#__PURE__*/Object.freeze({
|
|
4556
4565
|
__proto__: null,
|
|
4566
|
+
defineComponent: defineComponent,
|
|
4557
4567
|
ref: ref$1,
|
|
4558
4568
|
shallowRef: shallowRef,
|
|
4559
4569
|
isRef: isRef,
|
|
@@ -5787,7 +5797,7 @@ Object.defineProperty(Vue.prototype, '$ssrContext', {
|
|
|
5787
5797
|
Object.defineProperty(Vue, 'FunctionalRenderContext', {
|
|
5788
5798
|
value: FunctionalRenderContext
|
|
5789
5799
|
});
|
|
5790
|
-
Vue.version = '2.7.0-alpha.
|
|
5800
|
+
Vue.version = '2.7.0-alpha.5';
|
|
5791
5801
|
|
|
5792
5802
|
// these are reserved for web because they are directly compiled away
|
|
5793
5803
|
// during template compilation
|