-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
FastBoot changes seem to break setting Application#customEvents within initializer #10534
Comments
Looks like we're eagerly copying these properties over to the instance before initializers are run (https://github.com/emberjs/ember.js/blob/master/packages/ember-application/lib/system/application.js#L325-L326). Should be easy enough to set them after initializers are run and everything should continue to work. |
|
@runspired this is the issue related to our discussion on last Friday. For example. I have an addon that has an initializer that sets a few customEvents on the application.customEvents hash. In the past the custom events were registered just fine. I'm not sure which release broke that behavior of using an initializer to add custom events from an addon. |
@machty @tomdale @runspired So here is where I think the advantage is for using customEvents that are added by an initializer…
For the ember-off-canvas-components addon I chose to use custom events and used an initializer to add them to Now that the initializer does NOT successfully setup the I've tried doing some finagling with wiring the In my opinion, custom events should still be first class citizens in an ember app and in ember components that arrive in an app via an addon (using an initializer of course, not some crazy re-opening of a private object/factory). Of course, custom events, were the hotness prior to "bindings down and actions up" (well prior to Ember.js); and they still work great and can provide a solid solution for communicating between DOM elements (components) where the components have a common parent element (component). |
@pixelhandler I agree with you that addons should be able to register custom events. Right now, the API wasn't really designed to handle that use case (it's designed for apps to specify the set of events they want, not addons). I would be very open to a PR/RFC that added public API for addons to register events that the Event Dispatcher can listen to. |
@tomdale ok great. I'll work on an RFC and followup with a PR if I can pull it off. |
@machty @tomdale I created an RFC - emberjs/rfcs#69 |
In 1.11 I can no longer set
application.customEvents
within an initializer because theapplication
instance passed to an initializer is different from whateverthis
is in this line of code:https://github.com/emberjs/ember.js/blob/master/packages/ember-application/lib/system/application-instance.js#L179
The text was updated successfully, but these errors were encountered: