Important changes to Plugin Outlets for Ember 2.10

Ah it’s possible Ember’s action helper does not work with outlets. Have you tried using change="myAction" instead?

1 Like

I hadn’t, but I just tried it. That doesn’t work either–and it breaks my workaround too. How mysterious. (If you want to see it, the full source is at https://github.com/debtcollective/new-user-plugin/blob/sb/134/assets/javascripts/discourse/modal/connectors/create-account-after-password/tdc-sign-up.js.es6#L18 and https://github.com/debtcollective/new-user-plugin/blob/sb/134/assets/javascripts/discourse/templates/modal/connectors/create-account-after-password/tdc-sign-up.hbs#L8) I just noticed the component class file is in a different place than in the examples you give above, so I tried moving it, but the behavior was exactly the same.

This is weird because when I tried to run your code the plugin outlet of “create-account-after-password” didn’t exist in core. I assume you’re going to make a PR or ask to add that?

Besides that I was able to confirm that it’s the (action "something") helper that doesn’t support the actions on plugin outlets. This can likely be fixed in Discourse but you’ll have to work around it for now.

This makes using the change attribute impossible since Ember wants a function there, not an action name.

One thing I’d suggest doing is putting a component in your connector. For example {{tdc-sign-up}}. In that Ember component you can have actions and methods that will work with all the ember helpers.

2 Likes

This is weird because when I tried to run your code the plugin outlet of “create-account-after-password” didn’t exist in core. I assume you’re going to make a PR or ask to add that?

I did! I think it’s getting merged next week.

One thing I’d suggest doing is putting a component in your connector. For example {{tdc-sign-up}}. In that Ember component you can have actions and methods that will work with all the ember helpers.

Funnily enough, that’s what I did at first, but then I changed it thinking this would be simpler (fewer wrapping spans and divs to handle–this is before I found the noTags connector attribute) :woman_shrugging: Guess not! Always learning something new with discourse.

3 Likes