Skip to content

Commit 93051d1

Browse files
committed
Merge branch 'main' into pr/5912
2 parents 10e3558 + 4902354 commit 93051d1

File tree

243 files changed

+9667
-5626
lines changed

Some content is hidden

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

243 files changed

+9667
-5626
lines changed

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ module.exports = {
6969
'no-restricted-globals': ['error', ...NodeGlobals],
7070
'no-restricted-syntax': 'off'
7171
}
72+
},
73+
// Node scripts
74+
{
75+
files: ['scripts/**', './*.js', 'packages/**/index.js', 'packages/size-check/**'],
76+
rules: {
77+
'no-restricted-globals': 'off',
78+
'no-restricted-syntax': 'off'
79+
}
7280
}
7381
]
7482
}

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ body:
3030
description: |
3131
The easiest way to provide a reproduction is by showing the bug in [The SFC Playground](https://sfc.vuejs.org/).
3232
If it cannot be reproduced in the playground and requires a proper build setup, try [StackBlitz](https://vite.new/vue).
33-
If neither of these are suitable, you can always provide a GitHub reporistory.
33+
If neither of these are suitable, you can always provide a GitHub repository.
3434
3535
The reproduction should be **minimal** - i.e. it should contain only the bare minimum amount of code needed
3636
to show the bug. See [Bug Reproduction Guidelines](https://github.com/vuejs/core/blob/main/.github/bug-repro-guidelines.md) for more details.

.github/contributing.md

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,24 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
3636

3737
- Make sure tests pass!
3838

39-
- Commit messages must follow the [commit message convention](./commit-convention.md) so that changelogs can be automatically generated. Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [yorkie](https://github.com/yyx990803/yorkie)).
39+
- Commit messages must follow the [commit message convention](./commit-convention.md) so that changelogs can be automatically generated. Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks)).
4040

41-
- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [yorkie](https://github.com/yyx990803/yorkie)).
41+
- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks)).
42+
43+
### Advanced Pull Request Tips
44+
45+
- The PR should fix the intended bug **only** and not introduce unrelated changes. This includes unnecessary refactors - a PR should focus on the fix and not code style, this makes it easier to trace changes in the future.
46+
47+
- Consider the performance / size impact of the changes, and whether the bug being fixes justifies the cost. If the bug being fixed is a very niche edge case, we should try to minimize the size / perf cost to make it worthwhile.
48+
49+
- Is the code perf-sensitive (e.g. in "hot paths" like component updates or the vdom patch function?)
50+
51+
- If the branch is dev-only, performance is less of a concern.
52+
53+
- Check how much extra bundle size the change introduces.
54+
- Make sure to put dev-only code in `__DEV__` branches so they are tree-shakable.
55+
- Runtime code is more sensitive to size increase than compiler code.
56+
- Make sure it doesn't accidentally cause dev-only or compiler-only code branches to be included in the runtime build. Notable case is that some functions in `@vue/shared` are compiler-only and should not be used in runtime code, e.g. `isHTMLTag` and `isSVGTag`.
4257

4358
## Development Setup
4459

@@ -63,6 +78,8 @@ A high level overview of tools used:
6378

6479
**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`.
6580

81+
The `run-s` and `run-p` commands found in some scripts are from [npm-run-all](https://github.com/mysticatea/npm-run-all) for orchestrating multiple scripts. `run-s` means "run in sequence" while `run-p` means "run in parallel".
82+
6683
### `nr build`
6784

6885
The `build` script builds all public packages (packages without `private: true` in their `package.json`).
@@ -138,9 +155,17 @@ $ nr dev
138155

139156
- The `dev` script supports the `-i` flag for inlining all deps. This is useful when debugging `esm-bundler` builds which externalizes deps by default.
140157

158+
### `nr dev-sfc`
159+
160+
Shortcut for starting the SFC Playground in local dev mode. This provides the fastest feedback loop when debugging issues that can be reproduced in the SFC Playground.
161+
162+
### `nr dev-esm`
163+
164+
Builds and watches `vue/dist/vue-runtime.esm-bundler.js` with all deps inlined using esbuild. This is useful when debugging the ESM build in a reproductions that require real build setups: link `packages/vue` globally, then link it into the project being debugged.
165+
141166
### `nr dev-compiler`
142167

143-
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.
168+
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 useful when working on pure compiler issues.
144169

145170
### `nr test`
146171

@@ -208,27 +233,29 @@ This is made possible via several configurations:
208233

209234
### Package Dependencies
210235

211-
```
212-
+---------------------+
213-
| |
214-
| @vue/compiler-sfc |
215-
| |
216-
+-----+--------+------+
217-
| |
218-
v v
219-
+---------------------+ +----------------------+
220-
| | | |
221-
+------------>| @vue/compiler-dom +--->| @vue/compiler-core |
222-
| | | | |
223-
+----+----+ +---------------------+ +----------------------+
224-
| |
225-
| vue |
226-
| |
227-
+----+----+ +---------------------+ +----------------------+ +-------------------+
228-
| | | | | | |
229-
+------------>| @vue/runtime-dom +--->| @vue/runtime-core +--->| @vue/reactivity |
230-
| | | | | |
231-
+---------------------+ +----------------------+ +-------------------+
236+
```mermaid
237+
flowchart LR
238+
compiler-sfc["@vue/compiler-sfc"]
239+
compiler-dom["@vue/compiler-dom"]
240+
compiler-core["@vue/compiler-core"]
241+
vue["vue"]
242+
runtime-dom["@vue/runtime-dom"]
243+
runtime-core["@vue/runtime-core"]
244+
reactivity["@vue/reactivity"]
245+
246+
subgraph "Runtime Packages"
247+
runtime-dom --> runtime-core
248+
runtime-core --> reactivity
249+
end
250+
251+
subgraph "Compiler Packages"
252+
compiler-sfc --> compiler-core
253+
compiler-sfc --> compiler-dom
254+
compiler-dom --> compiler-core
255+
end
256+
257+
vue ---> compiler-dom
258+
vue --> runtime-dom
232259
```
233260

234261
There are some rules to follow when importing across package boundaries:
@@ -253,8 +280,6 @@ Test coverage is continuously deployed at https://vue-next-coverage.netlify.app/
253280

254281
### Testing Type Definition Correctness
255282

256-
This project uses [tsd](https://github.com/SamVerschueren/tsd) to test the built definition files (`*.d.ts`).
257-
258283
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`.
259284

260285
## Financial Contribution

.github/workflows/ci.yml

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,48 @@ on:
66
pull_request:
77
branches:
88
- main
9+
10+
permissions:
11+
contents: read # to fetch code (actions/checkout)
12+
913
jobs:
1014
unit-test:
1115
runs-on: ubuntu-latest
1216
steps:
13-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1418

1519
- name: Install pnpm
1620
uses: pnpm/action-setup@v2
1721

18-
- name: Set node version to 16
19-
uses: actions/setup-node@v2
22+
- name: Set node version to 18
23+
uses: actions/setup-node@v3
2024
with:
21-
node-version: 16
25+
node-version: 18
2226
cache: 'pnpm'
2327

24-
- run: pnpm install
28+
- run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
2529

2630
- name: Run unit tests
2731
run: pnpm run test-unit
2832

2933
e2e-test:
3034
runs-on: ubuntu-latest
3135
steps:
32-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v3
37+
38+
- name: Setup cache for Chromium binary
39+
uses: actions/cache@v3
40+
with:
41+
path: ~/.cache/puppeteer/chrome
42+
key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
3343

3444
- name: Install pnpm
3545
uses: pnpm/action-setup@v2
3646

37-
- name: Set node version to 16
38-
uses: actions/setup-node@v2
47+
- name: Set node version to 18
48+
uses: actions/setup-node@v3
3949
with:
40-
node-version: 16
50+
node-version: 18
4151
cache: 'pnpm'
4252

4353
- run: pnpm install
@@ -48,22 +58,25 @@ jobs:
4858
lint-and-test-dts:
4959
runs-on: ubuntu-latest
5060
steps:
51-
- uses: actions/checkout@v2
61+
- uses: actions/checkout@v3
5262

5363
- name: Install pnpm
5464
uses: pnpm/action-setup@v2
5565

56-
- name: Set node version to 16
57-
uses: actions/setup-node@v2
66+
- name: Set node version to 18
67+
uses: actions/setup-node@v3
5868
with:
59-
node-version: 16
69+
node-version: 18
6070
cache: 'pnpm'
6171

62-
- run: pnpm install
72+
- run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
6373

6474
- name: Run eslint
6575
run: pnpm run lint
6676

77+
# - name: Run prettier
78+
# run: pnpm run format-check
79+
6780
- name: Run type declaration tests
6881
run: pnpm run test-dts
6982

@@ -72,18 +85,18 @@ jobs:
7285
env:
7386
CI_JOB_NUMBER: 1
7487
steps:
75-
- uses: actions/checkout@v2
88+
- uses: actions/checkout@v3
7689

7790
- name: Install pnpm
7891
uses: pnpm/action-setup@v2
7992

80-
- name: Set node version to 16
81-
uses: actions/setup-node@v2
93+
- name: Set node version to 18
94+
uses: actions/setup-node@v3
8295
with:
83-
node-version: 16
96+
node-version: 18
8497
cache: 'pnpm'
8598

86-
- run: pnpm install
99+
- run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
87100
- run: pnpm run size
88101

89102
# - name: Check build size

.github/workflows/release-tag.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ on:
55

66
name: Create Release
77

8+
permissions: {}
89
jobs:
910
build:
11+
permissions:
12+
contents: write # to create release (yyx990803/release-tag)
13+
1014
name: Create Release
1115
runs-on: ubuntu-latest
1216
steps:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ explorations
77
TODOs.md
88
*.log
99
.idea
10+
.eslintcache

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

BACKERS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h1 align="center">Sponsors &amp; Backers</h1>
22

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/).
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 [ sponsoring Vue's development](https://vuejs.org/sponsor/).
44

55
<p align="center">
66
<a target="_blank" href="https://sponsors.vuejs.org/backers.svg">

0 commit comments

Comments
 (0)