Skip to content

Commit ddb1aea

Browse files
tweak wording, correct typos and adjust grammar (#1366)
1 parent cb7415c commit ddb1aea

19 files changed

+52
-50
lines changed

src/.vitepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ const sidebar = {
191191
{
192192
text: 'Scaling Up',
193193
items: [
194-
{ text: 'Single File Components', link: '/guide/scaling-up/sfc' },
194+
{ text: 'Single-File Components', link: '/guide/scaling-up/sfc' },
195195
{ text: 'Tooling', link: '/guide/scaling-up/tooling' },
196196
{ text: 'Routing', link: '/guide/scaling-up/routing' },
197197
{

src/.vitepress/theme/components/NewsLetter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import { VTLink } from '@vue/theme'
4747
>Twitter</VTLink
4848
>, or join our home at
4949
<VTLink class="link" href="https://chat.vuejs.org/" no-icon
50-
>Dicsord</VTLink
50+
>Discord</VTLink
5151
>.
5252
</p>
5353
</div>

src/about/faq.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The latest version of Vue (3.x) only supports [browsers with native ES2015 suppo
1616

1717
## Is Vue reliable?
1818

19-
Vue is a mature and battle-tested framework. It is one of the most widely used JavaScript frameworks in production today, with over 1.5 million users worldwide, and is downloaded close to 10 millions times a month on NPM.
19+
Vue is a mature and battle-tested framework. It is one of the most widely used JavaScript frameworks in production today, with over 1.5 million users worldwide, and is downloaded close to 10 million times a month on npm.
2020

2121
Vue is used in production by renowned organizations in varying capacities all around the world, including Uncyclomedia Foundation, NASA, Apple, Google, Microsoft, GitLab, Zoom, Tencent, Weibo, Bilibili, Kuaishou, and many more.
2222

@@ -26,7 +26,7 @@ Vue 3 is one of the most performant mainstream frontend frameworks, and handles
2626

2727
In stress-testing scenarios, Vue out-performs React and Angular by a decent margin in the [js-framework-benchmark](https://rawgit.com/krausest/js-framework-benchmark/master/webdriver-ts-results/table.html). It also goes neck-and-neck against some of the fastest production-level non-Virtual-DOM frameworks in the benchmark.
2828

29-
Do note that synthetic benchmarks like the above focus on raw rendering performance with dedicated optimizations and may not be fully representative of real world performance results. If you care more about page load performance, here is the [Lighthouse audit](https://www.webpagetest.org/result/210818_BiDcYB_4a83d7a1f2a7f6fdc76db16a00b4882d/) generated via [WebPageTest](https://www.webpagetest.org/lighthouse) for a real world Vue-powered site with SSG pre-rendering, full page hydration and SPA client-side navigations. It scores 98 in performance on an emulated Moto G4 with 4x CPU throttling over 3G networks.
29+
Do note that synthetic benchmarks like the above focus on raw rendering performance with dedicated optimizations and may not be fully representative of real-world performance results. If you care more about page load performance, here is the [Lighthouse audit](https://www.webpagetest.org/result/210818_BiDcYB_4a83d7a1f2a7f6fdc76db16a00b4882d/) generated via [WebPageTest](https://www.webpagetest.org/lighthouse) for a real-world, Vue-powered site with SSG pre-rendering, full page hydration and SPA client-side navigations. It scores 98 in performance on an emulated Moto G4 with 4x CPU throttling over 3G networks.
3030

3131
You can learn more about how Vue automatically optimizes runtime performance in the [Rendering Mechanism](/guide/advanced/rendering-mechanism.html) section, and how to optimize a Vue app in particularly demanding cases in the [Performance Optimization Guide](/guide/best-practices/performance.html).
3232

@@ -36,21 +36,21 @@ When you use a build tool, many of Vue's APIs are ["tree-shakable"](https://deve
3636

3737
A hello world Vue app that only uses the absolutely minimal APIs has a baseline size of only around **16kb**, with minification and brotli compression. The actual size of the application will depend on how many optional features you use from the framework. In the unlikely case where an app uses every single feature that Vue provides, the total runtime size is around **27kb**.
3838

39-
When using Vue without a build tool, we not only lose tree-shaking, but also have to ship the template compiler to the browser. This bloats up the size to around **41kb**. Therefore if you are using Vue primarily for progressive enhancement without a build step, consider using [petite-vue](https://github.com/vuejs/petite-vue) (only **6kb**) instead.
39+
When using Vue without a build tool, we not only lose tree-shaking, but also have to ship the template compiler to the browser. This bloats up the size to around **41kb**. Therefore, if you are using Vue primarily for progressive enhancement without a build step, consider using [petite-vue](https://github.com/vuejs/petite-vue) (only **6kb**) instead.
4040

41-
Some frameworks, such as Svelte, use a compilation strategy that produces extremely lightweight output in single-component scenarios. However, [our research](https://github.com/yyx990803/vue-svelte-size-analysis) shows that the size difference heavily depends on the number of components in the application. While Vue has a heavier baseline size, it generates less code per component. In real world scenarios, a Vue app may very well end up being lighter.
41+
Some frameworks, such as Svelte, use a compilation strategy that produces extremely lightweight output in single-component scenarios. However, [our research](https://github.com/yyx990803/vue-svelte-size-analysis) shows that the size difference heavily depends on the number of components in the application. While Vue has a heavier baseline size, it generates less code per component. In real-world scenarios, a Vue app may very well end up being lighter.
4242

4343
## Does Vue scale?
4444

45-
Yes. Despite common misconception that Vue is only suitable for simple use cases, Vue is perfectly capable of handling large scale applications:
45+
Yes. Despite a common misconception that Vue is only suitable for simple use cases, Vue is perfectly capable of handling large scale applications:
4646

47-
- [Single File Components](/guide/scaling-up/sfc) provide a modularized development model that allows different parts of an application to be developed in isolation.
47+
- [Single-File Components](/guide/scaling-up/sfc) provide a modularized development model that allows different parts of an application to be developed in isolation.
4848

4949
- [Composition API](/guide/reusability/composables) provides first-class TypeScript integration and enables clean patterns for organizing, extracting and reusing complex logic.
5050

5151
- Comprehensive tooling support ensures a smooth development experience as the application grows.
5252

53-
- Lower barrier of entry and excellent documentation translate to lower onboarding and training cost for new developers.
53+
- Lower barrier to entry and excellent documentation translate to lower onboarding and training costs for new developers.
5454

5555
## How do I contribute to Vue?
5656

@@ -72,7 +72,7 @@ While Vue itself is implemented in TypeScript and provides first-class TypeScrip
7272

7373
TypeScript support is an important consideration when new features are added to Vue. APIs that are designed with TypeScript in mind are typically easier for IDEs and linters to understand, even if you aren't using TypeScript yourself. Everybody wins. Vue APIs are also designed to work the same way in both JavaScript and TypeScript as much as possible.
7474

75-
Adopting TypeScript involves a trade-off between onboarding complexity and long term maintainability gains. Whether such a trade-off can be justified can vary depending on your team's background and project scale, but Vue isn't really an influencing factor in making that decision.
75+
Adopting TypeScript involves a trade-off between onboarding complexity and long-term maintainability gains. Whether such a trade-off can be justified can vary depending on your team's background and project scale, but Vue isn't really an influencing factor in making that decision.
7676

7777
## How does Vue compare to Web Components?
7878

src/guide/advanced/ways-of-using-vue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ways of Using Vue
22

3-
We believe there is no "one size fit all" story for the web. This is why Vue is designed to be flexible and incrementally adoptable. Depending on your use case, Vue can be used in different ways to strike the optimal balance between stack complexity, developer experience and end performance.
3+
We believe there is no "one size fits all" story for the web. This is why Vue is designed to be flexible and incrementally adoptable. Depending on your use case, Vue can be used in different ways to strike the optimal balance between stack complexity, developer experience and end performance.
44

55
## Standalone Script
66

@@ -14,7 +14,7 @@ You can use Vue to [build standard Web Components](/guide/advanced/web-component
1414

1515
## Single-Page Application (SPA)
1616

17-
Some applications require rich interactivity and non-trivial stateful logic on the frontend. The best way to build such applications is to use an architecture where Vue not only controls the entire page, but also handles data updates and navigations without having to reload the page. This type of applications are typically referred to as Single-Page Applications (SPAs).
17+
Some applications require rich interactivity and non-trivial stateful logic on the frontend. The best way to build such applications is to use an architecture where Vue not only controls the entire page, but also handles data updates and navigations without having to reload the page. This type of application is typically referred to as a Single-Page Application (SPA).
1818

1919
Vue provides core libraries and [comprehensive tooling support](/guide/scaling-up/tooling) with amazing developer experience for building modern SPAs, including:
2020

src/guide/advanced/web-components.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Events emitted via `this.$emit` or setup `emit` are dispatched as native [Custom
155155

156156
#### Slots
157157

158-
Inside the component, slots can be rendered using the `<slot/>` element as usual. However when consuming the resulting element, it only accepts [native slots syntax](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_templates_and_slots):
158+
Inside the component, slots can be rendered using the `<slot/>` element as usual. However, when consuming the resulting element, it only accepts [native slots syntax](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_templates_and_slots):
159159

160160
- [Scoped slots](/guide/components/slots.html#scoped-slots) are not supported.
161161

@@ -173,7 +173,7 @@ The [Provide / Inject API](/guide/components/provide-inject.html#provide-inject)
173173

174174
### SFC as Custom Element
175175

176-
`defineCustomElement` also works with Vue Single File Components (SFCs). However, with the default tooling setup, the `<style>` inside the SFCs will still be extracted and merged into a single CSS file during production build. When using an SFC as a custom element, it is often desirable to inject the `<style>` tags into the custom element's shadow root instead.
176+
`defineCustomElement` also works with Vue Single-File Components (SFCs). However, with the default tooling setup, the `<style>` inside the SFCs will still be extracted and merged into a single CSS file during production build. When using an SFC as a custom element, it is often desirable to inject the `<style>` tags into the custom element's shadow root instead.
177177

178178
The official SFC toolings support importing SFCs in "custom element mode" (requires `@vitejs/plugin-vue@^1.4.0` or `vue-loader@^16.5.0`). An SFC loaded in custom element mode inlines its `<style>` tags as strings of CSS and exposes them under the component's `styles` option. This will be picked up by `defineCustomElement` and injected into the element's shadow root when instantiated.
179179

@@ -217,8 +217,8 @@ const MyBar = defineCustomElement(Bar)
217217
export { MyFoo, MyBar }
218218

219219
export function register() {
220-
customElements.register('my-foo', MyFoo)
221-
customElements.register('my-bar', MyBar)
220+
customElements.define('my-foo', MyFoo)
221+
customElements.define('my-bar', MyBar)
222222
}
223223
```
224224

src/guide/essentials/application.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const app = createApp({
1616

1717
The object we are passing into `createApp` is in fact a component. Every app requires a "root component" that can contain other components as its children.
1818

19-
If you are using Single File Components, we typically import the root component from another file:
19+
If you are using Single-File Components, we typically import the root component from another file:
2020

2121
```js
2222
import { createApp } from 'vue'
@@ -140,4 +140,4 @@ const app2 = createApp({ /* ... */ })
140140
app2.mount('#container-2')
141141
```
142142

143-
If you are using Vue to enhance server-rendered HTML and only need Vue to control specific parts of a large page, avoid mounting a singe Vue app instance on the entire page. Instead, create multiple small app instances and mount them on the elements they are responsible for.
143+
If you are using Vue to enhance server-rendered HTML and only need Vue to control specific parts of a large page, avoid mounting a singe Vue app instance on the entire page. Instead, create multiple small app instances and mount them on the elements they are responsible for.

src/guide/essentials/class-and-style.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ When `isActive` is truthy, the rendered HTML will be:
220220
<p class="foo bar active">Hi</p>
221221
```
222222

223-
If your component has multiple root elements, you would need to define which component will receive this class. You can do this using `$attrs` component property:
223+
If your component has multiple root elements, you would need to define which element will receive this class. You can do this using the `$attrs` component property:
224224

225225
```vue-html
226226
<!-- my-component template using $attrs -->

src/guide/essentials/component-basics.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Vue implements its own component model, but also plays nicely with native Web Co
88

99
## Defining a Component
1010

11-
When using a build step, we typically define each Vue component in a dedicated file using the `.vue` extension - known as a [Single File Component](/guide/scaling-up/sfc.html) (SFC for short):
11+
When using a build step, we typically define each Vue component in a dedicated file using the `.vue` extension - known as a [Single-File Component](/guide/scaling-up/sfc.html) (SFC for short):
1212

1313
<div class="options-api">
1414

@@ -414,7 +414,7 @@ defineEmits(['enlarge-text'])
414414

415415
</div>
416416

417-
This documents all the events that a component emits and optionally [validate them](/guide/components/events.html#validate-emitted-events). It also allows Vue to avoid implicitly applying them as native listeners to the child component's root element.
417+
This documents all the events that a component emits and optionally [validates them](/guide/components/events.html#validate-emitted-events). It also allows Vue to avoid implicitly applying them as native listeners to the child component's root element.
418418

419419
<div class="composition-api">
420420

@@ -509,15 +509,15 @@ The above is made possible by Vue's `<component>` element with the special `is`
509509
<div class="options-api">
510510

511511
```vue-html
512-
<!-- Component changes when currentTabComponent changes -->
512+
<!-- Component changes when currentTab changes -->
513513
<component :is="currentTab"></component>
514514
```
515515

516516
</div>
517517
<div class="composition-api">
518518

519519
```vue-html
520-
<!-- Component changes when currentTabComponent changes -->
520+
<!-- Component changes when currentTab changes -->
521521
<component :is="tabs[currentTab]"></component>
522522
```
523523

@@ -539,7 +539,7 @@ If you are writing your Vue templates directly in the DOM, Vue will have to retr
539539
:::tip
540540
It should be noted that the limitations discussed below only apply if you are writing your templates directly in the DOM. They do NOT apply if you are using string templates from the following sources:
541541

542-
- Single File Components
542+
- Single-File Components
543543
- Inlined template strings (e.g. `template: '...'`)
544544
- `<script type="text/x-template">`
545545
:::

src/guide/essentials/computed.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default {
8585

8686
Here we have declared a computed property `publishedBooksMessage`.
8787

88-
Try to change the value of `books` array in the application `data` and you will see how `publishedBooksMessage` is changing accordingly.
88+
Try to change the value of the `books` array in the application `data` and you will see how `publishedBooksMessage` is changing accordingly.
8989

9090
You can data-bind to computed properties in templates just like a normal property. Vue is aware that `this.publishedBooksMessage` depends on `this.author.books`, so it will update any bindings that depend on `vm.publishedBooksMessage` when `this.author.books` changes.
9191

@@ -120,7 +120,7 @@ const publishedBooksMessage = computed(() => {
120120

121121
[Try it in the Playground](https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHNjcmlwdCBzZXR1cD5cbmltcG9ydCB7IHJlYWN0aXZlLCBjb21wdXRlZCB9IGZyb20gJ3Z1ZSdcblxuY29uc3QgYXV0aG9yID0gcmVhY3RpdmUoe1xuICBuYW1lOiAnSm9obiBEb2UnLFxuICBib29rczogW1xuICAgICdWdWUgMiAtIEFkdmFuY2VkIEd1aWRlJyxcbiAgICAnVnVlIDMgLSBCYXNpYyBHdWlkZScsXG4gICAgJ1Z1ZSA0IC0gVGhlIE15c3RlcnknXG4gIF1cbn0pXG5cbi8vIGEgY29tcHV0ZWQgcmVmXG5jb25zdCBwdWJsaXNoZWRCb29rc01lc3NhZ2UgPSBjb21wdXRlZCgoKSA9PiB7XG4gIHJldHVybiBhdXRob3IuYm9va3MubGVuZ3RoID4gMCA/ICdZZXMnIDogJ05vJ1xufSlcbjwvc2NyaXB0PlxuXG48dGVtcGxhdGU+XG4gIDxwPkhhcyBwdWJsaXNoZWQgYm9va3M6PC9wPlxuICA8c3Bhbj57eyBwdWJsaXNoZWRCb29rc01lc3NhZ2UgfX08L3NwYW4+XG48L3RlbXBsYXRlPiIsImltcG9ydC1tYXAuanNvbiI6IntcbiAgXCJpbXBvcnRzXCI6IHtcbiAgICBcInZ1ZVwiOiBcImh0dHBzOi8vc2ZjLnZ1ZWpzLm9yZy92dWUucnVudGltZS5lc20tYnJvd3Nlci5qc1wiXG4gIH1cbn0ifQ==)
122122

123-
Here we have declared a computed property `publishedBooksMessage`. The `computed()` method expects a getter function, and returned value is a **computed ref**. Similar to normal refs, you can access the computed result as `publishedBooksMessage.value`. Computed refs are also auto-unwrapped in templates so you can reference them without `.value` in template expressions.
123+
Here we have declared a computed property `publishedBooksMessage`. The `computed()` function expects to be passed a getter function, and the returned value is a **computed ref**. Similar to normal refs, you can access the computed result as `publishedBooksMessage.value`. Computed refs are also auto-unwrapped in templates so you can reference them without `.value` in template expressions.
124124

125125
A computed property automatically tracks its reactive dependencies. Vue is aware that the computation of `publishedBooksMessage` depends on `author.books`, so it will update any bindings that depend on `publishedBooksMessage` when `author.books` changes.
126126

@@ -220,7 +220,7 @@ count.value++
220220

221221
## Writable Computed
222222

223-
Computed properties are by default getter-only. When you attempt to mutate a computed property, you will receive a runtime warning. In the rare cases where you need a "writable" computed property, you can create one by providing both a getter and a setter:
223+
Computed properties are by default getter-only. If you attempt to assign a new value to a computed property, you will receive a runtime warning. In the rare cases where you need a "writable" computed property, you can create one by providing both a getter and a setter:
224224

225225
<div class="options-api">
226226

@@ -283,7 +283,7 @@ Now when you run `fullName.value = 'John Doe'`, the setter will be invoked and `
283283

284284
### Getters should be side-effect free
285285

286-
It is important to remember that computed getter functions should only perform pure computation and be free of side effects. For example, don't make async requests or mutate the DOM inside a computed getter! Think of a computed property has declaratively describing how to derive a value based on other values - its only resposnibility should be computing and returning that value. Later in the guide we will discuss how we can perform side effects in reaction to state changes with [watchers](./watchers).
286+
It is important to remember that computed getter functions should only perform pure computation and be free of side effects. For example, don't make async requests or mutate the DOM inside a computed getter! Think of a computed property as declaratively describing how to derive a value based on other values - its only responsibility should be computing and returning that value. Later in the guide we will discuss how we can perform side effects in reaction to state changes with [watchers](./watchers).
287287

288288
### Avoid mutating computed value
289289

src/guide/essentials/event-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ methods: {
8989
</div>
9090

9191
```vue-html
92-
<!-- `greet` is the name of a method defined below -->
92+
<!-- `greet` is the name of the method defined above -->
9393
<button @click="greet">Greet</button>
9494
```
9595

0 commit comments

Comments
 (0)