Skip to content

Commit

Permalink
Merge pull request #572 from typed-ember/installation-docs-improvement
Browse files Browse the repository at this point in the history
Fix and extend ember-template-imports notes in installation.md
  • Loading branch information
chriskrycho authored May 10, 2023
2 parents 37c15e7 + c141351 commit 20432a2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/ember/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ npm install -D @glint/core @glint/template @glint/environment-ember-loose
}
}
```
If you are using `ember-template-imports` in your project, also install the `@glint/environment-ember-template-imports` package and configure it in `tsconfig.json` under `glint.environment`.

{% endcode %}

If you are using `ember-template-imports` in your project, you also need to install the `@glint/environment-ember-template-imports` package and configure it in `tsconfig.json` under `glint.environment`.

Note that, by default, Glint will assume you want it to analyze all templates in the codebase that are covered by your `tsconfig.json`. To ignore any type errors up front so that you can incrementally migrate your project to typesafe templates, consider using [the `auto-glint-nocheck` script](https://github.com/typed-ember/glint/tree/main/packages/scripts#auto-glint-nocheck) to add [`@glint-nocheck` comments](../directives.md#glint-nocheck) to your existing templates that would produce errors.

Finally, ensure you've added the following statement somewhere in your project's source files or ambient type declarations:
Expand All @@ -44,6 +45,12 @@ Finally, ensure you've added the following statement somewhere in your project's
import '@glint/environment-ember-loose';
```

If using `ember-template-imports`, add a corresponding line for that environment as well:

```typescript
import '@glint/environment-ember-template-imports';
```

You may also choose to disable TypeScript's "unused symbol" warnings in your editor, since Glint will flag any symbols that are actually unused, while `tsserver` won't understand any symbol usage that only occurs in templates.

{% hint style="info" %}
Expand Down

0 comments on commit 20432a2

Please sign in to comment.