From 91a46eda49d3925f69a4761d02f408d07656afd4 Mon Sep 17 00:00:00 2001 From: 38elements <38elements@users.noreply.github.com> Date: Sat, 12 May 2018 00:08:40 +0900 Subject: [PATCH 01/53] Update unit-testing-vue-components.md (#1623) --- src/v2/cookbook/unit-testing-vue-components.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/v2/cookbook/unit-testing-vue-components.md b/src/v2/cookbook/unit-testing-vue-components.md index 95bea7fb02..b4bee60785 100644 --- a/src/v2/cookbook/unit-testing-vue-components.md +++ b/src/v2/cookbook/unit-testing-vue-components.md @@ -44,11 +44,11 @@ export default { ``` ```js -import { shallow } from '@vue/test-utils' +import { shallowMount } from '@vue/test-utils' test('Foo', () => { // render the component - const wrapper = shallow(Hello) + const wrapper = shallowMount(Hello) // should not allow for `username` less than 7 characters, excludes whitespace wrapper.setData({ username: ' '.repeat(7) }) @@ -145,11 +145,11 @@ The things that we should test are: And our first attempt at test: ```js -import { shallow } from '@vue/test-utils' +import { shallowMount } from '@vue/test-utils' describe('Foo', () => { it('renders a message and responds correctly to user input', () => { - const wrapper = shallow(Foo, { + const wrapper = shallowMount(Foo, { data: { message: 'Hello World', username: '' @@ -183,11 +183,11 @@ The below example improves the test by: *Updated test*: ```js -import { shallow } from '@vue/test-utils' +import { shallowMount } from '@vue/test-utils' import Foo from './Foo' const factory = (values = {}) => { - return shallow(Foo, { + return shallowMount(Foo, { data: { ...values } }) } @@ -221,7 +221,7 @@ describe('Foo', () => { Points to note: -At the top, we declare the factory function which merges the `values` object into `data` and returns a new `wrapper` instance. This way, we don't need to duplicate `const wrapper = shallow(Foo)` in every test. Another great benefit to this is when more complex components with a method or computed property you might want to mock or stub in every test, you only need to declare it once. +At the top, we declare the factory function which merges the `values` object into `data` and returns a new `wrapper` instance. This way, we don't need to duplicate `const wrapper = shallowMount(Foo)` in every test. Another great benefit to this is when more complex components with a method or computed property you might want to mock or stub in every test, you only need to declare it once. ## Additional Context From 20e461a7a32dd7e3bbc2a0d7b6ce45c250fe90f6 Mon Sep 17 00:00:00 2001 From: Abdelrahman Aly Abounegm Date: Mon, 14 May 2018 00:30:02 +0200 Subject: [PATCH 02/53] Fixed a typo (#1625) Removed an extra 's' to fix a grammatical mistake --- src/v2/guide/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2/guide/installation.md b/src/v2/guide/installation.md index 6f7ee3b2c1..d2646b9c19 100644 --- a/src/v2/guide/installation.md +++ b/src/v2/guide/installation.md @@ -75,7 +75,7 @@ In the [`dist/` directory of the NPM package](https://cdn.jsdelivr.net/npm/vue/d ### Terms -- **Full**: builds that contains both the compiler and the runtime. +- **Full**: builds that contain both the compiler and the runtime. - **Compiler**: code that is responsible for compiling template strings into JavaScript render functions. From aa3a92e874efb616c73beeab410489f2b8941425 Mon Sep 17 00:00:00 2001 From: Daichi Ishikawa Date: Mon, 14 May 2018 13:26:00 +0900 Subject: [PATCH 03/53] fix a typo (#1627) --- src/v2/cookbook/avoiding-memory-leaks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v2/cookbook/avoiding-memory-leaks.md b/src/v2/cookbook/avoiding-memory-leaks.md index 2582c67cdb..d62e0732d9 100644 --- a/src/v2/cookbook/avoiding-memory-leaks.md +++ b/src/v2/cookbook/avoiding-memory-leaks.md @@ -5,7 +5,7 @@ order: 10 --- ## Introduction -If you are developing applications with Vue, then you need to watch out for memory leaks. This issue is especially important in Single Page Applications (SPAs) because by design, users should not have to refresh their browser when using an SPA, so it is up to the Javascript application to clean up components and make sure that garbage collection takes place as expected. +If you are developing applications with Vue, then you need to watch out for memory leaks. This issue is especially important in Single Page Applications (SPAs) because by design, users should not have to refresh their browser when using an SPA, so it is up to the JavaScript application to clean up components and make sure that garbage collection takes place as expected. Memory leaks in Vue applications do not typically come from Vue itself, rather they can happen when incorporating other libraries into an application. @@ -166,4 +166,4 @@ deactivated: function () { ## Wrapping Up -Vue makes it very easy to develop amazing, reactive Javascript applications, but you still need to be careful about memory leaks. These leaks will often occur when using additional 3rd Party libraries that manipulate the DOM outside of Vue. Make sure to test your application for memory leaks and take appropriate steps to clean up components where necessary. \ No newline at end of file +Vue makes it very easy to develop amazing, reactive JavaScript applications, but you still need to be careful about memory leaks. These leaks will often occur when using additional 3rd Party libraries that manipulate the DOM outside of Vue. Make sure to test your application for memory leaks and take appropriate steps to clean up components where necessary. \ No newline at end of file From 1bf46284f880e29876a2e6ade506287b4ef4e171 Mon Sep 17 00:00:00 2001 From: Robert Komaromi Date: Mon, 14 May 2018 18:31:38 -0400 Subject: [PATCH 04/53] Update v-for list example (#1628) * Add presentation role to style-only li item --- src/v2/guide/list.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2/guide/list.md b/src/v2/guide/list.md index 60acc81328..c30817fabb 100644 --- a/src/v2/guide/list.md +++ b/src/v2/guide/list.md @@ -432,7 +432,7 @@ Similar to template `v-if`, you can also use a `