Uh oh!
There was an error while loading. Please reload this page.
Adding Equality Operators to Templates - #560
Conversation
balinterdi
commented
Dec 8, 2019
I'll admit it's not very constructive feedback, but can we call it |
cibernox
commented
Dec 8, 2019
@balinterdi It's one of the points in the Unresolved questions section. Let's someone from core chime in and arguments the reasons to prefer |
| - If an app already use `ember-truth-helpers`, the `{{eq}}` helper will conflict with the one proposed here. How do we | ||
| update `ember-truth-helpers` to make sure the helper of the same name doesn't collide with the built-in one? | ||
| - The inequality helper proposed in this RFC is `{{neq}}` while the one in ember-truth-helpers is `{{not-eq}}`. It is | ||
| worth considering the benefits that keeping the same name might have in helping apps and addon migrate to the built-in helper. |
There was a problem hiding this comment.
this could easily be migrated using a template codemod, so probably not much of an issue in reality :)
There was a problem hiding this comment.
Sure, but nothing beats not having to change anything 😄
There was a problem hiding this comment.
@Turbo87 And you have to admit: neq looks way worse than not-eq.
There was a problem hiding this comment.
I mean, one could argue that (not (eq foo bar)) is not much longer than (not-eq foo bar) 😅
There was a problem hiding this comment.
Fair enough, I'm happy with (not (eq ... )), too. I don't think gaining 3 characters (neq vs. not-eq) justifies introducing a so-far unseen neq but I might just have a visceral reaction to neq that I have to overcome.
driesdl
commented
Jan 2, 2020
Why not add all truth-helpers, but just these two? |
Turbo87
commented
Jan 2, 2020
@Driezzz because these are the most uncontroversial |
| Add `{{eq}}` and `{{neq}}` helpers. | ||
| #### `{{eq}}` | ||
| Binary operation. Throws an error if not called with exactly two arguments. |
There was a problem hiding this comment.
I think we should allow many arguments with eq, behaving like:
a===b===cThere was a problem hiding this comment.
@rwjblue is that consensuated with the core team? I'm fine either way, I just want to be sure before updating it.
Uh oh!
There was an error while loading. Please reload this page.
Accidentally commented 😩 here instead of #562We chatted about this in todays core team meeting, and are in favor of moving forward here.One thing to call out explicitly, this RFC does not propose import paths (which helpers would require see the strict mode RFC for details). At the time of authoring, that distinction was not present (which is why it isn't discussed here), but after discussion with the core team we think that making these keywords (which do not need imports) is the correct path anyways (therefore no changes are required to the RFC). Additionally, landing this in Ember will require a small deprecation when using All of that being said, we are moving this into final comment period (finally 😉). |
rwjblue
commented
Jan 8, 2021
Dangit! I meant to make that comment over on #562 not this one. 🤦 |
rwjblue
commented
Jan 9, 2021
Note: we did talk about this RFC quite a bit also, and I do think that we want to move forward soon. There are just a few other angles that we wanted to talk through (e.g. should there be a way to customize equality or not vs "simple" |
Turbo87
commented
Jan 9, 2021
IMHO it's complicated enough to explain that empty arrays in HBS are falsy. if equality was also redefined to work different from |
rwjblue
commented
Jan 15, 2021
We discussed this a bit more this week, and are still very much in favor of moving forward.
Agreed. I think this is well stated, and when we discussed it more at todays meeting we shared your conclusion. Remaining questions that we want to resolve (either in a GlimmerVM team meeting or the next core team meeting):
Hopefully, we'll be able to resolve those two issues at the next round of meetings. |
I think this might be overthinking it. First, IDK if helpers are guaranteed to have stable outputs, at least with class-based-helpers I believe you could perfectly not be the case. Trying to be that smart just to remove a == operation (or |
rwjblue
commented
Jan 15, 2021
Hehe, I don't disagree with you (see my personal note in that snippet); buuuuuutttt sometimes it's what we do. 😺 |
rwjblue
commented
Jan 22, 2021
Thanks @pzuraq for adding that section around object equality scenarios (and some potential gotchas there). We discussed this today, and we are moving this into FCP. |
it require less mental parsing, especially for non native speakers and new developers. Same as related: glimmerjs/glimmer-vm#1240 (comment) |
rwjblue
commented
Jan 29, 2021
We discussed this at todays meeting, and are still in favor of moving forward. |
rwjblue
commented
Jan 29, 2021
We discussed the dasherization (or not) a while back, and had previously decided to go with In retrospect, we decided not to make these helpers require being imported (see #562 (comment) for some discussion RE: keywords vs helpers) and so |
chriskrycho
commented
Nov 23, 2021
@chriskrycho I was under the impression these would be part of the "prelude". |
chriskrycho
commented
Nov 23, 2021
I have gotten conflicting impressions at different times! I think it is fine for these (along with things like |
Advance RFC #560 `"Adding Equality Operators to Templates"` to Stage Ready for Release
Advance RFC #560 `"Adding Equality Operators to Templates"` to Stage Released
Extracted from RFC #388
Rendered