An interesting strategy for passing properties via raw template plugin outlets

A quick question on this.

I noticed something interesting in TLT:

There is no passing of the model here.

Yet you manage to do this:

I can only assume this is a stable strategy for passing down the model properties because it’s being employed here - any caveats?

One of the reasons I was finding these available plugin outlets less useful was because they don’t often explicitly pass down the relevant model.

Is this pattern documented anywhere? I haven’t seen it in the Ember guides …

3 Likes

The ‘raw’ system is a discourse-specific thing, so you won’t find anything about it in the Ember guides.

It looks like it’s pretty deliberate in the core code, so I think it’s safe to use it:

In fact, it doesn’t look like raw outlets have the ability to pass anything like the ‘args’ you find in regular plugin-outlets. So context is the only way to go.

Please do feel free to make core PRs if you feel any useful data is missing in regular plugin outlets. Adding new arguments to outlets is relatively safe, backwards compatible, and has negligable performance impact, so it’s unlikely we’ll refuse.

7 Likes