]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: format 12359/head 13579/head
authordaiwei <daiwei521@126.com>
Fri, 4 Jul 2025 06:28:15 +0000 (14:28 +0800)
committerdaiwei <daiwei521@126.com>
Fri, 4 Jul 2025 06:28:15 +0000 (14:28 +0800)
.github/contributing.md
.github/maintenance.md
packages/compiler-sfc/README.md
packages/runtime-core/__tests__/rendererAttrsFallthrough.spec.ts
packages/runtime-core/__tests__/rendererFragment.spec.ts
packages/runtime-core/src/compat/componentAsync.ts
packages/vue-compat/README.md
packages/vue/README.md

index 681d26e698d38a848c17ad2270427e646522a316..f0ec46ee7092cfcce5e8606028b19546a96c8c86 100644 (file)
@@ -38,7 +38,6 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
 ### Pull Request Checklist
 
 - Vue core has two primary work branches: `main` and `minor`.
-
   - If your pull request is a feature that adds new API surface, it should be submitted against the `minor` branch.
 
   - Otherwise, it should be submitted against the `main` branch.
@@ -46,12 +45,10 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
 - [Make sure to tick the "Allow edits from maintainers" box](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork). This allows us to directly make minor edits / refactors and saves a lot of time.
 
 - If adding a new feature:
-
   - Add accompanying test case.
   - Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
 
 - If fixing a bug:
-
   - 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)`.
   - Provide a detailed description of the bug in the PR. Live demo preferred.
   - Add appropriate test coverage if applicable. You can check the coverage of your code addition by running `nr test-coverage`.
@@ -69,9 +66,7 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
 - 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.
 
 - 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.
-
   - Is the code perf-sensitive (e.g. in "hot paths" like component updates or the vdom patch function?)
-
     - If the branch is dev-only, performance is less of a concern.
 
   - Check how much extra bundle size the change introduces.
@@ -265,7 +260,6 @@ This repository employs a [monorepo](https://en.wikipedia.org/wiki/Monorepo) set
 - `vue`: The public facing "full build" which includes both the runtime AND the compiler.
 
 - Private utility packages:
-
   - `dts-test`: Contains type-only tests against generated dts files.
 
   - `sfc-playground`: The playground continuously deployed at https://play.vuejs.org. To run the playground locally, use [`nr dev-sfc`](#nr-dev-sfc).
index b1fb550dd7a5ba93636388748b638511de85b2e1..7b0c2a336266148e58bbe4ffa1e5624c4f3223f7 100644 (file)
@@ -48,7 +48,6 @@ Depending on the type of the PR, different considerations need to be taken into
 - Performance: if a refactor PR claims to improve performance, there should be benchmarks showcasing said performance unless the improvement is self-explanatory.
 
 - Code quality / stylistic PRs: we should be conservative on merging this type PRs because (1) they can be subjective in many cases, and (2) they often come with large git diffs, causing merge conflicts with other pending PRs, and leading to unwanted noise when tracing changes through git history. Use your best judgement on this type of PRs on whether they are worth it.
-
   - For PRs in this category that are approved, do not merge immediately. Group them before releasing a new minor, after all feature-oriented PRs are merged.
 
 ### Reviewing a Feature
@@ -56,7 +55,6 @@ Depending on the type of the PR, different considerations need to be taken into
 - Feature PRs should always have clear context and explanation on why the feature should be added, ideally in the form of an RFC. If the PR doesn't explain what real-world problem it is solving, ask the contributor to clarify.
 
 - Decide if the feature should require an RFC process. The line isn't always clear, but a rough criteria is whether it is augmenting an existing API vs. adding a new API. Some examples:
-
   - Adding a new built-in component or directive is "significant" and definitely requires an RFC.
   - Template syntax additions like adding a new `v-on` modifier or a new `v-bind` syntax sugar are "substantial". It would be nice to have an RFC for it, but a detailed explanation on the use case and reasoning behind the design directly in the PR itself can be acceptable.
   - Small, low-impact additions like exposing a new utility type or adding a new app config option can be self-explanatory, but should still provide enough context in the PR.
@@ -70,7 +68,6 @@ Depending on the type of the PR, different considerations need to be taken into
 - Implementation: code style should be consistent with the rest of the codebase, follow common best practices. Prefer code that is boring but easy to understand over "clever" code.
 
 - Size: bundle size matters. We have a GitHub action that compares the size change for every PR. We should always aim to realize the desired changes with the smallest amount of code size increase.
-
   - Sometimes we need to compare the size increase vs. perceived benefits to decide whether a change is justifiable. Also take extra care to make sure added code can be tree-shaken if not needed.
 
   - Make sure to put dev-only code in `__DEV__` branches so they are tree-shakable.
@@ -80,7 +77,6 @@ Depending on the type of the PR, different considerations need to be taken into
   - 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`.
 
 - Performance
