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

Update to TypeScript 5.6 #7232

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Update to TypeScript 5.6 #7232

wants to merge 4 commits into from

Conversation

wgoehrig
Copy link
Member

@wgoehrig wgoehrig commented Oct 2, 2024

⚠️ This is still a work in progress - currently blocked waiting for a fix to api-extractor (which is also blocking typescript-eslint, another prerequisite).

It's TypeScript update time again!

Since our last update, there have been 3 major TypeScript versions released (remember that TypeScript does not follow semver). As always, the release notes are the best way to catch up on what's changed since 5.3:

Even more than usual, these new versions bring better compiler performance and (especially) better type inferencing. Other highlights include:

  • Regex Syntax Checking - TypeScript can now tell you when you have syntax errors in your regular expressions.
  • Isolated Declarations - We're certainly not ready to opt-in to this new, stricter enforcement for type annotations, but someday this may allow us to fully parallelize the entire monorepo's build!
  • Disallowed Nullish and Truthy Checks - Some expressions that always evaluate either truthy or nullish will now be flagged as errors. Very handy to catch these at compile time since these can be easy mistakes to make.
  • Iterator Helper Methods - This implements support for a very cool new ECMAScript proposal that will make it much easier to work with generators and iterators.

Most of the breaking compiler changes were due to the newly-disallowed nullish and truthy checks affecting some patterns in testing/debugging code. However, better type inferencing also means some new lint errors, and while I'm going to try to hold off on updating ESLint until #7233 there are of course a few lint failures caused just by updating our TypeScript version.

@wgoehrig wgoehrig mentioned this pull request Oct 2, 2024
@@ -373,7 +373,7 @@ export namespace Id64 {

/** Return the first [[Id64String]] of an [[Id64Arg]]. */
export function getFirst(arg: Id64Arg): Id64String {
return typeof arg === "string" ? arg : (Array.isArray(arg) ? arg[0] : arg.values().next().value);
return typeof arg === "string" ? arg : (Array.isArray(arg) ? arg[0] : arg.values().next().value) ?? Id64.invalid;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a big change we need to make sure we are checking against

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

Successfully merging this pull request may close these issues.

2 participants