RFC#562 - {{and}}, {{or}}, {{not}} as keywords#21310
Open
NullVoxPopuli-ai-agent wants to merge 1 commit intoemberjs:mainfrom
Open
RFC#562 - {{and}}, {{or}}, {{not}} as keywords#21310NullVoxPopuli-ai-agent wants to merge 1 commit intoemberjs:mainfrom
NullVoxPopuli-ai-agent wants to merge 1 commit intoemberjs:mainfrom
Conversation
e4ad66e to
c66798a
Compare
Contributor
There was a problem hiding this comment.
this test should be split in to 3 files, one for and, one for or, and one for not
c66798a to
398e363
Compare
| import { createComputeRef, valueForRef } from '@glimmer/reference'; | ||
| import { internalHelper } from './internal-helper'; | ||
|
|
||
| export const and = internalHelper(({ positional }: CapturedArguments) => { |
Contributor
There was a problem hiding this comment.
this can just be a simple function -- we don't need to use internalHelper, createComputeRef, or valueForRef.
we can do:
export const and = (...args: unknown[]) => args.every(Boolean);the same shortcut/shorthand can be used for all of these functions
398e363 to
bbedd68
Compare
da32ad1 to
ae2f0b2
Compare
NullVoxPopuli
previously approved these changes
Apr 10, 2026
ae2f0b2 to
ba695e3
Compare
NullVoxPopuli
previously approved these changes
Apr 10, 2026
299d486 to
0e1b1e6
Compare
NullVoxPopuli
previously approved these changes
Apr 10, 2026
0e1b1e6 to
7c8738c
Compare
Add boolean logic helpers and register them as built-in keywords so they no longer need to be imported in strict-mode (gjs/gts) templates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7c8738c to
b6c12d9
Compare
NullVoxPopuli
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implements RFC #562 — adds
and,or,notas new helpers and strict-mode keywords.@glimmer/runtimetoBoolfrom@glimmer/global-contextfor Handlebars truthiness (empty arrays are falsy)andreturns the first falsy value or the right-most value if all are truthyorreturns the first truthy value or the right-most value if all are falsynotreturns the boolean negation of its argument@ember/helperwith YUIDoc and Opaque type interfacesand/orthrow in DEBUG mode if called with fewer than two argumentsnotthrows in DEBUG mode if called with more than one argumentNew files
packages/@glimmer/runtime/lib/helpers/{and,or,not}.ts— helper implementationspackages/@glimmer-workspace/integration-tests/test/keywords/{and,or,not}-test.ts— tests with explicit scopepackages/@glimmer-workspace/integration-tests/test/keywords/{and,or,not}-runtime-test.ts— runtime keyword testsModified files
packages/@glimmer/runtime/index.ts— exportspackages/@ember/helper/index.ts— re-exports with docspackages/@ember/template-compiler/lib/compile-options.ts— keyword registrationpackages/@ember/template-compiler/lib/plugins/auto-import-builtins.ts— AST rewritingTest plan
and: returns right-most truthy, first falsy, empty array as falsyor: returns first truthy, right-most falsy, empty array as falsynot: negates truthy/falsy, works as MustacheStatement🤖 Generated with Claude Code