Skip to content

Discussion: strictness settings, TS support, semver, etc. #190

Closed
@chriskrycho

Description

@chriskrycho

(Consider this sort of pre-RFC discussion as I work on a full RFC for official TS support policies in Ember proper.)

Background

As I've been thinking about the most effective setup for using this, and looking at our current documentation, I've been chewing on this recommendation I wrote quite a few months ago now:

Start with the least strict "strictness" settings (which is what the default compiler options are set to) to begin, and only tighten them down iteratively.

I… don't think that's right. I think we should tell people that they'll be most successful with the strictest strictness and that they should start there, because progressively typing an app will mostly be a one-time pass, rather than a multi-phase process where you add stricter rules. 🤔

As part of that, I'd like to do two things:

  1. Update this recommendation to say basically the opposite of what it does now, and as part of that include a code sample with the strictest settings we can support with our current typings.

    This part seems pretty uncontroversial to me; people are of course free to simply ignore the recommendation! As such, I've gone ahead and added that update to the README.

  2. Update the default template to include every strictness setting.

    This part is a bit stickier! And it got me thinking about a lot of related issues, some of which we've discussed before in Slack, but which I'd like to nail down here.

The meat of the issue

The thing is, doing (2) is essentially a breaking change: if someone runs ember install ember-cli-typescript@latest and sees the diff and accepts it, a previously-type-checking app will no longer type-check. This means that making the change essentially requires us to do a 2.0. This presumably needs to include things around tsconfig.json in general: I'd also like to change the default noEmitOnError settings to true now that we're able to properly fail the build in that case, but that will also break existing apps, and so also demands a 2.0.

I'm fine with that; I don't mind doing "major" version changes in a semver sense relatively often. We just need to establish what semver means for this addon, and document it.

But this gets into broader questions around TS (and especially strictness) support we should resolve as well: should we default to shipping every new strictness setting enabled (assuming it doesn't break our typings)? Or should we ship a minimal set and just make recommendations?

One closely related issue is supported TS version in general, both here and in our type definitions. We shouldn't ship breaking changes in our type defs every 2 months when the TS compiler comes out, but we do need to make sure this addon tracks closely with the TS version.

  • We could start making the ember-cli-typescript version track the version of TS it ships. I.e. right now we'd go ahead and bump this to be ember-cli-typescript 2.8, and at the next TS release we'd do ember-cli-typescript 2.9, and so on. I don't love this idea, but it's an option.

  • We can just clearly document what versions of TS we know we work with – if we do this, we should probably figure out a story to make sure we actually work with the TS versions we claim; that essentially expands our test matrix exponentially with every combination of supported TS and Ember version. My thought here is that we should pick a very small number of TS versions we check – probably just most recent 2 versions (so right now 2.7 and 2.8).

At this point, though, everything here is just my opinions, though, and I'm very interested in the rest of the Typed Ember team's (@dfreeman, @dwickern, and @jamescdavis) takes, as well as broader community input.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions