Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into working
Browse files Browse the repository at this point in the history
# Conflicts resolved:
#	README.md
#	docs/README.md
#	docs/en/SUMMARY.md
#	docs/en/api.md
#	docs/en/core-concepts.md
#	docs/en/images/flow.png
#	docs/en/images/vuex.png
#	docs/guide/README.md
#	docs/guide/getters.md
#	docs/guide/modules.md
#	docs/guide/plugins.md
#	docs/guide/state.md
#	docs/guide/testing.md
#	docs/installation.md

Signed-off-by: MachinisteWeb <bruno.lesieur@gmail.com>
  • Loading branch information
MachinisteWeb committed Oct 2, 2018
2 parents 99a6fcb + f22d472 commit 6d82dc1
Show file tree
Hide file tree
Showing 270 changed files with 29,487 additions and 8,994 deletions.
94 changes: 94 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
version: 2

defaults: &defaults
working_directory: ~/vuex
docker:
- image: circleci/node:8-browsers

jobs:
install:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-vuex-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v1-vuex-{{ .Branch }}
- v1-vuex
- run:
name: Installing Dependencies
command: yarn
- save_cache:
paths:
- ./node_modules
key: v1-vuex-{{ .Branch }}-{{ checksum "yarn.lock" }}
- persist_to_workspace:
root: ~/
paths:
- vuex

lint-types:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Linting
command: |
yarn lint --format junit --output-file test-results/eslint/results.xml
- run:
name: Testing Types
command: |
yarn test:types
- store_test_results:
path: test-results
- store_artifacts:
path: test-results