-
   - Be careful about code changes in "hot paths", in particular the Virtual DOM renderer (`runtime-core/src/renderer.ts`) and component instantiation code.
 
 - Potential Breakage
index 4f8ff3ac8b3aa5cc6ffaae4fe5f02ef6d7e04df7..4d2ae6e924827d3ac88cf7fecf8f5f217e8ca3b9 100644 (file)
@@ -11,7 +11,6 @@ This package contains lower level utilities that you can use if you are writing
 The API is intentionally low-level due to the various considerations when integrating Vue SFCs in a build system:
 
 - Separate hot-module replacement (HMR) for script, template and styles
-
   - template updates should not reset component state
   - style updates should be performed without component re-render
 
index 45d00579feeb7149400517f2dc0f79ed0f01086c..73e67aab2a0d4aa6ef5153c5f0124a346ebf9c8c 100644 (file)
@@ -573,7 +573,7 @@ describe('attribute fallthrough', () => {
     const Child = {
       props: [],
       render() {
-        return openBlock(), createBlock('div')
+        return (openBlock(), createBlock('div'))
       },
     }
 
index 81cf7b8df31e98d5d0e0d423c2e4f2a1c2229b8d..3394a41b2a062a6e20c3fe7e47add4db05ca22e4 100644 (file)
@@ -416,7 +416,7 @@ describe('renderer: fragment', () => {
     const root = nodeOps.createElement('div')
 
     const renderFn = () => {
-      return openBlock(true), createBlock(Fragment, null)
+      return (openBlock(true), createBlock(Fragment, null))
     }
 
     render(renderFn(), root)
index b6bd6dd4b94f6b0951d52f73a7d9f5c718a82146..fc6ae3b7939ea8bfb1a72eccba3ae0ff6f502e72 100644 (file)
@@ -35,7 +35,7 @@ export function convertLegacyAsyncComponent(
   let resolve: (res: LegacyAsyncReturnValue) => void
   let reject: (reason?: any) => void
   const fallbackPromise = new Promise<Component>((r, rj) => {
-    ;(resolve = r), (reject = rj)
+    ;((resolve = r), (reject = rj))
   })
 
   const res = comp(resolve!, reject!)
index 9428d6f6c7b0615b3759761008eb42b83018733e..97fe9a1cf19b8406db7a36cd1d0f9bcd446306f1 100644 (file)
@@ -41,7 +41,6 @@ The following workflow walks through the steps of migrating an actual Vue 2 app
 ### Installation
 
 1. Upgrade tooling if applicable.
-
    - If using custom webpack setup: Upgrade `vue-loader` to `^16.0.0`.
    - If using `vue-cli`: upgrade to the latest `@vue/cli-service` with `vue upgrade`
    - (Alternative) migrate to [Vite](https://vitejs.dev/) + [vite-plugin-vue2](https://github.com/underfin/vite-plugin-vue2). [[Example commit](https://github.com/vuejs/vue-hackernews-2.0/commit/565b948919eb58f22a32afca7e321b490cb3b074)]
@@ -160,7 +159,6 @@ The following workflow walks through the steps of migrating an actual Vue 2 app
 5. After fixing the errors, the app should be able to run if it is not subject to the [limitations](#known-limitations) mentioned above.
 
    You will likely see a LOT of warnings from both the command line and the browser console. Here are some general tips:
-
    - You can filter for specific warnings in the browser console. It's a good idea to use the filter and focus on fixing one item at a time. You can also use negated filters like `-GLOBAL_MOUNT`.
 
    - You can suppress specific deprecations via [compat configuration](#compat-configuration).
index 757ea82f5d7f81a51f8be75f58549c19899287c0..30e08cfd2ab5a900467cba5d7766f314f2c8bdca 100644 (file)
@@ -5,7 +5,6 @@
 ### From CDN or without a Bundler
 
 - **`vue(.runtime).global(.prod).js`**:
-
   - For direct use via `<script src="...">` in the browser. Exposes the `Vue` global.
   - Note that global builds are not [UMD](https://github.com/umdjs/umd) builds. They are built as [IIFEs](https://developer.mozilla.org/en-US/docs/Glossary/IIFE) and is only meant for direct use via `<script src="...">`.
   - In-browser template compilation:
@@ -21,7 +20,6 @@
 ### With a Bundler
 
 - **`vue(.runtime).esm-bundler.js`**:
-
   - For use with bundlers like `webpack`, `rollup` and `parcel`.
   - Leaves prod/dev branches with `process.env.NODE_ENV` guards (must be replaced by bundler)
   - Does not ship minified builds (to be done together with the rest of the code after bundling)
 `esm-bundler` builds of Vue expose global feature flags that can be overwritten at compile time:
 
 - `__VUE_OPTIONS_API__`
-
   - Default: `true`
   - Enable / disable Options API support
 
 - `__VUE_PROD_DEVTOOLS__`
-
   - Default: `false`
   - Enable / disable devtools support in production