From d29d8a9899377e45cb5deda1fd65b9b3087336c8 Mon Sep 17 00:00:00 2001 From: chriskrycho Date: Tue, 29 Nov 2022 01:50:54 +0000 Subject: [PATCH 1/2] Advance RFC to Stage ready-for-release --- text/0730-semver-for-ts.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/text/0730-semver-for-ts.md b/text/0730-semver-for-ts.md index 39188ebdd3..be7bdcf8f1 100644 --- a/text/0730-semver-for-ts.md +++ b/text/0730-semver-for-ts.md @@ -1,5 +1,5 @@ --- -stage: accepted +stage: ready-for-release start-date: 2021-03-23T00:00:00.000Z release-date: release-versions: @@ -9,7 +9,7 @@ teams: - data - cli prs: - accepted: https://github.com/emberjs/rfcs/pull/730 + accepted: 'https://github.com/emberjs/rfcs/pull/730' project-link: --- @@ -461,7 +461,7 @@ For functions which return or accept user-constructible types, the rules specifi - a function (including a class constructor or methods) argument *requires a more specific ("narrower") type*, for example if it previously accepted `string | number` but now requires `string`—since the user will have to change some calls to the function ([playground][narrower-argument]) -- a function (including a class constructor or method) *returns a less specific ("wider") type*, for example if it previously returned `string` but now returns `string | null`—since the user's existing handling of the return value will be wrong in some cases ([playground][wider-return]). +- a function (including a class constructor or method) *returns a less specific ("wider") type*, for example if it previously returned `string` but now returns `string |`—since the user's existing handling of the return value will be wrong in some cases ([playground][wider-return]). This includes widening from a *type guard* to a more general check. For example: @@ -621,7 +621,7 @@ Bug fix/patch releases to TypeScript (as described above under [Bug fixes](#bug- Type-checking in TypeScript behaves differently under different “strictness” settings, and the compiler adds more strictness settings over time. Changes to types which are not breaking under looser compiler settings may be breaking under stricter compiler settings. -For example: a package with `strictNullChecks: false` could make a function return type nullable without the compiler reporting it within the package or the package’s type tests. However, as described above, this is a breaking change for consumers which have `strictNullChecks: true`. (By contrast, a *consumer* may disable strictness settings safely: code which type-checks under a stricter setting also type-checks under a less strict setting.) Likewise, with `noUncheckedIndexedAccess: false`, an author could change a type `SomeObj` from `{ a: string }` to `{ [key: string]: string }` and accessing `someObj.a.length` would now error. +For example: a package with `strictNullChecks: false` could make a function return typeable without the compiler reporting it within the package or the package’s type tests. However, as described above, this is a breaking change for consumers which have `strictNullChecks: true`. (By contrast, a *consumer* may disable strictness settings safely: code which type-checks under a stricter setting also type-checks under a less strict setting.) Likewise, with `noUncheckedIndexedAccess: false`, an author could change a type `SomeObj` from `{ a: string }` to `{ [key: string]: string }` and accessing `someObj.a.length` would now error. Accordingly, conforming packages must use `strict: true` in their compiler settings. Additionally, communities may define further strictness settings to which they commit to conform which include “pedantic” strictness settings like `noUncheckedIndexedAccess`. For example, the Ember community might commit to a set of *additional* strictness flags it supports for its own types for any LTS release, published in Ember’s own TypeScript documentation. From dd1653ae0eae8ad247d6b3760f2f4af873544a05 Mon Sep 17 00:00:00 2001 From: "Ember.js RFCS CI" Date: Tue, 29 Nov 2022 01:50:58 +0000 Subject: [PATCH 2/2] Update RFC 0730 ready-for-release PR URL --- text/0730-semver-for-ts.md | 1 + 1 file changed, 1 insertion(+) diff --git a/text/0730-semver-for-ts.md b/text/0730-semver-for-ts.md index be7bdcf8f1..62e4f00dd7 100644 --- a/text/0730-semver-for-ts.md +++ b/text/0730-semver-for-ts.md @@ -10,6 +10,7 @@ teams: - cli prs: accepted: 'https://github.com/emberjs/rfcs/pull/730' + ready-for-release: 'https://github.com/emberjs/rfcs/pull/875' project-link: ---