Skip to content

Commit bd10ce8

Browse files
authored
Merge branch 'main' into types/maintain_type_from_markraw
2 parents 9bc1592 + 67099fe commit bd10ce8

File tree

336 files changed

+19707
-15627
lines changed

Some content is hidden

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

336 files changed

+19707
-15627
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ module.exports = {
4949
},
5050
// Packages targeting Node
5151
{
52-
files: ['packages/{compiler-sfc,compiler-ssr,server-renderer}/**'],
52+
files: [
53+
'packages/{compiler-sfc,compiler-ssr,server-renderer,reactivity-transform}/**'
54+
],
5355
rules: {
5456
'no-restricted-globals': ['error', ...DOMGlobals],
5557
'no-restricted-syntax': 'off'

.github/FUNDING.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
open_collective: vuejs
2-
patreon: evanyou
31
github: yyx990803
2+
open_collective: vuejs

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Create new issue
4-
url: https://new-issue.vuejs.org/?repo=vuejs/vue-next
4+
url: https://new-issue.vuejs.org/?repo=vuejs/core
55
about: Please use the following link to create a new issue.
66
- name: Patreon
77
url: https://www.patreon.com/evanyou

.github/contributing.md

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Hi! I'm really excited that you are interested in contributing to Vue.js. Before submitting your contribution, please make sure to take a moment and read through the following guidelines:
44

5-
- [Code of Conduct](https://github.com/vuejs/vue/blob/dev/.github/CODE_OF_CONDUCT.md)
5+
- [Code of Conduct](https://vuejs.org/about/coc.html)
66
- [Issue Reporting Guidelines](#issue-reporting-guidelines)
77
- [Pull Request Guidelines](#pull-request-guidelines)
88
- [Development Setup](#development-setup)
@@ -28,7 +28,7 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
2828

2929
- If you are resolving a special issue, add `(fix #xxxx[,#xxxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`.
3030
- Provide a detailed description of the bug in the PR. Live demo preferred.
31-
- Add appropriate test coverage if applicable. You can check the coverage of your code addition by running `yarn test --coverage`.
31+
- Add appropriate test coverage if applicable. You can check the coverage of your code addition by running `npm test -- --coverage`.
3232

3333
- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.
3434

@@ -40,12 +40,14 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
4040

4141
## Development Setup
4242

43-
You will need [Node.js](http://nodejs.org) **version 10+**, and [Yarn 1.x](https://yarnpkg.com/en/docs/install).
43+
You will need [Node.js](https://nodejs.org) **version 16+**, and [PNPM](https://pnpm.io).
44+
45+
We also recommend installing [ni](https://github.com/antfu/ni) to help switching between repos using different package managers. `ni` also provides the handy `nr` command which running npm scripts easier.
4446

4547
After cloning the repo, run:
4648

4749
```bash
48-
$ yarn # install the dependencies of the project
50+
$ pnpm i # install the dependencies of the project
4951
```
5052

5153
A high level overview of tools used:
@@ -57,18 +59,20 @@ A high level overview of tools used:
5759

5860
## Scripts
5961

60-
### `yarn build`
62+
**The examples below will be using the `nr` command from the [ni](https://github.com/antfu/ni) package.** You can also use plain `npm run`, but you will need to pass all additional arguments after the command after an extra `--`. For example, `nr build runtime --all` is equivalent to `npm run build -- runtime --all`.
63+
64+
### `nr build`
6165

6266
The `build` script builds all public packages (packages without `private: true` in their `package.json`).
6367

6468
Packages to build can be specified with fuzzy matching:
6569

6670
```bash
6771
# build runtime-core only
68-
yarn build runtime-core
72+
nr build runtime-core
6973

7074
# build all packages matching "runtime"
71-
yarn build runtime --all
75+
nr build runtime --all
7276
```
7377

7478
#### Build Formats
@@ -86,18 +90,18 @@ Additional formats that only apply to the main `vue` package:
8690
- **`esm-bundler-runtime`**
8791
- **`esm-browser-runtime`**
8892

89-
More details about each of these formats can be found in the [`vue` package README](https://github.com/vuejs/vue-next/blob/master/packages/vue/README.md#which-dist-file-to-use) and the [Rollup config file](https://github.com/vuejs/vue-next/blob/master/rollup.config.js).
93+
More details about each of these formats can be found in the [`vue` package README](https://github.com/vuejs/core/blob/main/packages/vue/README.md#which-dist-file-to-use) and the [Rollup config file](https://github.com/vuejs/core/blob/main/rollup.config.js).
9094

9195
For example, to build `runtime-core` with the global build only:
9296

9397
```bash
94-
yarn build runtime-core -f global
98+
nr build runtime-core -f global
9599
```
96100

97101
Multiple formats can be specified as a comma-separated list:
98102

99103
```bash
100-
yarn build runtime-core -f esm-browser,cjs
104+
nr build runtime-core -f esm-browser,cjs
101105
```
102106

103107
#### Build with Source Maps
@@ -112,48 +116,50 @@ The `--types` or `-t` flag will generate type declarations during the build and
112116
- Generate an API report in `<projectRoot>/temp/<packageName>.api.md`. This report contains potential warnings emitted by [api-extractor](https://api-extractor.com/).
113117
- Generate an API model json in `<projectRoot>/temp/<packageName>.api.json`. This file can be used to generate a Markdown version of the exported APIs.
114118

115-
### `yarn dev`
119+
### `nr dev`
116120

117121
The `dev` script bundles a target package (default: `vue`) in a specified format (default: `global`) in dev mode and watches for changes. This is useful when you want to load up a build in an HTML page for quick debugging:
118122

119123
```bash
120-
$ yarn dev
124+
$ nr dev
121125

122-
> rollup v1.19.4
123-
> bundles packages/vue/src/index.ts → packages/vue/dist/vue.global.js...
126+
> watching: packages/vue/dist/vue.global.js
124127
```
125128

126-
- The `dev` script also supports fuzzy match for the target package, but will only match the first package matched.
129+
- **Important:** output of the `dev` script is for development and debugging only. While it has the same runtime behavior, the generated code should never be published to npm.
130+
131+
- The `dev` script does not support fuzzy match - you must specify the full package name, e.g. `nr dev runtime-core`.
127132

128133
- The `dev` script supports specifying build format via the `-f` flag just like the `build` script.
129134

130135
- The `dev` script also supports the `-s` flag for generating source maps, but it will make rebuilds slower.
131136

132-
### `yarn dev-compiler`
137+
- The `dev` script supports the `-i` flag for inlining all deps. This is useful when debugging `esm-bundler` builds which externalizes deps by default.
138+
139+
### `nr dev-compiler`
133140

134-
The `dev-compiler` script builds, watches and serves the [Template Explorer](https://github.com/vuejs/vue-next/tree/master/packages/template-explorer) at `http://localhost:5000`. This is extremely useful when working on the compiler.
141+
The `dev-compiler` script builds, watches and serves the [Template Explorer](https://github.com/vuejs/core/tree/main/packages/template-explorer) at `http://localhost:5000`. This is extremely useful when working on the compiler.
135142

136-
### `yarn test`
143+
### `nr test`
137144

138145
The `test` script simply calls the `jest` binary, so all [Jest CLI Options](https://jestjs.io/docs/en/cli) can be used. Some examples:
139146

140147
```bash
141148
# run all tests
142-
$ yarn test
143-
144-
# run tests in watch mode
145-
$ yarn test --watch
149+
$ nr test
146150

147151
# run all tests under the runtime-core package
148-
$ yarn test runtime-core
152+
$ nr test runtime-core
149153

150154
# run tests in a specific file
151-
$ yarn test fileName
155+
$ nr test fileName
152156

153157
# run a specific test in a specific file
154-
$ yarn test fileName -t 'test name'
158+
$ nr test fileName -t 'test name'
155159
```
156160

161+
The default `test` script includes the `--runInBand` jest flag to improve test stability, especially for the CSS transition related tests. When you are testing specific test specs, you can also run `npx jest` with flags directly to speed up tests (jest runs them in parallel by default).
162+
157163
## Project Structure
158164

159165
This repository employs a [monorepo](https://en.wikipedia.org/wiki/Monorepo) setup which hosts a number of associated packages under the `packages` directory:
@@ -172,9 +178,11 @@ This repository employs a [monorepo](https://en.wikipedia.org/wiki/Monorepo) set
172178

173179
- `compiler-dom`: Compiler with additional plugins specifically targeting the browser.
174180

181+
- `compiler-sfc`: Lower level utilities for compiling Vue Single File Components.
182+
175183
- `compiler-ssr`: Compiler that produces render functions optimized for server-side rendering.
176184

177-
- `template-explorer`: A development tool for debugging compiler output. You can run `yarn dev template-explorer` and open its `index.html` to get a repl of template compilation based on current source code.
185+
- `template-explorer`: A development tool for debugging compiler output. You can run `nr dev template-explorer` and open its `index.html` to get a repl of template compilation based on current source code.
178186

179187
A [live version](https://vue-next-template-explorer.netlify.com) of the template explorer is also available, which can be used for providing reproductions for compiler bugs. You can also pick the deployment for a specific commit from the [deploy logs](https://app.netlify.com/sites/vue-next-template-explorer/deploys).
180188

@@ -192,9 +200,9 @@ import { h } from '@vue/runtime-core'
192200

193201
This is made possible via several configurations:
194202

195-
- For TypeScript, `compilerOptions.path` in `tsconfig.json`
203+
- For TypeScript, `compilerOptions.paths` in `tsconfig.json`
196204
- For Jest, `moduleNameMapper` in `jest.config.js`
197-
- For plain Node.js, they are linked using [Yarn Workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/).
205+
- For plain Node.js, they are linked using [PNPM Workspaces](https://pnpm.io/workspaces).
198206

199207
### Package Dependencies
200208

@@ -245,7 +253,7 @@ Test coverage is continuously deployed at https://vue-next-coverage.netlify.app/
245253

246254
This project uses [tsd](https://github.com/SamVerschueren/tsd) to test the built definition files (`*.d.ts`).
247255

248-
Type tests are located in the `test-dts` directory. To run the dts tests, run `yarn test-dts`. Note that the type test requires all relevant `*.d.ts` files to be built first (and the script does it for you). Once the `d.ts` files are built and up-to-date, the tests can be re-run by simply running `yarn test-dts`.
256+
Type tests are located in the `test-dts` directory. To run the dts tests, run `nr test-dts`. Note that the type test requires all relevant `*.d.ts` files to be built first (and the script does it for you). Once the `d.ts` files are built and up-to-date, the tests can be re-run by simply running `nr test-dts`.
249257

250258
## Financial Contribution
251259

.github/workflows/ci.yml

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,74 @@ on:
55
- '**'
66
pull_request:
77
branches:
8-
- master
8+
- main
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v1
13+
- uses: actions/checkout@v2
14+
15+
- name: Install pnpm
16+
uses: pnpm/[email protected]
17+
with:
18+
version: 6.15.1
19+
1420
- name: Set node version to 16
1521
uses: actions/setup-node@v2
1622
with:
1723
node-version: 16
18-
- uses: bahmutov/npm-install@v1
24+
cache: 'pnpm'
25+
26+
- run: pnpm install
27+
1928
- name: Run unit tests
20-
run: yarn test --ci
29+
run: pnpm run test
2130

2231
test-dts:
2332
runs-on: ubuntu-latest
2433
steps:
25-
- uses: actions/checkout@v1
34+
- uses: actions/checkout@v2
35+
36+
- name: Install pnpm
37+
uses: pnpm/[email protected]
38+
with:
39+
version: 6.15.1
40+
2641
- name: Set node version to 16
2742
uses: actions/setup-node@v2
2843
with:
2944
node-version: 16
30-
- uses: bahmutov/npm-install@v1
45+
cache: 'pnpm'
46+
47+
- run: pnpm install
48+
3149
- name: Run type declaration tests
32-
run: yarn test-dts
50+
run: pnpm run test-dts
3351

3452
size:
3553
runs-on: ubuntu-latest
3654
env:
3755
CI_JOB_NUMBER: 1
3856
steps:
39-
- uses: actions/checkout@v1
57+
- uses: actions/checkout@v2
58+
59+
- name: Install pnpm
60+
uses: pnpm/[email protected]
61+
with:
62+
version: 6.15.1
63+
4064
- name: Set node version to 16
4165
uses: actions/setup-node@v2
4266
with:
4367
node-version: 16
44-
- uses: bahmutov/npm-install@v1
68+
cache: 'pnpm'
4569

46-
- name: Check build size
47-
uses: posva/[email protected]
48-
with:
49-
github_token: ${{ secrets.GITHUB_TOKEN }}
50-
build_script: size
51-
files: packages/vue/dist/vue.global.prod.js packages/runtime-dom/dist/runtime-dom.global.prod.js packages/size-check/dist/size-check.global.prod.js
70+
- run: pnpm install
71+
- run: pnpm run size
72+
73+
# - name: Check build size
74+
# uses: posva/[email protected]
75+
# with:
76+
# github_token: ${{ secrets.GITHUB_TOKEN }}
77+
# build_script: size
78+
# files: packages/vue/dist/vue.global.prod.js packages/runtime-dom/dist/runtime-dom.global.prod.js packages/size-check/dist/index.js

.github/workflows/release-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
with:
2121
tag_name: ${{ github.ref }}
2222
body: |
23-
Please refer to [CHANGELOG.md](https://github.com/vuejs/vue-next/blob/master/CHANGELOG.md) for details.
23+
Please refer to [CHANGELOG.md](https://github.com/vuejs/core/blob/main/CHANGELOG.md) for details.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ temp
66
explorations
77
TODOs.md
88
*.log
9+
.idea

BACKERS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<h1 align="center">Sponsors &amp; Backers</h1>
2+
3+
Vue.js is an MIT-licensed open source project with its ongoing development made possible entirely by the support of the awesome sponsors and backers listed in this file. If you'd like to join them, please consider [ sponsor Vue's development](https://vuejs.org/sponsor/).
4+
5+
<p align="center">
6+
<a target="_blank" href="https://sponsors.vuejs.org/backers.svg">
7+
<img alt="sponsors" src="https://sponsors.vuejs.org/backers.svg">
8+
</a>
9+
</p>

0 commit comments

Comments
 (0)