glint icon indicating copy to clipboard operation
glint copied to clipboard

Config/Flag to disable typechecking for two-file components

Open elwayman02 opened this issue 1 year ago • 4 comments

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.

elwayman02 avatar Dec 11 '24 22:12 elwayman02

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

NullVoxPopuli avatar Dec 11 '24 22:12 NullVoxPopuli

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

elwayman02 avatar Dec 11 '24 22:12 elwayman02

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

elwayman02 avatar Dec 11 '24 22:12 elwayman02

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

machty avatar Jan 13 '25 21:01 machty

Support for loose mode and hence two file components has been removed for v2 glint

machty avatar Sep 26 '25 22:09 machty