Comment on page
Installation
To use Glint with GlimmerX, you'll add the
@glint/core
, @glint/template
and @glint/environment-glimmerx
packages to your project's devDependencies
, then add a "glint"
key to your project's tsconfig.json
.Yarn
npm
yarn add --dev @glint/core @glint/template @glint/environment-glimmerx
npm install -D @glint/core @glint/template @glint/environment-glimmerx
tsconfig.json
{
"compilerOptions": { /* ... */ },
"glint": {
"environment": "glimmerx"
}
}
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 to add @glint-nocheck
comments to your existing templates that would produce errors.To minimize spurious errors when typechecking with vanilla
tsc
or your editor's TypeScript integration, you should add import '@glint/environment-glimmerx';
somewhere in your project's source or type declarations. You may also choose to disable TypeScript's "unused symbol" warnings in your editor, since tsserver
won't understand that templates actually are using them.Because Glint uses your project-local copy of TypeScript and the packages whose types it augments for use in templates, it requires certain minimum versions of those packages for compatibility.
Package | Minimum Version |
---|---|
typescript | 4.8.0 |
@glimmerx/* | 0.6.7 |
Last modified 1yr ago