test-unit:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Running Unit Tests
command: |
yarn test:unit
test-e2e:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Running End-to-end Tests
command: |
yarn test:e2e
test-ssr:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Running Server-side Rendering Tests
command: |
yarn test:ssr
workflows:
version: 2
install-and-parallel-test:
jobs:
- install
- lint-types:
requires:
- install
- test-unit:
requires:
- install
- test-e2e:
requires:
- install
- test-ssr:
requires:
- install
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
node_modules
TODO.md
lib
docs/_book
docs/.vuepress/dist
examples/**/build.js
types/typings
types/test/*.js
Expand Down
18 changes: 0 additions & 18 deletions bower.json

This file was deleted.

5 changes: 0 additions & 5 deletions circle.yml

This file was deleted.

2 changes: 1 addition & 1 deletion dist/logger.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export interface LoggerOption<S> {
mutationTransformer?: <P extends Payload>(mutation: P) => any;
}

export default function createLogger<S>(option: LoggerOption<S>): Plugin<S>;
export default function createLogger<S>(option?: LoggerOption<S>): Plugin<S>;
1 change: 1 addition & 0 deletions docs/LANGS.md → docs-gitbook/LANGS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
* [English](en/)
* [简体中文](zh-cn/)
* [Português](pt-br/)
* [Français](fr/)
* [Русский](ru/)
* [日本語](ja/)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions docs/fr/api.md → docs-gitbook/fr/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ const store = new Vuex.Store({ ...options })
### Méthodes d'instance de `Vuex.Store`
- **`commit(type: string, payload?: any, options?: Object) | commit(mutation: Object, options?: Object)`**
- **`commit(type: string, payload?: any, options?: Object)`**
- **`commit(mutation: Object, options?: Object)`**
Acter une mutation. `options` peut avoir `root: true` ce qui permet d'acter des mutations racines dans des [modules sous espace de nom](modules.md#namespacing). [Plus de détails](mutations.md)
- **`dispatch(type : string, payload?: any, options?: Object) | dispatch(action: Object, options?: Object)`**
- **`dispatch(type: string, payload?: any, options?: Object)`**
- **`dispatch(action: Object, options?: Object)`**
Propager une action. Retourne la valeur renvoyée par le gestionnaire d'action déclenché, ou une Promesse si plusieurs gestionnaires ont été déclenchés. [Plus de détails](actions.md)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added docs-gitbook/fr/images/flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/fr/intro.md → docs-gitbook/fr/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ new Vue({

C'est une application autosuffisante avec les parties suivantes :

- L'**état**, qui est la source de vérité qui pilotant votre application,
- L'**état**, qui est la source de vérité qui pilote votre application,
- La **vue**, qui est une réflexion déclarative de l'**état**,
- Les **actions**, qui sont les façons possibles pour l'état de changer en réaction aux actions utilisateurs depuis la **vue**.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/en/testing.md → docs-gitbook/fr/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ const testAction = (action, args, state, expectedMutations, done) => {
const mutation = expectedMutations[count]

try {
expect(mutation.type).to.equal(type)
expect(type).to.equal(mutation.type)
if (payload) {
expect(mutation.payload).to.deep.equal(payload)
expect(payload).to.deep.equal(mutation.payload)
}
} catch (error) {
done(error)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions docs/ja/api.md → docs-gitbook/ja/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const store = new Vuex.Store({ ...options })
}
```

そして、第 2 引数の `payload` があれば、それを受け取ります。

[詳細](actions.md)

- **getters**
Expand Down Expand Up @@ -126,11 +128,13 @@ const store = new Vuex.Store({ ...options })
### Vuex.Store インスタンスメソッド
- **`commit(type: string, payload?: any, options?: Object) | commit(mutation: Object, options?: Object)`**
- **`commit(type: string, payload?: any, options?: Object)`**
- **`commit(mutation: Object, options?: Object)`**
ミューテーションをコミットします。`options` は[名前空間付きモジュール](modules.md#名前空間)で root なミューテーションにコミットできる `root: true` を持つことできます。[詳細](mutations.md)
- **`dispatch(type: string, payload?: any, options?: Object) | dispatch(action: Object, options?: Object)`**
- **`dispatch(type: string, payload?: any, options?: Object)`**
- **`dispatch(action: Object, options?: Object)`**
アクションをディスパッチします。`options` は[名前空間付きモジュール](modules.md#名前空間)で root なアクションにディスパッチできる `root: true` を持つことできます。 すべてのトリガーされたアクションハンドラを解決するPromiseを返します。[詳細](actions.md)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 8 additions & 1 deletion docs/ja/getters.md → docs-gitbook/ja/getters.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const store = new Vuex.Store({
})
```

ゲッターは `store.getters` オブジェクトから取り出されます:
### プロパティスタイルアクセス

ゲッターは `store.getters` オブジェクトから取り出され、プロパティとしてアクセスすることができます:

``` js
store.getters.doneTodos // -> [{ id: 1, text: '...', done: true }]
Expand Down Expand Up @@ -63,6 +65,10 @@ computed: {
}
```

プロパティとしてアクセスされるゲッターは Vue のリアクティブシステムの一部としてキャッシュされるという点に留意してください。

### メソッドスタイルアクセス

関数を返り値にすることで、ゲッターに引数を渡すこともできます。これは特にストアの中の配列を検索する時に役立ちます:
```js
getters: {
Expand All @@ -77,6 +83,7 @@ getters: {
store.getters.getTodoById(2) // -> { id: 2, text: '...', done: false }
```

メソッドによってアクセスされるゲッターは呼び出す度に実行され、その結果はキャッシュされない点に留意してください。

### `mapGetters` ヘルパー

Expand Down
File renamed without changes.
File renamed without changes.
Binary file added docs-gitbook/ja/images/flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs-gitbook/ja/images/vuex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions docs-gitbook/ja/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# インストール

### 直接ダウンロードする / CDN

[https://unpkg.com/vuex](https://unpkg.com/vuex)

<!--email_off-->
[Unpkg.com](https://unpkg.com) で NPM ベースの CDN リンクが提供されています。上記リンクは常に NPM の最新のリリースを指します。`https://unpkg.com/vuex@2.0.0` のような URL によって特定のバージョン/タグを利用することもできます。
<!--/email_off-->

Vue のあとで `vuex` を取り込むと自動的に Vuex が導入されます:

``` html
<script src="/path/to/vue.js"></script>
<script src="/path/to/vuex.js"></script>
```

### NPM

``` bash
npm install vuex --save
```

### Yarn

``` bash
yarn add vuex
```

モジュールシステムで利用される場合、 `Vue.use()` によって Vuex を明示的に導入する必要があります:

``` js
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
```

グローバルなスクリプトタグを利用する場合にはこのようにする必要はありません。

### 開発版ビルド

最新の開発版ビルドを利用したい場合には、 Github から直接クローンし `vuex` を自身でビルドする必要があります。

``` bash
git clone https://github.com/vuejs/vuex.git node_modules/vuex
cd node_modules/vuex
npm install
npm run build
```
File renamed without changes.
File renamed without changes.
17 changes: 0 additions & 17 deletions docs/ja/mutations.md → docs-gitbook/ja/mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,6 @@ mutations: {
}
```

### サイレントコミット

> 注意: この機能は開発ツール内にミューテーション・フィルタが実装された後に非推奨になる予定です。
デフォルトでは全てのコミットされたミューテーションはプラグイン(開発ツール等)に送られます。しかし場合によっては、プラグインに全ての状態の変化を記録して欲しくないこともあるでしょう。あるいは、短い間隔やポーリングでのストアへの複数のコミットも、常に追跡する必要はないでしょう。こうしたケースでは、`store.commit` に第3引数を渡すことで、特定のミューテーションをプラグインに気付かせないようにすること("silence")ができます:

``` js
store.commit('increment', {
amount: 1
}, { silent: true })

// オブジェクトスタイルのコミット
store.commit({
type: 'increment',
amount: 1
}, { silent: true })
```

### Vue のリアクティブなルールに則ったミューテーション

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/ja/state.md → docs-gitbook/ja/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ computed: mapState([

### オブジェクトスプレッド演算子

`mapState` はオブジェクトを返すことに注意しましょう。どうやって、他のローカル算出プロパティと組み合わせるのでしょうか? 通常、最終的にひとつのオブジェクトを `computed` に渡せるように、複数のオブジェクトをひとつにマージするユーティリティを使わなければいけません。しかし、[オブジェクトスプレッド演算子](https://github.com/sebmarkbage/ecmascript-rest-spread) (ECMAScript プロポーサルの state-3 です) で、シンタックスをかなり単純にできます:
`mapState` はオブジェクトを返すことに注意しましょう。どうやって、他のローカル算出プロパティと組み合わせるのでしょうか? 通常、最終的にひとつのオブジェクトを `computed` に渡せるように、複数のオブジェクトをひとつにマージするユーティリティを使わなければいけません。しかし、[オブジェクトスプレッド演算子](https://github.com/sebmarkbage/ecmascript-rest-spread) (ECMAScript プロポーサルの state-4 です) で、シンタックスをかなり単純にできます:

```js
computed: {
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/ja/testing.md → docs-gitbook/ja/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ const testAction = (action, payload, state, expectedMutations, done) => {
const mutation = expectedMutations[count]

try {
expect(mutation.type).to.equal(type)
expect(type).to.equal(mutation.type)
if (payload) {
expect(mutation.payload).to.deep.equal(payload)
expect(payload).to.deep.equal(mutation.payload)
}
} catch (error) {
done(error)
Expand Down
1 change: 1 addition & 0 deletions docs-gitbook/kr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% include "./SUMMARY.md" %}
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/kr/actions.md → docs-gitbook/kr/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ actions: {
store.dispatch('increment')
```

처음 볼 때는 이상해 보일 수 있습니다. 카운트를 증가 시키려면 `store.commit('increment')`를 직접 호출하면 어떻습니까? 음, **돌연변이는 동기적** 이어야 한다는 것을 기억하십니까? 액션은 그렇지 않습니다. 액션 내에서 **비동기** 작업을 수행 할 수 있습니다.
처음 볼 때는 이상해 보일 수 있습니다. 카운트를 증가 시키려면 `store.commit('increment')`를 직접 호출하면 어떻습니까? 음, **상태변이는 동기적** 이어야 한다는 것을 기억하십니까? 액션은 그렇지 않습니다. 액션 내에서 **비동기** 작업을 수행 할 수 있습니다.

``` js
actions: {
Expand Down
24 changes: 19 additions & 5 deletions docs/kr/api.md → docs-gitbook/kr/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ const store = new Vuex.Store({ ...options })
플러그인에서 가장 일반적으로 사용됩니다. [상세](plugins.md)
- **`registerModule(path: string | Array<string>, module: Module)`**
- **`registerModule(path: string | Array<string>, module: Module, options?: Object)`**
동적 모듈을 등록합니다. [상세](modules.md#dynamic-module-registration)
`options`은 이전 속성을 보호하는 `preserveState: true`를 가질 수 있습니다. 이것은 서버사이드 렌더링에서 유용합니다.
- **`unregisterModule(path: string | Array<string>)`**
Expand All @@ -161,18 +163,30 @@ const store = new Vuex.Store({ ...options })
### 컴포넌트 바인딩 헬퍼
- **`mapState(map: Array<string> | Object): Object`**
- **`mapState(namespace?: string, map: Array<string> | Object): Object`**
Vuex 저장소의 하위 트리를 반환하는 컴포넌트 계산 옵션을 만듭니다. [상세](state.md#the-mapstate-helper)
처음 argument는 string 타입의 namespace가 될 수 있습니다. [상세](modules.md#binding-helpers-with-namespace)
- **`mapGetters(map: Array<string> | Object): Object`**
- **`mapGetters(namespace?: string, map: Array<string> | Object): Object`**
getter의 평가된 값을 반환하는 컴포넌트 계산 옵션을 만듭니다. [상세](getters.md#the-mapgetters-helper)
처음 argument는 string 타입의 namespace가 될 수 있습니다. [상세](modules.md#binding-helpers-with-namespace)
- **`mapActions(map: Array<string> | Object): Object`**
- **`mapActions(namespace?: string, map: Array<string> | Object): Object`**
액션을 전달하는 컴포넌트 메소드 옵션을 만듭니다. [상세](actions.md#dispatching-actions-in-components)
처음 argument는 string 타입의 namespace가 될 수 있습니다. [상세](modules.md#binding-helpers-with-namespace)
- **`mapMutations(map: Array<string> | Object): Object`**
- **`mapMutations(namespace?: string, map: Array<string> | Object): Object`**
변이를 커밋하는 컴포넌트 메소드 옵션을 만듭니다. [상세](mutations.md#commiting-mutations-in-components)
처음 argument는 string 타입의 namespace가 될 수 있습니다. [상세](modules.md#binding-helpers-with-namespace)
- **`createNamespacedHelpers(namespace: string): Object`**
namespace가 적용된 컴포넌트 바인딩 helper를 만듭니다. 주어진 namespace가 적용된 `mapState`, `mapGetters`, `mapActions` `mapMutations`들을 가지고 있는 오브젝트를 반환합니다. [상세](modules.md#binding-helpers-with-namespace)
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/kr/getters.md → docs-gitbook/kr/getters.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import { mapGetters } from 'vuex'
export default {
// ...
computed: {
// getter를 객체 전파 연산자로 계산하여 추가합니다.
// getter를 객체 전개 연산자(Object Spread Operator)로 계산하여 추가합니다.
...mapGetters([
'doneTodosCount',
'anotherGetter',
Expand Down
File renamed without changes.
File renamed without changes.
Binary file added docs-gitbook/kr/images/flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs-gitbook/kr/images/vuex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6d82dc1

Please sign in to comment.