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
[FEATURE ember-routing-didTransition-hook] Add a didTransition
hook to the router.
#3452
Conversation
@@ -52,7 +52,7 @@ Ember.Router = Ember.Object.extend({ | |||
this.handleURL(location.getURL()); | |||
}, | |||
|
|||
didTransition: function(infos) { | |||
finalizeTransition: function(infos) { |
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.
this is risky; I think there's a good number of apps that have reopened didTransition
(and called _super
) to hook into this event. Perhaps the right answer is branching to finalizeTransition
within didTransition
if the feature flag is enabled? Does didTransition
need to be renamed at all?
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.
Ah, yes. We meant to Em.K
the didTransition
function so it could still be subclassed. Will update this.
… to the router. For use in analytics and such, you may listen to this hook.
@machty right you are, there is not need to rename this. |
expect(3); | ||
|
||
Router.map(function(){ | ||
this.route("nork"); |
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.
a man from my own heart
[FEATURE ember-routing-didTransition-hook] Add a `didTransition` hook to the router.
if (Ember.FEATURES.isEnabled("ember-routing-didTransition-hook")) { | ||
// Put this in the runloop so url will be accurate. Seems | ||
// less surprising than didTransition being out of sync. | ||
Ember.run.once(this, this.trigger, 'didTransition'); |
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.
@mixonic how about passing the infos
param here?
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.
@gdub22 looks possible! Out of curiosity, what is in infos
that you want access to? What would this enable?
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.
@mixonic this same infos
that gets passed into the router's didTransition method (line 55). Just a matter of convenience to have that data accessible in the event callback too.
I don’t see this FEATURE in the list of features, neither I can find |
@huafu it is in and enabled: https://github.com/mixonic/ember.js/blob/master/packages/ember-routing/lib/system/router.js#L124 The docs are lacking here. |
Ok, thanks ;-) So no need for the feature flag anymore :) Huafu Gandon | gmail (mailto:huafu.gandon@gmail.com) | github (https://github.com/huafu) | linkedin (http://www.linkedin.com/in/pgandon) On Monday 27 January 2014 at 07:16, Matthew Beale wrote:
|
@huafu - Exactly, once the feature is shipped in a a release, we remove it from the |
Yes I figured out, but what if you decide to finally remove totally the feature? Where are you keeping track of what feature is integrated when? Huafu Gandon | gmail (mailto:huafu.gandon@gmail.com) | github (https://github.com/huafu) | linkedin (http://www.linkedin.com/in/pgandon) On Monday 27 January 2014 at 07:19, Robert Jackson wrote:
|
@huafu - They are tracked in These might provide more information also: http://emberjs.com/guides/configuring-ember/feature-flags/ |
So there is never a feature being abandoned and removed from that? Huafu Gandon | gmail (mailto:huafu.gandon@gmail.com) | github (https://github.com/huafu) | linkedin (http://www.linkedin.com/in/pgandon) On Monday 27 January 2014 at 07:43, Robert Jackson wrote:
|
Basically no. Once a feature has been enabled and published in the release version (a final non-beta release) it is considered public API and is then bound by the same SemVer requirements as any other piece of the code base. Up until it is enabled and released, it can be removed (and this has happened once or twice). |
Ok, thanks a lot for all those informations Huafu Gandon | gmail (mailto:huafu.gandon@gmail.com) | github (https://github.com/huafu) | linkedin (http://www.linkedin.com/in/pgandon) On Monday 27 January 2014 at 07:48, Robert Jackson wrote:
|
For use in analytics and such, you may listen to this hook.
Seems good for analytics, though perhaps you could just observe
url
directly? I imagine there are other use-cases.