-
Notifications
You must be signed in to change notification settings - Fork 602
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
ember-cli-addon - split initializer #564
ember-cli-addon - split initializer #564
Conversation
} | ||
setup(this.container).finally(() => { | ||
this._super(transition); | ||
if (!this.get('_authEventListenersAssigned')) { |
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.
Is this still necessary then?
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.
Good point, no need to check if listeners are assigned as ApplicationRoute.beforeModel
is only called once per page load.
9bf272f
to
a8c5dce
Compare
The |
It would definitely be cool to deprecate the |
Whats wrong with reopen? it's not a hack, it's used internally within Ember and referenced in the official guide and API docs. |
as ApplicationRoute.beforeModel is only called once per page load.
It's basically the same as monkey patching in Ruby - it's very powerful and makes a lot of things very simple in the first place. At the same time though if used heavily it complicates stuff as you might be looking at some method that might be overridden somewhere else and then you wonder why it doesn't behave the way it should by looking at the original source code. |
ember-cli-addon - split initializer
Hopefully this should be the last of the initializer pulls! Targets the ember-cli-addon branch.
As per emberjs/ember.js#10256 (comment), it no longer relies on
deferRediness
, and incorporates most of the setup into theApplicationRouteMixin.beforeModel
method.The
initializer
now only registers the stores/session, andinstanceInitializer
now only injectssession
into components, controllers, routes.