PatrickJS / angular-hmr

:fire: Angular Hot Module Replacement for Hot Module Reloading
https://patrickjs.com
Apache License 2.0
505 stars 46 forks source link

Support for @ngrx 4 #59

Closed Kaffiend closed 6 years ago

Kaffiend commented 7 years ago

recommendations for migrating to ngrx 4? Currently working with the nightly builds and state is lost on reload.

xtianus79 commented 6 years ago

@Kaffiend where are you getting information for ngrx 4?

Kaffiend commented 6 years ago

@xtianus79 here

xtianus79 commented 6 years ago

@Kaffiend I guess I don't see versioning... are these for specific components such as store?

Kaffiend commented 6 years ago

The whole repo is for for 4.x.x The previous versions are still in their old repos here

xtianus79 commented 6 years ago

@Kaffiend lol i don't why this seems confusing but I don't see anything that designates itself as version 4

xtianus79 commented 6 years ago

@Kaffiend got the answer from Robert... it will be the next official release.

Kaffiend commented 6 years ago

I got the 4.x from the main readme 😄 in the migration guide section saying for versions prior to 4.x 😁

Kaffiend commented 6 years ago

@xtianus79 NGRX 4.x.x released yesterday. 😄

PatrickJS commented 6 years ago

this works with anything you just need to be able to hook into the store and inject the initial state

Kaffiend commented 6 years ago

was using an old version of hmr, and the issue was in serializing the routerStore that contained routerState which has circular structure.

dereklin commented 6 years ago

@gdi2290 or others. This is related to hmr. Do you have any idea how to hook the global state back to ngrx 4?: https://github.com/ngrx/effects/issues/82

PatrickJS commented 6 years ago

@dereklin hmr allows anyone to hook into the state right before the app is bootstrapped which means this isn't a problem of hmr so much as ngrx needa a way to inject state

dereklin commented 6 years ago

@gdi2290 right. My question was answered in the referenced github issue. Thanks for checking.

PatrickJS commented 6 years ago

@dereklin can you make a PR to the readme for adding instructions on how to add support for ngrx 4?

dereklin commented 6 years ago

@gdi2290 I will give it a try. In the meantime, I created this repo off the angular-webpack-starter a while ago: https://github.com/dereklin/ng-ws-ngrx-hmr. It's using ngrx 2. I plan to create a new one using ngrx 4 in the coming days

Kaffiend commented 6 years ago

@gdi2290 I can do a quick PR to explain NGRX 4.

Kaffiend commented 6 years ago

@dereklin @gdi2290 #66 has been issued to help explain ngrx4 usage.

dereklin commented 6 years ago

@Kaffiend Thanks for being super awesome.

The only thing I changed in my project is change type from:

ActionReducer<any, any>[]

to

Array<ActionReducer<any, any>>

to fix a tslint error