-
Notifications
You must be signed in to change notification settings - Fork 248
feat(router): added vetoable preLeave event #1070
Conversation
BREAKING CHANGE Previously, vetoing was allowed on leave (RouteLeaveEvent) which caused issues because routes had no way to recover from other route vetoing a leave event. Now, similar to preEnter and enter, leave event was split into vetoable preLeave (RoutePreLeaveEvent) and non-vetoable leave (RouteLeaveEvent). views.configure({ 'foo': ngRoute( path: '/foo', preLeave: (RoutePreLeaveEvent e) { e.allowLeave(new Future.value(false)); }) });
}); | ||
|
||
Element root = _.compile('<ng-view></ng-view>'); | ||
expect(root.text).toEqual(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(root).toHaveText('');
LGTM. Could you please put this PR description in the commit message (as this is a BC break) ? Some remarks / questions about route.dart:
|
@vicb PR message is identical to commit message. |
@pavelgj you're right, I was expecting "..." on the GH UI but it's not on this PR page. Sorry for the noise. |
Oh I thought this was already merged - do we need to wait because it breaks BC ? |
Then I think my commit could also be considered as a BC break - the BC is broken because the route dependency was/is '>=0.4.18/21 <0.5.0' and the router does not use semver (I think this i still true for the DI also) and BC was broken in route v0.4.21. If this should be fixed, the dependency should be "=0.4.20" |
Sorry, I'm out of context, what's the problem with upgrading to 0.4.21? |
I'm also out of context... what's BC you guys? Are you using this as code for "breaking change"? Pavel, I think the issue @vicb is raising is that when he changed the pubspec.yaml file in 7c9a758 to depend on route 0.4.21, he inadvertently introduced the breaking change in route to angular.dart. If we are following semver for angular.dart, then we should fix the dependency on Technically, semver also says that anything |
BC stands for backward compatibily here. |
BREAKING CHANGE Previously, vetoing was allowed on leave (RouteLeaveEvent) which caused issues because routes had no way to recover from other route vetoing a leave event. Now, similar to preEnter and enter, leave event was split into vetoable preLeave (RoutePreLeaveEvent) and non-vetoable leave (RouteLeaveEvent). views.configure({ 'foo': ngRoute( path: '/foo', preLeave: (RoutePreLeaveEvent e) { e.allowLeave(new Future.value(false)); }) }); Closes #1070
BREAKING CHANGE Previously, vetoing was allowed on leave (RouteLeaveEvent) which caused issues because routes had no way to recover from other route vetoing a leave event. Now, similar to preEnter and enter, leave event was split into vetoable preLeave (RoutePreLeaveEvent) and non-vetoable leave (RouteLeaveEvent). views.configure({ 'foo': ngRoute( path: '/foo', preLeave: (RoutePreLeaveEvent e) { e.allowLeave(new Future.value(false)); }) }); Closes #1070
BREAKING CHANGE Previously, vetoing was allowed on leave (RouteLeaveEvent) which caused issues because routes had no way to recover from other route vetoing a leave event. Now, similar to preEnter and enter, leave event was split into vetoable preLeave (RoutePreLeaveEvent) and non-vetoable leave (RouteLeaveEvent). views.configure({ 'foo': ngRoute( path: '/foo', preLeave: (RoutePreLeaveEvent e) { e.allowLeave(new Future.value(false)); }) }); Closes #1070
BREAKING CHANGE
Previously, vetoing was allowed on leave (RouteLeaveEvent) which caused
issues because routes had no way to recover from other route vetoing a leave
event.
Now, similar to preEnter and enter, leave event was split into vetoable
preLeave (RoutePreLeaveEvent) and non-vetoable leave (RouteLeaveEvent).