Skip to content

Commit 9bc1592

Browse files
committed
chore: Merge branch 'master-upstream' into types/maintain_type_from_markraw
# Conflicts: # packages/reactivity/src/reactive.ts # packages/reactivity/src/ref.ts # test-dts/reactivity.test-d.ts
2 parents e919147 + 7ffa225 commit 9bc1592

File tree

295 files changed

+15226
-6284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+15226
-6284
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ module.exports = {
2020
'no-restricted-syntax': [
2121
'error',
2222
'ObjectExpression > SpreadElement',
23-
'ObjectPattern > RestElement'
23+
'ObjectPattern > RestElement',
24+
'AwaitExpression'
2425
]
2526
},
2627
overrides: [

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v1
14+
- name: Set node version to 16
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: 16
1418
- uses: bahmutov/npm-install@v1
1519
- name: Run unit tests
1620
run: yarn test --ci
@@ -19,6 +23,10 @@ jobs:
1923
runs-on: ubuntu-latest
2024
steps:
2125
- uses: actions/checkout@v1
26+
- name: Set node version to 16
27+
uses: actions/setup-node@v2
28+
with:
29+
node-version: 16
2230
- uses: bahmutov/npm-install@v1
2331
- name: Run type declaration tests
2432
run: yarn test-dts
@@ -29,6 +37,10 @@ jobs:
2937
CI_JOB_NUMBER: 1
3038
steps:
3139
- uses: actions/checkout@v1
40+
- name: Set node version to 16
41+
uses: actions/setup-node@v2
42+
with:
43+
node-version: 16
3244
- uses: bahmutov/npm-install@v1
3345

3446
- name: Check build size

.prettierrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
semi: false
22
singleQuote: true
33
printWidth: 80
4+
trailingComma: 'none'
5+
arrowParens: 'avoid'

CHANGELOG.md

Lines changed: 1412 additions & 1206 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ This is the repository for Vue 3.0.
99
- Scaffold via [Vite](https://github.com/vitejs/vite):
1010

1111
```bash
12-
# npm
13-
npm init @vitejs/app
12+
# npm 6.x
13+
npm init vite@latest my-vue-app --template vue
14+
# npm 7+, extra double-dash is needed:
15+
npm init vite@latest my-vue-app -- --template vue
1416
# yarn
15-
yarn create @vitejs/app
16-
# select vue template
17+
yarn create vite my-vue-app --template vue
1718
```
1819

1920
- Scaffold via [vue-cli](https://cli.vuejs.org/):

jest.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ module.exports = {
1313
__FEATURE_OPTIONS_API__: true,
1414
__FEATURE_SUSPENSE__: true,
1515
__FEATURE_PROD_DEVTOOLS__: false,
16-
__COMPAT__: true
16+
__COMPAT__: true,
17+
'ts-jest': {
18+
tsconfig: {
19+
target: 'esnext'
20+
}
21+
}
1722
},
1823
coverageDirectory: 'coverage',
1924
coverageReporters: ['html', 'lcov', 'text'],

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
{
22
"private": true,
3-
"version": "3.1.0-beta.4",
3+
"version": "3.2.2",
44
"workspaces": [
55
"packages/*"
66
],
77
"scripts": {
88
"dev": "node scripts/dev.js",
99
"build": "node scripts/build.js",
1010
"size": "node scripts/build.js vue runtime-dom size-check -p -f global",
11-
"lint": "eslint --ext .ts packages/*/src/**",
11+
"lint": "eslint --ext .ts packages/*/src/**.ts",
1212
"format": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"",
1313
"test": "node scripts/build.js vue -f global -d && jest --runInBand",
1414
"test-dts": "node scripts/build.js shared reactivity runtime-core runtime-dom -dt -f esm-bundler && yarn test-dts-only",
1515
"test-dts-only": "tsc -p ./test-dts/tsconfig.json && tsc -p ./test-dts/tsconfig.build.json",
1616
"release": "node scripts/release.js",
1717
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
1818
"dev-compiler": "npm-run-all --parallel \"dev template-explorer\" serve",
19+
"dev-sfc": "npm-run-all --parallel \"dev compiler-sfc -f esm-browser\" \"dev runtime-core -f esm-bundler\" \"dev runtime-dom -f esm-bundler\" serve-sfc-playground",
20+
"serve-sfc-playground": "vite packages/sfc-playground",
1921
"serve": "serve",
2022
"open": "open http://localhost:5000/packages/template-explorer/local.html",
2123
"preinstall": "node ./scripts/checkYarn.js",
@@ -51,8 +53,8 @@
5153
"@rollup/plugin-replace": "^2.3.4",
5254
"@types/hash-sum": "^1.0.0",
5355
"@types/jest": "^26.0.16",
54-
"@types/node": "^14.10.1",
55-
"@types/puppeteer": "^2.0.0",
56+
"@types/node": "^16.4.7",
57+
"@types/puppeteer": "^5.0.0",
5658
"@typescript-eslint/parser": "^4.1.1",
5759
"brotli": "^1.3.2",
5860
"chalk": "^4.1.0",
@@ -66,16 +68,16 @@
6668
"lint-staged": "^10.2.10",
6769
"minimist": "^1.2.0",
6870
"npm-run-all": "^4.1.5",
69-
"prettier": "~1.14.0",
70-
"puppeteer": "^2.0.0",
71+
"prettier": "^2.3.1",
72+
"puppeteer": "^10.0.0",
7173
"rollup": "~2.38.5",
7274
"rollup-plugin-node-builtins": "^2.1.2",
7375
"rollup-plugin-node-globals": "^1.4.0",
7476
"rollup-plugin-polyfill-node": "^0.6.2",
7577
"rollup-plugin-terser": "^7.0.2",
7678
"rollup-plugin-typescript2": "^0.27.2",
7779
"semver": "^7.3.2",
78-
"serve": "^11.3.0",
80+
"serve": "^12.0.0",
7981
"ts-jest": "^26.2.0",
8082
"typescript": "^4.2.2",
8183
"yorkie": "^2.0.0"

packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ exports[`compiler: codegen Element (callExpression + objectExpression + Template
4848
"
4949
return function render(_ctx, _cache) {
5050
with (_ctx) {
51-
return _createVNode(\\"div\\", {
51+
return _createElementVNode(\\"div\\", {
5252
id: \\"foo\\",
5353
[prop]: bar,
5454
[foo + bar]: bar
5555
}, [
56-
_createVNode(\\"p\\", { \\"some-key\\": \\"foo\\" })
56+
_createElementVNode(\\"p\\", { \\"some-key\\": \\"foo\\" })
5757
], 16)
5858
}
5959
}"
@@ -98,7 +98,7 @@ exports[`compiler: codegen forNode 1`] = `
9898
"
9999
return function render(_ctx, _cache) {
100100
with (_ctx) {
101-
return (_openBlock(true), _createBlock(_Fragment, null, _renderList(), 1))
101+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(), 1))
102102
}
103103
}"
104104
`;
@@ -107,7 +107,7 @@ exports[`compiler: codegen forNode with constant expression 1`] = `
107107
"
108108
return function render(_ctx, _cache) {
109109
with (_ctx) {
110-
return (_openBlock(), _createBlock(_Fragment, null, _renderList(), 64 /* STABLE_FRAGMENT */))
110+
return (_openBlock(), _createElementBlock(_Fragment, null, _renderList(), 64 /* STABLE_FRAGMENT */))
111111
}
112112
}"
113113
`;

packages/compiler-core/__tests__/__snapshots__/compile.spec.ts.snap

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ exports[`compiler: integration tests function mode 1`] = `
55
66
return function render(_ctx, _cache) {
77
with (_ctx) {
8-
const { toDisplayString: _toDisplayString, openBlock: _openBlock, createBlock: _createBlock, createCommentVNode: _createCommentVNode, createTextVNode: _createTextVNode, Fragment: _Fragment, renderList: _renderList, createVNode: _createVNode } = _Vue
8+
const { toDisplayString: _toDisplayString, openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode, createTextVNode: _createTextVNode, Fragment: _Fragment, renderList: _renderList, createElementVNode: _createElementVNode, normalizeClass: _normalizeClass } = _Vue
99
10-
return (_openBlock(), _createBlock(\\"div\\", {
10+
return (_openBlock(), _createElementBlock(\\"div\\", {
1111
id: \\"foo\\",
12-
class: bar.baz
12+
class: _normalizeClass(bar.baz)
1313
}, [
1414
_createTextVNode(_toDisplayString(world.burn()) + \\" \\", 1 /* TEXT */),
1515
ok
16-
? (_openBlock(), _createBlock(\\"div\\", { key: 0 }, \\"yes\\"))
17-
: (_openBlock(), _createBlock(_Fragment, { key: 1 }, [
16+
? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }, \\"yes\\"))
17+
: (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
1818
_createTextVNode(\\"no\\")
1919
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */)),
20-
(_openBlock(true), _createBlock(_Fragment, null, _renderList(list, (value, index) => {
21-
return (_openBlock(), _createBlock(\\"div\\", null, [
22-
_createVNode(\\"span\\", null, _toDisplayString(value + index), 1 /* TEXT */)
20+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(list, (value, index) => {
21+
return (_openBlock(), _createElementBlock(\\"div\\", null, [
22+
_createElementVNode(\\"span\\", null, _toDisplayString(value + index), 1 /* TEXT */)
2323
]))
2424
}), 256 /* UNKEYED_FRAGMENT */))
2525
], 2 /* CLASS */))
@@ -28,45 +28,45 @@ return function render(_ctx, _cache) {
2828
`;
2929

3030
exports[`compiler: integration tests function mode w/ prefixIdentifiers: true 1`] = `
31-
"const { toDisplayString: _toDisplayString, openBlock: _openBlock, createBlock: _createBlock, createCommentVNode: _createCommentVNode, createTextVNode: _createTextVNode, Fragment: _Fragment, renderList: _renderList, createVNode: _createVNode } = Vue
31+
"const { toDisplayString: _toDisplayString, openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode, createTextVNode: _createTextVNode, Fragment: _Fragment, renderList: _renderList, createElementVNode: _createElementVNode, normalizeClass: _normalizeClass } = Vue
3232
3333
return function render(_ctx, _cache) {
34-
return (_openBlock(), _createBlock(\\"div\\", {
34+
return (_openBlock(), _createElementBlock(\\"div\\", {
3535
id: \\"foo\\",
36-
class: _ctx.bar.baz
36+
class: _normalizeClass(_ctx.bar.baz)
3737
}, [
3838
_createTextVNode(_toDisplayString(_ctx.world.burn()) + \\" \\", 1 /* TEXT */),
3939
(_ctx.ok)
40-
? (_openBlock(), _createBlock(\\"div\\", { key: 0 }, \\"yes\\"))
41-
: (_openBlock(), _createBlock(_Fragment, { key: 1 }, [
40+
? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }, \\"yes\\"))
41+
: (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
4242
_createTextVNode(\\"no\\")
4343
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */)),
44-
(_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.list, (value, index) => {
45-
return (_openBlock(), _createBlock(\\"div\\", null, [
46-
_createVNode(\\"span\\", null, _toDisplayString(value + index), 1 /* TEXT */)
44+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.list, (value, index) => {
45+
return (_openBlock(), _createElementBlock(\\"div\\", null, [
46+
_createElementVNode(\\"span\\", null, _toDisplayString(value + index), 1 /* TEXT */)
4747
]))
4848
}), 256 /* UNKEYED_FRAGMENT */))
4949
], 2 /* CLASS */))
5050
}"
5151
`;
5252

5353
exports[`compiler: integration tests module mode 1`] = `
54-
"import { toDisplayString as _toDisplayString, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, Fragment as _Fragment, renderList as _renderList, createVNode as _createVNode } from \\"vue\\"
54+
"import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, Fragment as _Fragment, renderList as _renderList, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from \\"vue\\"
5555
5656
export function render(_ctx, _cache) {
57-
return (_openBlock(), _createBlock(\\"div\\", {
57+
return (_openBlock(), _createElementBlock(\\"div\\", {
5858
id: \\"foo\\",
59-
class: _ctx.bar.baz
59+
class: _normalizeClass(_ctx.bar.baz)
6060
}, [
6161
_createTextVNode(_toDisplayString(_ctx.world.burn()) + \\" \\", 1 /* TEXT */),
6262
(_ctx.ok)
63-
? (_openBlock(), _createBlock(\\"div\\", { key: 0 }, \\"yes\\"))
64-
: (_openBlock(), _createBlock(_Fragment, { key: 1 }, [
63+
? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }, \\"yes\\"))
64+
: (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
6565
_createTextVNode(\\"no\\")
6666
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */)),
67-
(_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.list, (value, index) => {
68-
return (_openBlock(), _createBlock(\\"div\\", null, [
69-
_createVNode(\\"span\\", null, _toDisplayString(value + index), 1 /* TEXT */)
67+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.list, (value, index) => {
68+
return (_openBlock(), _createElementBlock(\\"div\\", null, [
69+
_createElementVNode(\\"span\\", null, _toDisplayString(value + index), 1 /* TEXT */)
7070
]))
7171
}), 256 /* UNKEYED_FRAGMENT */))
7272
], 2 /* CLASS */))
Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,78 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`scopeId compiler support should push scopeId for hoisted nodes 1`] = `
4-
"import { createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \\"vue\\"
5-
const _withId = /*#__PURE__*/_withScopeId(\\"test\\")
4+
"import { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \\"vue\\"
65
76
_pushScopeId(\\"test\\")
8-
const _hoisted_1 = /*#__PURE__*/_createVNode(\\"div\\", null, \\"hello\\", -1 /* HOISTED */)
9-
const _hoisted_2 = /*#__PURE__*/_createVNode(\\"div\\", null, \\"world\\", -1 /* HOISTED */)
7+
const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"div\\", null, \\"hello\\", -1 /* HOISTED */)
8+
const _hoisted_2 = /*#__PURE__*/_createElementVNode(\\"div\\", null, \\"world\\", -1 /* HOISTED */)
109
_popScopeId()
1110
12-
export const render = /*#__PURE__*/_withId((_ctx, _cache) => {
13-
return (_openBlock(), _createBlock(\\"div\\", null, [
11+
export function render(_ctx, _cache) {
12+
return (_openBlock(), _createElementBlock(\\"div\\", null, [
1413
_hoisted_1,
1514
_createTextVNode(_toDisplayString(_ctx.foo), 1 /* TEXT */),
1615
_hoisted_2
1716
]))
18-
})"
17+
}"
1918
`;
2019

2120
exports[`scopeId compiler support should wrap default slot 1`] = `
22-
"import { createVNode as _createVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from \\"vue\\"
23-
const _withId = /*#__PURE__*/_withScopeId(\\"test\\")
21+
"import { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from \\"vue\\"
2422
25-
export const render = /*#__PURE__*/_withId((_ctx, _cache) => {
23+
export function render(_ctx, _cache) {
2624
const _component_Child = _resolveComponent(\\"Child\\")
2725
2826
return (_openBlock(), _createBlock(_component_Child, null, {
29-
default: _withId(() => [
30-
_createVNode(\\"div\\")
27+
default: _withCtx(() => [
28+
_createElementVNode(\\"div\\")
3129
]),
3230
_: 1 /* STABLE */
3331
}))
34-
})"
32+
}"
3533
`;
3634

3735
exports[`scopeId compiler support should wrap dynamic slots 1`] = `
38-
"import { createVNode as _createVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from \\"vue\\"
39-
const _withId = /*#__PURE__*/_withScopeId(\\"test\\")
36+
"import { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from \\"vue\\"
4037
41-
export const render = /*#__PURE__*/_withId((_ctx, _cache) => {
38+
export function render(_ctx, _cache) {
4239
const _component_Child = _resolveComponent(\\"Child\\")
4340
4441
return (_openBlock(), _createBlock(_component_Child, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
4542
(_ctx.ok)
4643
? {
4744
name: \\"foo\\",
48-
fn: _withId(() => [
49-
_createVNode(\\"div\\")
45+
fn: _withCtx(() => [
46+
_createElementVNode(\\"div\\")
5047
])
5148
}
5249
: undefined,
5350
_renderList(_ctx.list, (i) => {
5451
return {
5552
name: i,
56-
fn: _withId(() => [
57-
_createVNode(\\"div\\")
53+
fn: _withCtx(() => [
54+
_createElementVNode(\\"div\\")
5855
])
5956
}
6057
})
6158
]), 1024 /* DYNAMIC_SLOTS */))
62-
})"
59+
}"
6360
`;
6461

6562
exports[`scopeId compiler support should wrap named slots 1`] = `
66-
"import { toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createVNode as _createVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from \\"vue\\"
67-
const _withId = /*#__PURE__*/_withScopeId(\\"test\\")
63+
"import { toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from \\"vue\\"
6864
69-
export const render = /*#__PURE__*/_withId((_ctx, _cache) => {
65+
export function render(_ctx, _cache) {
7066
const _component_Child = _resolveComponent(\\"Child\\")
7167
7268
return (_openBlock(), _createBlock(_component_Child, null, {
73-
foo: _withId(({ msg }) => [
69+
foo: _withCtx(({ msg }) => [
7470
_createTextVNode(_toDisplayString(msg), 1 /* TEXT */)
7571
]),
76-
bar: _withId(() => [
77-
_createVNode(\\"div\\")
72+
bar: _withCtx(() => [
73+
_createElementVNode(\\"div\\")
7874
]),
7975
_: 1 /* STABLE */
8076
}))
81-
})"
77+
}"
8278
`;

0 commit comments

Comments
 (0)