Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vue
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.7.1
Choose a base ref
...
head repository: vuejs/vue
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.7.2
Choose a head ref
  • 4 commits
  • 20 files changed
  • 2 contributors

Commits on Jul 4, 2022

  1. Copy the full SHA
    d45bbea View commit details

Commits on Jul 5, 2022

  1. Copy the full SHA
    fb93c1b View commit details
  2. Copy the full SHA
    1294385 View commit details
  3. release: v2.7.2

    yyx990803 committed Jul 5, 2022
    Copy the full SHA
    e244687 View commit details
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [2.7.2](https://github.com/vuejs/vue/compare/v2.7.1...v2.7.2) (2022-07-05)


### Bug Fixes

* **compiler-sfc:** preserve old deindent behavior for pug ([1294385](https://github.com/vuejs/vue/commit/1294385300742acbea5f05c166685bd4a1fab35a)), closes [#12611](https://github.com/vuejs/vue/issues/12611)


### Features

* allow passing directive definition directly to h() ([#12590](https://github.com/vuejs/vue/issues/12590)) ([d45bbea](https://github.com/vuejs/vue/commit/d45bbeac2710a5cf9185377abc2342295f0bb4e2))
* **types:** define component improvements ([#12612](https://github.com/vuejs/vue/issues/12612)) ([fb93c1b](https://github.com/vuejs/vue/commit/fb93c1be77f12ea1375c5e8b47d168e4d5ceb7be))



## [2.7.1](https://github.com/vuejs/vue/compare/v2.7.0...v2.7.1) (2022-07-04)


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue",
"version": "2.7.1",
"version": "2.7.2",
"packageManager": "pnpm@7.1.0",
"description": "Reactive, component-oriented view layer for modern web interfaces.",
"main": "dist/vue.runtime.common.js",
2 changes: 1 addition & 1 deletion packages/compiler-sfc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/compiler-sfc",
"version": "2.7.1",
"version": "2.7.2",
"description": "compiler-sfc for Vue 2",
"main": "dist/compiler-sfc.js",
"types": "dist/compiler-sfc.d.ts",
7 changes: 6 additions & 1 deletion packages/compiler-sfc/src/parseComponent.ts
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ export const DEFAULT_FILENAME = 'anonymous.vue'
const splitRE = /\r?\n/g
const replaceRE = /./g
const isSpecialTag = makeMap('script,style,template', true)
const isNeedIndentLang = makeMap('pug,jade')

export interface SFCCustomBlock {
type: string
@@ -177,7 +178,11 @@ export function parseComponent(
if (depth === 1 && currentBlock) {
currentBlock.end = start
let text = source.slice(currentBlock.start, currentBlock.end)
if (options.deindent) {
if (
options.deindent ||
// certain langs like pug are indent sensitive, preserve old behavior
(currentBlock.lang && isNeedIndentLang(currentBlock.lang))
) {
text = deindent(text)
}
// pad content so that linters and pre-processors can output correct
2 changes: 1 addition & 1 deletion packages/server-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-server-renderer",
"version": "2.7.1",
"version": "2.7.2",
"description": "server renderer for Vue 2.0",
"main": "index.js",
"types": "types/index.d.ts",
2 changes: 1 addition & 1 deletion packages/template-compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-template-compiler",
"version": "2.7.1",
"version": "2.7.2",
"description": "template compiler for Vue 2.0",
"main": "index.js",
"unpkg": "browser.js",
3 changes: 2 additions & 1 deletion src/core/util/next-tick.ts
Original file line number Diff line number Diff line change
@@ -86,7 +86,8 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) {
}

export function nextTick(): Promise<void>
export function nextTick(cb: (...args: any[]) => any, ctx?: object): void
export function nextTick<T>(this: T, cb: (this: T, ...args: any[]) => any): void
export function nextTick<T>(cb: (this: T, ...args: any[]) => any, ctx: T): void
/**
* @internal
*/
4 changes: 2 additions & 2 deletions src/core/vdom/modules/directives.ts
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ function normalizeDirectives(
// $flow-disable-line
return res
}
let i, dir
let i: number, dir: VNodeDirective
for (i = 0; i < dirs.length; i++) {
dir = dirs[i]
if (!dir.modifiers) {
@@ -103,7 +103,7 @@ function normalizeDirectives(
}
res[getRawDirName(dir)] = dir
if (vm._setupState && vm._setupState.__sfc) {
dir.def = resolveAsset(vm, '_setupState', 'v-' + dir.name)
dir.def = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name)
}
dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true)
}
6 changes: 6 additions & 0 deletions types/common.d.ts
Original file line number Diff line number Diff line change
@@ -13,3 +13,9 @@ type Equal<Left, Right> =
(<U>() => U extends Left ? 1 : 0) extends (<U>() => U extends Right ? 1 : 0) ? true : false;

export type HasDefined<T> = Equal<T, unknown> extends true ? false : true

// If the the type T accepts type "any", output type Y, otherwise output type N.
// https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360
export type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N

export type LooseRequired<T> = { [P in string & keyof T]: T[P] }
11 changes: 7 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -30,7 +30,8 @@ export {
VNode,
VNodeComponentOptions,
VNodeData,
VNodeDirective
VNodeDirective,
ComponentCustomProps
} from './vnode'

export * from './v3-manual-apis'
@@ -47,13 +48,15 @@ export {
// v2 already has option with same name and it's for a single computed
ComputedOptions as ComponentComputedOptions,
MethodOptions as ComponentMethodOptions,
ComponentPropsOptions
ComponentPropsOptions,
ComponentCustomOptions
} from './v3-component-options'
export {
ComponentInstance,
ComponentPublicInstance,
ComponentRenderProxy
} from './v3-component-proxy'
CreateComponentPublicInstance,
ComponentCustomProperties
} from './v3-component-public-instance'
export {
// PropType,
// PropOptions,
12 changes: 10 additions & 2 deletions types/jsx.d.ts
Original file line number Diff line number Diff line change
@@ -1313,7 +1313,12 @@ type NativeElements = {
>
}

import { VNode, VNodeData } from './vnode'
import {
VNode,
VNodeData,
ComponentCustomProps,
AllowedComponentProps
} from './vnode'

declare global {
namespace JSX {
@@ -1329,7 +1334,10 @@ declare global {
// @ts-ignore suppress ts:2374 = Duplicate string index signature.
[name: string]: any
}
interface IntrinsicAttributes extends ReservedProps {}
interface IntrinsicAttributes
extends ReservedProps,
AllowedComponentProps,
ComponentCustomProps {}
}
}

8 changes: 7 additions & 1 deletion types/options.d.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import { Vue, CreateElement, CombinedVueInstance } from './vue'
import { VNode, VNodeData, VNodeDirective, NormalizedScopedSlot } from './vnode'
import { SetupContext } from './v3-setup-context'
import { DebuggerEvent } from './v3-generated'
import { DefineComponent } from './v3-define-component'

type Constructor = {
new (...args: any[]): any
@@ -19,6 +20,7 @@ export type Component<
| typeof Vue
| FunctionalComponentOptions<Props>
| ComponentOptions<never, Data, Methods, Computed, Props, SetupBindings>
| DefineComponent<any, any, any, any, any>

type EsModule<T> = T | { default: T }

@@ -174,7 +176,10 @@ export interface ComponentOptions<
el?: Element | string
template?: string
// hack is for functional component type inference, should not be used in user code
render?(createElement: CreateElement, hack: RenderContext<Props>): VNode
render?(
createElement: CreateElement,
hack: RenderContext<Props>
): VNode | null | void
renderError?(createElement: CreateElement, err: Error): VNode
staticRenderFns?: ((createElement: CreateElement) => VNode)[]

@@ -198,6 +203,7 @@ export interface ComponentOptions<
[key: string]:
| Component<any, any, any, any>
| AsyncComponent<any, any, any, any>
| DefineComponent<any, any, any, any, any, any, any, any, any, any>
}
transitions?: { [key: string]: object }
filters?: { [key: string]: Function }
Loading