Skip to content

fix(ember-tsc): respect local imports over template globals#1114

Open
aklkv wants to merge 1 commit into
typed-ember:mainfrom
aklkv:fix/respect-local-imports-over-globals
Open

fix(ember-tsc): respect local imports over template globals#1114
aklkv wants to merge 1 commit into
typed-ember:mainfrom
aklkv:fix/respect-local-imports-over-globals

Conversation

@aklkv
Copy link
Copy Markdown
Contributor

@aklkv aklkv commented May 15, 2026

When the user has imported a binding with the same name as one of the template's configured globals (e.g. import { on } from '@ember/modifier' where on is also listed in the Ember 7.1+ built-in keywords introduced in 1.6.1), prefer the local import.

Without this filter the template transform routes the path through __glintDSL__.Globals[<name>] and silently shadows the user's import. That is a regression for projects on ember-source < 7.1 where the corresponding Globals entry is gated by Ember71Only<T> and resolves to never -- producing TS2349 'This expression is not callable. Type "never" has no call signatures.' on otherwise valid code such as

import { on } from '@ember/modifier';
<template>
  <select {{on "change" this.update}} />
</template>

Fixes #1113.

When the user has imported a binding with the same name as one of the
template's configured globals (e.g. `import { on } from '@ember/modifier'`
where `on` is also listed in the Ember 7.1+ built-in keywords introduced
in 1.6.1), prefer the local import.

Without this filter the template transform routes the path through
`__glintDSL__.Globals[<name>]` and silently shadows the user's import.
That is a regression for projects on `ember-source < 7.1` where the
corresponding `Globals` entry is gated by `Ember71Only<T>` and resolves
to `never` -- producing TS2349 'This expression is not callable. Type
"never" has no call signatures.' on otherwise valid code such as

    import { on } from '@ember/modifier';
    <template>
      <select {{on "change" this.update}} />
    </template>

Fixes typed-ember#1113.
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.

Regression in @glint/ember-tsc@1.6.1

1 participant