Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Glint by Default #976

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

wagenet
Copy link
Member

@wagenet wagenet commented Sep 29, 2023

@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
Sponsor Contributor

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
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
Sponsor 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
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
Sponsor 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
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
Contributor

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"

text/0976-glint-as-default.md Outdated Show resolved Hide resolved
text/0976-glint-as-default.md Outdated Show resolved Hide resolved
text/0976-glint-as-default.md Outdated Show resolved Hide resolved

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
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
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
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.

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.

None yet

7 participants