Skip to content

RFC#561 - {{lt}}, {{lte}}, {{gt}}, {{gte}} as keywords#21309

Open
NullVoxPopuli-ai-agent wants to merge 1 commit intoemberjs:mainfrom
NullVoxPopuli-ai-agent:nvp/lt-lte-gt-gte-as-keyword
Open

RFC#561 - {{lt}}, {{lte}}, {{gt}}, {{gte}} as keywords#21309
NullVoxPopuli-ai-agent wants to merge 1 commit intoemberjs:mainfrom
NullVoxPopuli-ai-agent:nvp/lt-lte-gt-gte-as-keyword

Conversation

@NullVoxPopuli-ai-agent
Copy link
Copy Markdown
Contributor

@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent commented Apr 10, 2026

Summary

Implements RFC #561 — adds lt, lte, gt, gte as new helpers and strict-mode keywords.

  • Implements four comparison helpers as plain functions in @glimmer/runtime
  • Re-exports from @ember/helper with YUIDoc and Opaque type interfaces
  • Registers as keywords in the template compiler (strict-mode only, not available in loose mode)
  • Each helper throws in DEBUG mode if not called with exactly two arguments

New files

  • packages/@glimmer/runtime/lib/helpers/{lt,lte,gt,gte}.ts — helper implementations
  • packages/@glimmer-workspace/integration-tests/test/keywords/{lt,lte,gt,gte}-test.ts — tests with explicit scope
  • packages/@glimmer-workspace/integration-tests/test/keywords/{lt,lte,gt,gte}-runtime-test.ts — runtime keyword tests (explicit scope, eval, no scope)

Modified files

  • packages/@glimmer/runtime/index.ts — exports
  • packages/@ember/helper/index.ts — re-exports with docs
  • packages/@ember/template-compiler/lib/compile-options.ts — keyword registration
  • packages/@ember/template-compiler/lib/plugins/auto-import-builtins.ts — AST rewriting
  • smoke-tests/scenarios/basic-test.ts — gjs smoke test

Test plan

  • Explicit scope tests for each helper (less, equal, greater cases)
  • Runtime keyword tests (explicit scope, eval, no eval/no scope)
  • DEBUG arity error tests
  • Smoke test

🤖 Generated with Claude Code

fn,
get,
gt,
gte,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to add these to loose mode. undo this

@NullVoxPopuli NullVoxPopuli marked this pull request as draft April 10, 2026 15:39
@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent force-pushed the nvp/lt-lte-gt-gte-as-keyword branch 4 times, most recently from 6c9a5ea to 92df32a Compare April 10, 2026 17:01
@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent force-pushed the nvp/lt-lte-gt-gte-as-keyword branch 2 times, most recently from 224825d to a9f1ecb Compare April 10, 2026 18:38
NullVoxPopuli
NullVoxPopuli previously approved these changes Apr 10, 2026
@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent force-pushed the nvp/lt-lte-gt-gte-as-keyword branch from a9f1ecb to 80943b1 Compare April 10, 2026 18:51
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review April 10, 2026 20:33
import { DEBUG } from '@glimmer/env';
import { jitSuite, RenderTest, test } from '@glimmer-workspace/integration-tests';

import { template } from '@ember/template-compiler/runtime';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these aren't runtime tests, so we should drop the /runtime

@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent force-pushed the nvp/lt-lte-gt-gte-as-keyword branch from 80943b1 to bce381b Compare April 10, 2026 20:44
Add comparison 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>
@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent force-pushed the nvp/lt-lte-gt-gte-as-keyword branch from bce381b to e15d714 Compare April 10, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants