Skip to content

Commit 49c0436

Browse files
committed
break another cycle
1 parent 02c93d4 commit 49c0436

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

packages/@ember/-internals/glimmer/lib/templates/input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { precompileTemplate } from '@ember/template-compilation';
2-
import { on } from '@ember/modifier';
2+
import { on } from '@ember/modifier/on';
33
export default precompileTemplate(
44
`<input
55
{{!-- for compatibility --}}

packages/@ember/-internals/glimmer/lib/templates/link-to.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { precompileTemplate } from '@ember/template-compilation';
2-
import { on } from '@ember/modifier';
2+
import { on } from '@ember/modifier/on';
33

44
export default precompileTemplate(
55
`<a

packages/@ember/-internals/glimmer/lib/templates/textarea.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { precompileTemplate } from '@ember/template-compilation';
2-
import { on } from '@ember/modifier';
2+
import { on } from '@ember/modifier/on';
33

44
export default precompileTemplate(
55
`<textarea

packages/@ember/modifier/index.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1-
import { on as glimmerOn } from '@glimmer/runtime';
21
import { setModifierManager as glimmerSetModifierManager } from '@glimmer/manager';
32

4-
import type { Opaque } from '@ember/-internals/utility-types';
53
import type Owner from '@ember/owner';
64
import type { ModifierManager } from '@glimmer/interfaces';
75

8-
// In normal TypeScript, this modifier is essentially an opaque token that just
9-
// needs to be importable. Declaring it with a unique interface like this,
10-
// however, gives tools like Glint (that *do* have a richer notion of what it
11-
// is) a place to install more detailed type information.
12-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
13-
export interface OnModifier extends Opaque<'modifier:on'> {}
14-
15-
// SAFETY: at the time of writing, the cast here is from `{}` to `OnModifier`,
16-
// which makes it strictly safer to use outside this module because it is not
17-
// usable as "any non-null item", which is what `{}` means, without loss of any
18-
// information from the type itself.
19-
export const on = glimmerOn as OnModifier;
6+
export { on, type OnModifier } from './on';
207

218
// NOTE: this uses assignment to *require* that the `glimmerSetModifierManager`
229
// is legally assignable to this type, i.e. that variance is properly upheld.

packages/@ember/modifier/on.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { on as glimmerOn } from '@glimmer/runtime';
2+
3+
import type { Opaque } from '@ember/-internals/utility-types';
4+
5+
// In normal TypeScript, this modifier is essentially an opaque token that just
6+
// needs to be importable. Declaring it with a unique interface like this,
7+
// however, gives tools like Glint (that *do* have a richer notion of what it
8+
// is) a place to install more detailed type information.
9+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
10+
export interface OnModifier extends Opaque<'modifier:on'> {}
11+
12+
// SAFETY: at the time of writing, the cast here is from `{}` to `OnModifier`,
13+
// which makes it strictly safer to use outside this module because it is not
14+
// usable as "any non-null item", which is what `{}` means, without loss of any
15+
// information from the type itself.
16+
export const on = glimmerOn as OnModifier;

packages/@ember/modifier/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"private": true,
44
"type": "module",
55
"exports": {
6-
".": "./index.ts"
6+
".": "./index.ts",
7+
"./on": "./on.ts"
78
},
89
"dependencies": {
910
"@ember/-internals": "workspace:*",

0 commit comments

Comments
 (0)