# Migrating ## Glint 0.9.x to 1.0 Most of the changes in Glint 1.0 should appear as bugfixes and improvements to the majority of users migrating from 0.9.x. The main change to be aware of is that **`@glint/template` should now be explicitly added to your project's `devDependencies`** when you upgrade Glint. Note also that support for `include` and `exclude` globs has been removed. More details about these and other breaking changes are laid out below. ### Minimum TypeScript Version Glint 1.0 requires TypeScript 4.8 or greater, dropping support for 4.7. ### `@glint/template` Peer For Glint to work properly, there must be exactly one common copy of `@glint/template` present in your dependency hierarchy. This has been true throughout our 0.x releases, but as of 1.0 we're making that explicit by marking `@glint/template` as a `peerDependency` of our environment packages rather than a hard `dependency`. Accordingly, you will need to add `@glint/template` to your project's own dependencies list alongside `@glint/core` and your environment package(s). Note also that if you publish an addon that depends on types from `@glint/template`, that addon should likewise declare a `peerDependency` on `@glint/template` and **not** a regular `dependency`. ### `{{component}}` Typing In `@glint/environment-ember-loose`, if you used the `{{component}}` helper to expose a "contextual component" to your consumers without binding any additional arguments, e.g.: ```handlebars {{yield (hash Child=(component "some-child-component"))}} ``` In 0.9.x, Glint would allow you to type that yielded component as something like: ```typescript export interface MyComponentSignature { Blocks: { default: [{ Child: typeof SomeChildComponent }]; }; } ``` However, this was never quite correct: when you use the `{{component}}` helper, the value it returns is not the actual component class itself. If `SomeChildComponent` had static members, for instance, then according to `Child: typeof SomeChildComponent`, consumers should be able to access those properties from the yielded `Child` value, but they wouldn't be there in the value returned from `{{component}}`. The only thing you are guaranteed to be able to do with the result of the `{{component}}` helper is invoke it as a component in a template. Accordingly, in Glint 1.0 the above combination will no longer typecheck. To fix the situation, you can either update the signature to match the template: ```typescript export interface MyComponentSignature { Blocks: { default: [{ Child: ComponentLike }]; }; } ``` Or update the template to match the signature: {% tabs %} {% tab title="Template" %} ```handlebars {{yield (hash Child=this.SomeChildComponent)}} ``` {% endtab %} {% tab title="Backing Class" %} ```typescript import SomeChildComponent from './some-child-component'; export default class MyComponent /* ... */ { SomeChildComponent = SomeChildComponent; } ``` {% endtab %} {% endtabs %} ### `include`/`exclude` Configuration Glint 1.0 drops support for the `transform` configuration key, which is where `include` and `exclude` globs were previously specified. These options were a blunt instrument left over from an earlier iteration of Glint. If you're currently relying on these keys to have Glint skip typechecking for parts of your codebase, consider using [`@glint-nocheck` directives][nocheck] instead. You can automate the process of adding those directives to templates that have type errors using the [`glint-auto-nocheck`] script. Note that templates with a `@glint-nocheck` directive will benefit from best-effort editor support for features such as hover information, go-to-definition, etc. even if they aren't typesafe, which is a meaningful advantage over templates that were ignored via `include`/`exclude`. [nocheck]: ../docs/directives.md#glint-nocheck [`glint-auto-nocheck`]: https://github.com/typed-ember/glint/tree/main/packages/scripts#auto-glint-nocheck ### `allowPlainFunctionInvocation` The `allowPlainFunctionInvocation` flag has been dropped from `@glint/environment-ember-loose`'s configuration. If you are not using Ember 4.5+ with native support for functions as helpers, consider adopting [the functions-as-helpers polyfill][functions-as-helpers]. [functions-as-helpers]: https://github.com/ember-polyfills/ember-functions-as-helper-polyfill ### Tagged Strings in `ember-template-imports` Since `