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

Config/Flag to disable typechecking for two-file components #780

Open
elwayman02 opened this issue Dec 11, 2024 · 4 comments
Open

Config/Flag to disable typechecking for two-file components #780

elwayman02 opened this issue Dec 11, 2024 · 4 comments

Comments

@elwayman02
Copy link
Contributor

elwayman02 commented Dec 11, 2024

Right now, Glint v1 tries to typecheck all templates, not just GTS files. There doesn't seem to be a way to scope typechecking just to GTS & TS files while still enabling common tsconfig options like allowJs. For large legacy applications, this presents a hurdle for Glint adoption, because the only path forward seems to be to add glint-nocheck directives to the top of every HBS file that fails Glint's typechecking. There is a codemod for this, yes, but even so the lift can be large enough as to be unfeasible for some teams. For example, when I ran a test in one of our codebases a few months ago, it required adding Glint directives to nearly 600 files. Even after doing that, teams would also need to educate developers on how to handle Glint directives should new errors pop up that they're not prepared to address at that time.

This is a huge amount of overhead for what should be a fairly simple task: Adding functional typechecking for GTS files. We need a way to make Glint adoption more straightforward by configuring it to skip typechecking for HBS files as a intermediate onboarding step until teams are ready to tackle their legacy components. Otherwise, teams are stuck choosing between taking on the large overhead of onboarding Glint as it stands today, or not adopting Glint at all, which becomes a blocker for using GTS components since typechecking will be broken with the regular tsc commands. Speaking from experience, the end result of Glint's current state is that developers will choose to just not bother with GTS components at all, because they value functional typechecking more than they value single-file components. I'd like to change that story, but Glint needs a better adoption path than it has today.

@NullVoxPopuli
Copy link
Contributor

You could use the unstable tag of Glint, since two-file components aren't supported 🙃

@elwayman02
Copy link
Contributor Author

I could, except I can only consume published stable versions of packages. :P

@elwayman02
Copy link
Contributor Author

elwayman02 commented Dec 11, 2024

At minimum, I think it would be good planning to make sure that when support for two-file components gets added to Glint v2, that it's configurable rather than forced on by default with no way to disable. :)

@machty
Copy link
Contributor

machty commented Jan 13, 2025

@elwayman02 this seems pretty easily doable; keeping this on my radar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants