Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Update Glimmer Template Truthiness Semantics #861
base: master
Are you sure you want to change the base?
Update Glimmer Template Truthiness Semantics #861
Changes from 7 commits
f933193
5435609
ae94412
45c129f
88475f4
eb299a0
e7a10f4
9f74d6d
52cff92
c1d8856
c0caa6f
27d3be0
0f6417b
af3ab83
43d0b88
12f8c1b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
{{not}}
also error when invoked with no arguments?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that this means anything, but according to the original RFC no? https://rfcs.emberjs.com/id/0562-add-logical-operators.
But that does bring about the question of what they were expecting to happen in that case? In my opinion, it would make sense to error there.
Edit: After playing around in a console I might have changed my mind.
!undefined
= true. And since we want to keep the semantics equal to Javascript - it might make sense to return true in this case?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe still strange? I'm unsure. We definitely should support
{{not undefined}}
but I'm not sure about{{not}}
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would tend to not throw if invoked without arguments (
{{(not)}}
). But from typing perspective the argument should be required. And we might want to have a linting rule forbidding argumentless{{(not)}}
.I don't see much value in throwing. Implementation complexity should be the same. But we should use types and linting to push people towards
{{false}}
instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like @jelhan's solution here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would that opt-in look like? Would be great if you could do more in detail for the migration story in general.