emberjs / rfcs

RFCs for changes to Ember
https://rfcs.emberjs.com/
792 stars 408 forks source link

Let `with` accept and yield multiple arguments #163

Closed mitchlloyd closed 7 years ago

mitchlloyd commented 8 years ago

Is there a reason that {{#with}} doesn't accept and yield multiple arguments as the let addon does? Has this been discussed before? I'd be happy to write up a quick RFC, but I'm wondering if there is any prior art here.

nathanhammond commented 8 years ago

{{#with}} has been with us since the beginning. Changing its semantics at this point seems likely not in the cards for compat+perf reasons. (Note that I'm not aware of any, but I imagine that both of those problems exist.)

locks commented 8 years ago

Plus, the existence of a community addon to fill the void lessens the necessity to do the change internally.

rwjblue commented 8 years ago

I'm unsure how that addon will be updated to support glimmer 2. The private API's it hacks into do not exist there...

ghost commented 8 years ago

It can be done with a tagless component.

rwjblue commented 8 years ago

@martndemus - Hmmm. Not really. There is no way to splat the input arguments. You could handle the common cases (say 1 to 5 args), but eventually it would fall down.

mitchlloyd commented 8 years ago

Based on the feedback it sounds like we shouldn't change {{#with}}.

I've been convinced that changing {{with}} to accept multiple arguments is a bad idea.

So who's going to submit the RFC to remove this feature from Glimmer?

https://github.com/tildeio/glimmer/blob/master/packages/glimmer-runtime/lib/syntax/builtins/with.ts

screen shot 2016-08-05 at 7 57 53 am

rwjblue commented 8 years ago

I'm not sure it should be removed...

mmun commented 7 years ago

As pointed out, this feature is implemented so I'm closing the issue.

On a related note, I hope to see an RFC to pull ember-let into core sometime soon. In block form, it's basically a better with unless you are relying on with's falsey value behavior. The inline form is unique and reads quite nicely in my experience.