Skip to content

Commit

Permalink
docs(README): Update migration list
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Jan 18, 2018
1 parent cc61e2a commit 73a377c
Showing 1 changed file with 58 additions and 7 deletions.
65 changes: 58 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,57 @@ Ensure you have a backup of your source code or commit the latest changes before
Available upgrades
- 0.12.x → 0.13.x

### Migrate 0.12 to 0.13
## Migrations

Run `almin-migration-tools`
### 0.13.x → 0.15.x

#### How to migrate?

Run following command and select `0.13.x → 0.15.x`

```
$ almin-migration-tools
```

#### What is changed?

`ChangedPayload` has been removed.

- [Almin 0.15.0 · Issue #287 · almin/almin](https://github.com/almin/almin/issues/287 "Almin 0.15.0 · Issue #287 · almin/almin")

```js
import { UseCase, ChangedPayload } from "almin";

export class ExampleUseCase extends UseCase {
execute() {
this.context.useCase(new ChangedPayload()).execute();
}
}
```

to

```js
import { UseCase } from "almin";

export class ExampleUseCase extends UseCase {
execute() {
this.context.useCase({ type: "ChangedPayload" }).execute();
}
}
```

### 0.12.x → 0.13.x

#### How to migrate?

Run following command and select `0.12.x → 0.13.x`

```
$ almin-migration-tools
```

#### What is changed?

- Renaming: `context.on*` to `context.events.on*` without `context.onChange`
- `Context.onChange` is still on `Context` prototype.
Expand All @@ -51,13 +99,15 @@ context.events.onCompleteEachUseCase((payload, meta) => {});
context.events.onErrorDispatch((payload, meta) => {});
```

### Migrate 0.11 to 0.12
### 0.11.x → 0.12.x

#### How to migrate?

**Notes**: Sadly, this old migration script is not automated...

Please do following steps.

### Convert Store#getState scripts
##### Convert Store#getState scripts

**Target**: Store files

Expand All @@ -84,7 +134,7 @@ class MyStore extends Store {
}
```

with
to

```js
class MyStore extends Store {
Expand All @@ -97,7 +147,7 @@ class MyStore extends Store {
This script output stats as `almin-store-state-mapping.json`.
The `almin-store-state-mapping.json` is used with next script(Convert StoreGroup constructor).

### Convert StoreGroup constructor
##### Convert StoreGroup constructor

**Target**: StoreGroup file

Expand Down Expand Up @@ -130,11 +180,12 @@ new StoreGroup({
});
```

### Options
##### Options

- `mapping`: path to `almin-store-state-mapping.json`.
- Default: using `almin-store-state-mapping.json` in current directory.


## Changelog

See [Releases page](https://github.com/almin/migration-tools/releases).
Expand Down

0 comments on commit 73a377c

Please # to comment.