Skip to content

RFC#560 - {{eq}}, {{neq}} as keywords#21312

Open
NullVoxPopuli-ai-agent wants to merge 1 commit intoemberjs:mainfrom
NullVoxPopuli-ai-agent:nvp/eq-neq-as-keyword
Open

RFC#560 - {{eq}}, {{neq}} as keywords#21312
NullVoxPopuli-ai-agent wants to merge 1 commit intoemberjs:mainfrom
NullVoxPopuli-ai-agent:nvp/eq-neq-as-keyword

Conversation

@NullVoxPopuli-ai-agent
Copy link
Copy Markdown
Contributor

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

Summary

Implements RFC #560 — adds eq and neq as new helpers and strict-mode keywords.

  • Implements two equality helpers as plain functions in @glimmer/runtime
  • eq uses strict equality (===), neq uses strict inequality (!==)
  • 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/{eq,neq}.ts — helper implementations
  • packages/@glimmer-workspace/integration-tests/test/keywords/{eq,neq}-test.ts — tests with explicit scope
  • packages/@glimmer-workspace/integration-tests/test/keywords/{eq,neq}-runtime-test.ts — runtime keyword tests

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
  • tests/docs/expected.js — docs coverage allowlist

Test plan

  • eq: equal numbers, unequal numbers, equal strings
  • neq: unequal numbers, equal numbers
  • Runtime keyword tests (explicit scope, eval, no scope)
  • DEBUG arity error tests
  • Smoke test

🤖 Generated with Claude Code

@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent force-pushed the nvp/eq-neq-as-keyword branch 8 times, most recently from b25e076 to ba28d4e Compare April 10, 2026 20:44
Add equality 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>
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