Skip to content

Commit

Permalink
release 0.10.0
Browse files Browse the repository at this point in the history
Breaking change:

Removed reducers and sagas from App config which passed into the App
constructor when App is initialized.

This causes issues when migrating existing react/redux application to
use reapex. There will be circulation import issue if the existing
application has references to reapex created model

To register existing sagas and reducers, use:
app.runSaga()
app.setExternalReducers()

New feature:

Reapex by default creates action type with `/` separated strings internally.
For example: 'SomeModelName/MutationName'. When Reapex binding action types to sagas by the calling `effect(effectMap)`, it will
check if the `effectMap` key has a namespace(e.g. `SomeModelName`) and it will prefix the key with a namespace when binding sagas
if no namespace presents.  This is archived by splitting the key by `/`

However, when migrating existing react/redux application to use Reapex, the action types of existing application could be in any pattern,
for example, `.` or `_` separated, or even just a random string.

For Reapex to recognize such action types when binding actions to sagas, now it allows to pass App config like this:
```
const app = new App({
  actionTypeHasNamespace: (actionType: string) => actionType.includes('.')
})
```
  • Loading branch information
ruanyl committed Nov 9, 2019
1 parent c8a4a34 commit 0e2f6d1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# release 0.10.0

### Breaking change

Removed reducers and sagas from App config which passed into the App
constructor when App is initialized.

This causes issues when migrating existing react/redux application to
use Reapex. There will be circulation import issue if the existing
application has references to Reapex created model

To register existing sagas and reducers, use:
app.runSaga()
app.setExternalReducers()

### New feature

Reapex by default creates action type with `/` separated strings internally.
For example: 'SomeModelName/MutationName'. When Reapex binding action types to sagas by the calling `effect(effectMap)`, it will
check if the `effectMap` key has a namespace(e.g. `SomeModelName`) and it will prefix the key with a namespace when binding sagas
if no namespace presents. This is archived by splitting the key by `/`

However, when migrating existing react/redux application to use Reapex, the action types of existing application could be in any pattern,
for example, `.` or `_` separated, or even just a random string.

For Reapex to recognize such action types when binding actions to sagas, now it allows to pass App config like this:
```
const app = new App({
actionTypeHasNamespace: (actionType: string) => actionType.includes('.')
})
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reapex",
"version": "0.9.1",
"version": "0.10.0",
"description": "A framework to build React application",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down

0 comments on commit 0e2f6d1

Please sign in to comment.