Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Version #1

Merged
merged 68 commits into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
c490bc9
chore(ISSUE_TEMPLATE): Comment out OpenCollective donation link (#210)
MikeRyanDev Jul 28, 2017
9bdfd70
feat(Platform): Introduce @ngrx/entity (#207)
MikeRyanDev Jul 28, 2017
1df963c
chore(docs): Added migration docs for router-store and testing store
brandonroberts Aug 1, 2017
c79853b
build: fix type def files search path (#225)
juristr Aug 1, 2017
e2f1e57
fix(createSelector): memoize projector function (#228)
03byron Aug 2, 2017
2c006e8
fix(RouterStore): Add support for cancellation with CanLoad guard (#223)
brandonroberts Aug 2, 2017
98c89c4
v4.0.2
MikeRyanDev Aug 2, 2017
f969676
docs(CHANGELOG): Update Changelog for 4.0.2
MikeRyanDev Aug 2, 2017
065d33e
fix(Effects): Ensure StoreModule is loaded before effects (#230)
brandonroberts Aug 3, 2017
2b1a076
fix(Effects): Export EffectsNotification interface (#231)
brandonroberts Aug 3, 2017
4aec80c
fix(Store): Set initial state for feature modules (#235)
brandonroberts Aug 4, 2017
7d23fdb
chore(docs): Update store README text (#238)
tiangolo Aug 6, 2017
84390a1
chore(Example): Fix E2E test setup (#242)
sharikovvladislav Aug 7, 2017
a4609e5
chore(docs): Fix spyOn arguments example (#249)
sharikovvladislav Aug 8, 2017
0fc1bcc
feat(RouterStore): Add serializer for router state snapshot (#188)
brandonroberts Aug 9, 2017
c409252
fix(Store): Use existing reducers when providing reducers without an …
brandonroberts Aug 9, 2017
bd968fa
fix(Store): Use injector to get reducers provided via InjectionTokens…
brandonroberts Aug 10, 2017
683013c
fix(Store): Update usage of compose for reducer factory (#252)
rjokelai Aug 11, 2017
ca544dd
chore(docs): Fix selection of state using string selector (#261)
jdjuan Aug 11, 2017
1cbb2c9
fix(Effects): Deprecate toPayload utility function (#266)
karptonite Aug 13, 2017
657a2e3
docs(templates): fix typo in issue template (#262)
BrainCrumbz Aug 13, 2017
9e33a5d
docs(Migration): Fix typo in Router Store migration example
PierreRochard Aug 13, 2017
57633d2
fix(Store): Add type signature for metareducer (#270)
brandonroberts Aug 15, 2017
71690fb
chore(docs): Fix typo in router store readme (#271)
wmaurer Aug 15, 2017
dff9509
Revert "fix(Store): Update usage of compose for reducer factory (#252…
brandonroberts Aug 16, 2017
02d6ad1
v4.0.3
MikeRyanDev Aug 16, 2017
b42ba97
docs(Changelog): Point changelog to individual package changelogs (#282)
brandonroberts Aug 16, 2017
090462a
docs: Add more information on contributing and API docs (#283)
brandonroberts Aug 17, 2017
78772b5
chore(docs): Add missing Store import (#285)
sharikovvladislav Aug 17, 2017
bbb7c99
fix(RouterStore): Only serialize snapshot in preactivation hook (#287)
brandonroberts Aug 17, 2017
bf7f70c
fix(Effects): Use factory provide for console (#288)
brandonroberts Aug 17, 2017
6da3ec5
fix(RouterStore): Add generic type to RouterReducerState (#292)
brandonroberts Aug 17, 2017
bec84a8
build: Add Release command for tagging builds
MikeRyanDev Aug 17, 2017
bdae25f
v4.0.4
MikeRyanDev Aug 17, 2017
335d255
fix(Entity): Simplify target index finder for sorted entities
MikeRyanDev Aug 18, 2017
fbd6a66
fix(Entity): Return a referentially equal state if state did not change
MikeRyanDev Aug 18, 2017
aa7172a
fix(Entity): Misc fixes for reference checks and sorting
brandonroberts Aug 18, 2017
bfdd462
docs(Store): Fix type for metareducers array (#296)
BrainCrumbz Aug 18, 2017
d3a3ae7
chore(docs): Fix missing back/forward imports for router-store migrat…
sharikovvladislav Aug 18, 2017
54747cf
fix(Effects): Do not complete effects if one source errors or complet…
MikeRyanDev Aug 18, 2017
ffa9694
v4.0.5
MikeRyanDev Aug 18, 2017
d20ebf1
chore(docs): Fix contributors link in readme (#299)
sharikovvladislav Aug 18, 2017
56cb21f
feat(createSelector): Expose projector function on selectors to impro…
03byron Aug 20, 2017
bf14d67
chore(precommit): Fix precommit hook to git add after changing files …
krjordan Aug 24, 2017
ae7d5e1
fix(combineSelectors): Remove default parameter from function signatu…
ukrukarg Aug 24, 2017
e4133a4
docs(api): Fix imports typo to show imports from correct package (#322)
krjordan Aug 25, 2017
ebf9cf4
docs(Migration): Add payload interface options to migration docs (#326)
brandonroberts Aug 25, 2017
b8ebe2e
chore(Example): rename Actions to be consistent (#330)
timdeschryver Aug 28, 2017
257fc9d
fix(Build): Fix build with space in path (#331)
timdeschryver Aug 28, 2017
b85062f
docs(example-app): Update example-app url (#336)
krjordan Aug 30, 2017
618bdf3
chore(docs): Add header for "usage" in router-store readme (#337)
konrad-garus Sep 1, 2017
870a73d
chore(docs): Fix import for EffectNotification (#339)
brandonroberts Sep 1, 2017
a82f675
chore(docs): Add meta reducers injection in the Store docs (#341)
laurentgoudet Sep 1, 2017
2f6a035
feat(Store): createSelector with an array of selectors (#340)
timdeschryver Sep 2, 2017
28e1983
docs(RouterStore): Fix type signature of ROUTER_NAVIGATION action (#344)
dherges Sep 5, 2017
920c0ba
fix(RouterStore): Fix cancelled navigation with async guard (fixes #3…
kondi Sep 7, 2017
127ccc9
chore(Example): Added ngrx-store-freeze meta-reducer to example appli…
brandonroberts Sep 7, 2017
81afd0d
chore(docs): Fix action interface example (#360)
emilabraham Sep 7, 2017
0528d2d
fix(RouterStore): Stringify error from navigation error event (#357)
brandonroberts Sep 9, 2017
0f00779
chore(Example): Documented @ngrx/entity and added to example app (#328)
brandonroberts Sep 9, 2017
47f4ca8
docs(entity): Fix typo in url (#365)
tunecino Sep 9, 2017
669b2f4
chore(docs): Update @ngrx/entity documentation examples and usage (#369)
brandonroberts Sep 11, 2017
38b2f95
fix(Store): Fix typing for feature to accept InjectionToken (#375)
Szpadel Sep 12, 2017
a07c05e
chore(docs): Change providing injected reducers by factory instead of…
Szpadel Sep 13, 2017
9e1375d
chore(docs): Minor fixes to entity interfaces documentation (#390)
buge Sep 14, 2017
274554b
feat(Entity): Rename 'sort' to 'sortComparer'
karptonite Sep 16, 2017
5c60cba
fix(Store): Refactor parameter initialization in combineReducers for …
ukrukarg Sep 16, 2017
c31573f
chore(Example): Add Jest as test runner for example tests (#371)
brandonroberts Sep 16, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- ❤️ ngrx? Please consider supporting our collective: 👉 [donate](https://opencollective.com/ngrx/donate) -->

## I'm submitting a...
<!-- Check one of the following options with "x" -->
Expand All @@ -6,11 +7,10 @@
[ ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
</code></pre>

## What is the current behavior?
<!-- Describe what the current behavior would is. -->
<!-- Describe the current behavior. -->

## Expected behavior:
<!-- Describe what the desired behavior would be. -->
Expand All @@ -27,5 +27,3 @@ http://plnkr.co/edit/tpl:757r6L
## Other information:



:heartpulse: ngrx? Please consider supporting our collective: 👉 [donate](https://opencollective.com/ngrx/donate)
115 changes: 5 additions & 110 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,111 +1,6 @@
<a name="4.0.0"></a>
# [4.0.0](https://github.com/ngrx/platform/compare/v4.0.1...v4.0.0) (2017-07-22)


### Bug Fixes

* **docs:** update angular-cli variable ([eeb7d5d](https://github.com/ngrx/platform/commit/eeb7d5d))
* **Effects:** Wrap testing source in an Actions observable (#121) ([bfdb83b](https://github.com/ngrx/platform/commit/bfdb83b)), closes [#117](https://github.com/ngrx/platform/issues/117)
* **Store:** Remove auto-memoization of selector functions ([90899f7](https://github.com/ngrx/platform/commit/90899f7)), closes [#118](https://github.com/ngrx/platform/issues/118)


### Features

* **Effects:** Add generic type to the "ofType" operator ([55c13b2](https://github.com/ngrx/platform/commit/55c13b2))
* **Store:** Added initial state function support for features. Added more tests (#85) ([5e5d7dd](https://github.com/ngrx/platform/commit/5e5d7dd))



<a name="4.0.1"></a>
## [4.0.1](https://github.com/ngrx/platform/compare/v4.0.0...v4.0.1) (2017-07-18)


### Bug Fixes

* **effects:** allow downleveled annotations (#98) ([875b326](https://github.com/ngrx/platform/commit/875b326)), closes [#93](https://github.com/ngrx/platform/issues/93)
* **effects:** make correct export path for testing module (#96) ([a5aad22](https://github.com/ngrx/platform/commit/a5aad22)), closes [#94](https://github.com/ngrx/platform/issues/94)



<a name="4.0.0"></a>
# [4.0.0](https://github.com/ngrx/platform/compare/68bd9df...v4.0.0) (2017-07-18)


### Bug Fixes

* **build:** Fixed deployment of latest master as commit (#18) ([5d0ecf9](https://github.com/ngrx/platform/commit/5d0ecf9)), closes [#18](https://github.com/ngrx/platform/issues/18)
* **build:** Get tests running for each project ([c4a1054](https://github.com/ngrx/platform/commit/c4a1054))
* **build:** Limit concurrency for lerna bootstrap ([7e7a7d8](https://github.com/ngrx/platform/commit/7e7a7d8))
* **Devtools:** Removed SHOULD_INSTRUMENT token used to eagerly inject providers (#57) ([b90df34](https://github.com/ngrx/platform/commit/b90df34))
* **Effects:** Start child effects after running root effects (#43) ([931adb1](https://github.com/ngrx/platform/commit/931adb1))
* **Effects:** Use Actions generic type for the return of the ofType operator ([d176a11](https://github.com/ngrx/platform/commit/d176a11))
* **Example:** Fix Book State interface parent (#90) ([6982952](https://github.com/ngrx/platform/commit/6982952)), closes [#90](https://github.com/ngrx/platform/issues/90)
* **example-app:** Suppress StoreDevtoolsConfig compiler warning ([8804156](https://github.com/ngrx/platform/commit/8804156))
* **omit:** Strengthen the type checking of the omit utility function ([3982038](https://github.com/ngrx/platform/commit/3982038))
* **router-store:** NavigationCancel and NavigationError creates a cycle when used with routerReducer ([a085730](https://github.com/ngrx/platform/commit/a085730)), closes [#68](https://github.com/ngrx/platform/issues/68)
* **Store:** Exported initial state tokens (#65) ([4b27b6d](https://github.com/ngrx/platform/commit/4b27b6d))
* **Store:** pass all required arguments to projector (#74) ([9b82b3a](https://github.com/ngrx/platform/commit/9b82b3a))
* **Store:** Remove parameter destructuring for strict mode (#33) (#77) ([c9d6a45](https://github.com/ngrx/platform/commit/c9d6a45))
* **Store:** Removed readonly from type (#72) ([68274c9](https://github.com/ngrx/platform/commit/68274c9))
* **StoreDevtools:** Type InjectionToken for AOT compilation ([e21d688](https://github.com/ngrx/platform/commit/e21d688))


### Code Refactoring

* **Effects:** Simplified AP, added better error reporting and effects stream control ([015107f](https://github.com/ngrx/platform/commit/015107f))


### Features

* **build:** Updated build pipeline for modules ([68bd9df](https://github.com/ngrx/platform/commit/68bd9df))
* **Effects:** Ensure effects are only subscribed to once ([089abdc](https://github.com/ngrx/platform/commit/089abdc))
* **Effects:** Introduce new Effects testing module (#70) ([7dbb571](https://github.com/ngrx/platform/commit/7dbb571))
* **router-store:** Added action types (#47) ([1f67cb3](https://github.com/ngrx/platform/commit/1f67cb3)), closes [#44](https://github.com/ngrx/platform/issues/44)
* **store:** Add 'createSelector' and 'createFeatureSelector' utils (#10) ([41758b1](https://github.com/ngrx/platform/commit/41758b1))
* **Store:** Allow initial state function for AoT compatibility (#59) ([1a166ec](https://github.com/ngrx/platform/commit/1a166ec)), closes [#51](https://github.com/ngrx/platform/issues/51)
* **Store:** Allow parent modules to provide reducers with tokens (#36) ([069b12f](https://github.com/ngrx/platform/commit/069b12f)), closes [#34](https://github.com/ngrx/platform/issues/34)
* **Store:** Simplify API for adding meta-reducers (#87) ([d2295c7](https://github.com/ngrx/platform/commit/d2295c7))


### BREAKING CHANGES

* **Effects:** Effects API for registering effects has been updated to allow for multiple classes to be provided.

BEFORE:
```ts
@NgModule({
imports: [
EffectsModule.run(SourceA),
EffectsModule.run(SourceB)
]
})
export class AppModule { }
```

AFTER:
```ts
@NgModule({
imports: [
EffectsModule.forRoot([
SourceA,
SourceB,
SourceC,
])
]
})
export class AppModule { }

@NgModule({
imports: [
EffectsModule.forFeature([
FeatureSourceA,
FeatureSourceB,
FeatureSourceC,
])
]
})
export class SomeFeatureModule { }
```


# Changelogs

- [@ngrx/store](./modules/store/CHANGELOG.md)
- [@ngrx/effects](./modules/effects/CHANGELOG.md)
- [@ngrx/router-store](./modules/router-store/CHANGELOG.md)
- [@ngrx/store-devtools](./modules/store-devtools/CHANGELOG.md)
28 changes: 24 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,46 @@
npm install
```

OR
```
yarn
```

### Testing

```
npm test
```

OR

```
yarn test
```

## Submitting Pull Requests

**Please follow these basic steps to simplify pull request reviews - if you don't you'll probably just be asked to anyway.**

* Please rebase your branch against the current master
* Run ```npm install``` to make sure your development dependencies are up-to-date
* Run the `Setup` command to make sure your development dependencies are up-to-date
* Please ensure the test suite passes before submitting a PR
* If you've added new functionality, **please** include tests which validate its behavior
* Make reference to possible [issues](https://github.com/ngrx/platform/issues) on PR comment

## Submitting bug reports

* Please detail the affected browser(s) and operating system(s)
* Please be sure to state which version of node **and** npm you're using
* Search through issues to see if a previous issue has already been reported and/or fixed.
* Provide a _small_ reproduction using a [plunker template](http://plnkr.co/edit/tpl:757r6L?p=preview) or github repo.
* Please detail the affected browser(s) and operating system(s).
* Please be sure to state which version of Angular, node and npm you're using.

## Submitting New features

* We value keeping the API surface small and concise, which factors into whether new features are accepted.
* Submit an issue with the prefix `RFC: ` with your feature request.
* The feature will be discussed and considered.
* Once the PR is submitted, it will be reviewed and merged once approved.


## Financial contributions
Expand Down Expand Up @@ -63,4 +83,4 @@ Thank you to all our sponsors! (please ask your company to also support this ope
<a href="https://opencollective.com/ngrx/sponsor/6/website" target="_blank"><img src="https://opencollective.com/ngrx/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/ngrx/sponsor/7/website" target="_blank"><img src="https://opencollective.com/ngrx/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/ngrx/sponsor/8/website" target="_blank"><img src="https://opencollective.com/ngrx/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/ngrx/sponsor/9/website" target="_blank"><img src="https://opencollective.com/ngrx/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/ngrx/sponsor/9/website" target="_blank"><img src="https://opencollective.com/ngrx/sponsor/9/avatar.svg"></a>
135 changes: 130 additions & 5 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ The sections below cover the changes between the ngrx projects migrating from V1
[@ngrx/router-store](#ngrxrouter-store)
[@ngrx/store-devtools](#ngrxstore-devtools)

## Dependencies

You need to have the latest versions of TypeScript and RxJS to use ngrx V4 libraries.

TypeScript 2.4.x
RxJS 5.4.x

## @ngrx/core
@ngrx/core is no longer needed, and can conflict with @ngrx/store. You should remove it from your project.

Expand All @@ -36,7 +43,9 @@ import { compose } from '@ngrx/store';

### Action interface

The `payload` property has been removed from the `Action` interface.
The `payload` property has been removed from the `Action` interface. It was a source of type-safety
issues, especially when used with `@ngrx/effects`. If your interface/class has a payload, you need to provide
the type.

BEFORE:
```ts
Expand Down Expand Up @@ -72,6 +81,22 @@ export class MyEffects {
}
```

If you prefer to keep the `payload` interface property, you can provide your own parameterized version.

```ts
export interface ActionWithPayload<T> extends Action {
payload: T;
}
```

And if you need an unsafe version to help with transition.

```ts
export interface UnsafeAction extends Action {
payload?: any;
}
```

### Registering Reducers

Previously to be AOT compatible, it was required to pass a function to the `provideStore` method to compose the reducers into one root reducer. The `initialState` was also provided to the method as an object in the second argument.
Expand Down Expand Up @@ -215,7 +240,7 @@ import * as auth from '../actions/auth.actions';

@Injectable()
export class AppEffects {

@Effect()
init$: Observable<Action> = this.actions$
.ofType(Dispatcher.INIT)
Expand All @@ -224,7 +249,7 @@ export class AppEffects {
return of(new auth.LoginAction());

});

constructor(private actions$: Actions) { }
}
```
Expand All @@ -242,14 +267,14 @@ import * as auth from '../actions/auth.actions';

@Injectable()
export class AppEffects {

@Effect()
init$: Observable<Action> = defer(() => {

return of(new auth.LoginAction());

});

constructor(private actions$: Actions) { }
}

Expand Down Expand Up @@ -336,6 +361,8 @@ describe('My Effects', () => {

## @ngrx/router-store

### Registering the module

BEFORE:

`reducers/index.ts`
Expand Down Expand Up @@ -407,6 +434,104 @@ import { reducers } from './reducers';
export class AppModule {}
```

### Navigation actions

Navigation actions are not provided as part of the V4 package. You provide your own
custom navigation actions that use the `Router` within effects to navigate.

BEFORE:

```ts
import { go, back, forward } from '@ngrx/router-store';

store.dispatch(go(['/path', { routeParam: 1 }], { page: 1 }, { replaceUrl: false }));

store.dispatch(back());

store.dispatch(forward());
```

AFTER:

```ts
import { Action } from '@ngrx/store';
import { NavigationExtras } from '@angular/router';

export const GO = '[Router] Go';
export const BACK = '[Router] Back';
export const FORWARD = '[Router] Forward';

export class Go implements Action {
readonly type = GO;

constructor(public payload: {
path: any[];
query?: object;
extras?: NavigationExtras;
}) {}
}

export class Back implements Action {
readonly type = BACK;
}

export class Forward implements Action {
readonly type = FORWARD;
}

export type Actions
= Go
| Back
| Forward;
```

```ts
import * as RouterActions from './actions/router';

store.dispatch(new RouterActions.Go({
path: ['/path', { routeParam: 1 }],
query: { page: 1 },
extras: { replaceUrl: false }
});

store.dispatch(new RouterActions.Back());

store.dispatch(new RouterActions.Forward());
```

```ts
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/map';
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { Location } from '@angular/common';
import { Effect, Actions } from '@ngrx/effects';
import * as RouterActions from './actions/router';

@Injectable()
export class RouterEffects {
@Effect({ dispatch: false })
navigate$ = this.actions$.ofType(RouterActions.GO)
.map((action: RouterActions.Go) => action.payload)
.do(({ path, query: queryParams, extras})
=> this.router.navigate(path, { queryParams, ...extras }));

@Effect({ dispatch: false })
navigateBack$ = this.actions$.ofType(RouterActions.BACK)
.do(() => this.location.back());

@Effect({ dispatch: false })
navigateForward$ = this.actions$.ofType(RouterActions.FORWARD)
.do(() => this.location.forward());

constructor(
private actions$: Actions,
private router: Router,
private location: Location
) {}
}
```

## @ngrx/store-devtools

**NOTE:** store-devtools currently causes severe performance problems when
Expand Down
Loading