Skip to content

Enable Glint by Default#976

Open
wagenet wants to merge 4 commits intoemberjs:mainfrom
wagenet:glint-as-default
Open

Enable Glint by Default#976
wagenet wants to merge 4 commits intoemberjs:mainfrom
wagenet:glint-as-default

Conversation

@wagenet
Copy link
Copy Markdown
Member

@wagenet wagenet commented Sep 29, 2023

Rendered

Implementation PRs

The RFC text in this PR has been refreshed to reflect Glint v2's architecture (no environments, template-tag only) and to mark three of the four "Unresolved questions" as resolved by v2.

@github-actions github-actions Bot added the S-Proposed In the Proposed Stage label Sep 29, 2023
@wagenet wagenet changed the title Add glint-as-default placeholder RFC Enable Glint by Default Oct 26, 2023

There are some potential drawbacks to adopting Glint:

**Learning Curve:** Developers who are not familiar with TypeScript may face a learning curve when integrating Glint into their Ember projects.
Copy link
Copy Markdown
Contributor

@NullVoxPopuli NullVoxPopuli Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

counter point, in VSCode, TS is already enabled in JS by default in JS projects, so Developers may already be used to TS-aware JS projects, and would be less productive without the tsawareness

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should definitely make sure that just adding Glint doesn't do anything unexpected in the editor or linting that requires additional immediate input. That should continue to remain purely opt-in beyond that point.


We should verify that there are no redundancies between the Glint Language Server and the Ember Language Server used in IDEs. If there is, we should answer the following questions:

Should Glint Language Server features be merged into the Ember Language Server? Alternatively, should we remove the redundancy between them but keep them separate?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think it would be good to have only one language server to install.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any overlap? If not, there's still benefit in merging, but it does become a somewhat tangential concern.


In the opinion of the authors of this RFC, the benefit of Glint outweighs the downsides of requiring the boilerplate.

Additionally, `.gts` is not supported for route templates by default, so that issue would need to be resolved, delaying the Glint recommendation further.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ef4 ef4 added the S-Exploring In the Exploring RFC Stage label Oct 27, 2023
@wagenet wagenet removed the S-Proposed In the Proposed Stage label Nov 2, 2023
@achambers
Copy link
Copy Markdown
Contributor

I'm curious, how does this play with a project that's not using TS at all yet?


This RFC proposes adopting Glint as a default/recommended tool in the Ember.js framework. Glint is a static TypeScript-based template type checker that aims to improve developer experience and catch template-related errors at build time. By incorporating Glint into Ember.js, we can enhance type safety, provide better tooling, and encourage best practices when working with templates.

Adopting Glint as a default/recommended tool in Ember.js is a step towards improving developer experience, reducing errors, and promoting best practices in Ember.js template development. By integrating Glint and providing guidance, Ember.js can stay at the forefront of modern web development practices.
Copy link
Copy Markdown
Contributor

@MrChocolatine MrChocolatine Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence seems like a clear duplicate of the previous sentence and does not seem necessary.

  • This sentence: "is a step towards improving developer experience"

    • Previous sentence: "that aims to improve developer experience"
  • This sentence: "reducing errors"

    • Previous sentence: "catch template-related errors"
  • This sentence: "promoting best practices"

    • Previous sentence: "encourage best practices when working with templates"

Comment thread text/0976-glint-as-default.md Outdated
Comment thread text/0976-glint-as-default.md Outdated
Comment thread text/0976-glint-as-default.md Outdated
Comment thread text/0976-glint-as-default.md Outdated

Currently, we recommend Glint users enable the Glint Language Server in their IDE and disable the TypeScript Language Server to avoid duplicate errors. The Glint Language Server does not, however, currently have full feature parity with the TypeScript Language Server, so in doing so, users are losing some language server features. There is [work in progress](https://github.com/typed-ember/glint/issues/626) to rectify this issue.

### Should we require that GTS is recommended before we recommend Glint?
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If enabling Glint, requires no further out-of-the-box changes and doesn't introduce new surprising warnings, then this doesn't really seem to be necessary.

Co-authored-by: MrChocolatine <47531779+MrChocolatine@users.noreply.github.com>
@kategengler
Copy link
Copy Markdown
Member

Ed: Feels like a design gap that users won't get the experience unless they have the correct editor support. If we did that, this becomes an implementation detail of the language server. If you have a JS project with TS dependencies the built-in TS language server gives good behavior. If we want to provide something similar for templates, it shouldn't need changes in the project.

Runspired: How much does this RFC change when we shift to Glint using Volar as a strategy?

@ef4
Copy link
Copy Markdown
Contributor

ef4 commented May 17, 2024

Giving all users, even non-TS apps, better feedback is a good goal here. But my question is why that should involve adding anything to the blueprint. By analogy with typescript, you get typescript-derived feedback in VSCode even when your project has no tsconfig or typescript dependencies.

Could our language server not be similar? So long as all our packages contain type declarations, it seems like it would work without exposing any extra complexity to users.

@wagenet
Copy link
Copy Markdown
Member Author

wagenet commented Aug 29, 2025

With Glint v2 around the corner now might be a good time to revisit this.

@NullVoxPopuli
Copy link
Copy Markdown
Contributor

NullVoxPopuli commented May 1, 2026

An update here -- the glint codebase works with all projects now, and I think without issue.

caveat: hbs is not supported

Glint v2 has shipped since this RFC was drafted, replacing the v1
environment/registry architecture with a Volar-based tsserver-plugin
that targets template-tag (.gts/.gjs) files only.

Refresh the RFC accordingly:
- Detailed design: name the v2 packages (@glint/ember-tsc,
  @glint/tsserver-plugin, @glint/template), describe the JS path
  (jsconfig.json, IDE-only) and the TS path (tsconfig.json,
  ember-tsc --noEmit lint:types), and call out the typescript
  peer requirement.
- Terminology: replace the v1 environment-ember-loose registry
  example with template-tag, the only authoring path Glint v2
  supports.
- Drawbacks: drop the "Registries Boilerplate" drawback (no longer
  applies under v2) and replace with two real drawbacks: template-tag
  is required for type-checking, and JS-only projects pay the
  TypeScript install footprint.
- Unresolved questions: keep all four questions verbatim, but
  annotate the first three as resolved by Glint v2's architecture.
  Only "Should we include JSDoc types in the JS blueprints?" remains
  open.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-Exploring In the Exploring RFC Stage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants