neilff / redux-ui-router

ngRedux bindings for Angular UI Router
MIT License
143 stars 48 forks source link

$stateChange* events are deprecated in upcoming angular-ui-router 1.0.0 #74

Closed xlozinguez closed 7 years ago

xlozinguez commented 7 years ago

While digging into routing, I realized the upcoming update of angular-ui-router is deprecating $stateChange events: https://github.com/angular-ui/ui-router/issues/2219

Instead, the following is recommended:

$transitions.onStart({}, function() {});
$transitions.onSuccess({}, function() {});

However a solution is proposed here but I was wondering if there should be any adjustment to redux-ui-router as a consequence?

tomzmtl commented 7 years ago

By doing a quick search on the source code, current version is indeed quite reliant on $stateChange* events. Not sure how straightforward the upgrade would be.

Nighthawk14 commented 7 years ago

You can find more support for ui-router 1.0.x on this branch https://github.com/neilff/redux-ui-router/tree/prev-state-fix. Not sure if it's working correctly though, last time I tested it wasn't.

Nighthawk14 commented 7 years ago

Fixed by #78

jbadeau commented 7 years ago

Will there be a release soon for 0.7.0?

jhummel commented 7 years ago

Just ran into this myself. I was confused that master was showing things have already been upgraded to work with the new $transitions callbacks. Wasn't until I went digging around my node_modules, I realized NPM had an old version. Any news when there will be a release?

hally9k commented 7 years ago

@jhummel There is now a 0.6.1 release and a 0.7.1-rc.1 with support for ui-router 1.0.0. Please have a jam and see if it solves your issues... I rolled master back to reflect the current state of the latest stable release: 0.6.1. Apologies for the confusion.

phil-lgr commented 7 years ago

Thank you so much for this lib, example is minimal and clear, I am learning Redux and it helped a lot. In a typical angularjs application, your state is usually stored in services, controllers (scopes), router states.. it can get messy real fast..

Even if you isolate all side effects to a single place (rootscope or a dedicated state service) it's decoupled from ui-router, big problem solved with redux-ui-router.

I'm rewriting a angularjs app with typescript. I can confirm that 0.7.1-rc.1 works nicely with 1.0.0-rc.1.