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

Google feedback on TS 4.8-beta #50272

Closed
frost-cy opened this issue Aug 11, 2022 · 3 comments
Closed

Google feedback on TS 4.8-beta #50272

frost-cy opened this issue Aug 11, 2022 · 3 comments
Labels
Discussion Issues which may not have code impact

Comments

@frost-cy
Copy link

This GitHub issue contains feedback on the TS 4.8-beta release from the team that is responsible for keeping Google's internal software working with the latest version of TypeScript.

Executive summary

  • Some changes to our TypeScript code are required to make it compile with TS 4.8.
  • Detail sections below explain the changes to our code we expect to make to unblock the upgrade.

Impact summary

Change description Announced Libraries affected
Unconstrained Generics No Longer Assignable to {} yes 0.058%
lib/d.ts changes yes 0.013%
Improved Intersection Reduction, Union Compatibility, and Narrowing yes 0.009%
Errors When Comparing Object and Array Literals yes 0.006%
Unclassified - 0.003%

The Announced column indicates whether we were able to connect the observed change with a section in the TS4.8-beta announcement.

The following sections give more detailed explanations of the changes listed above.

Changes which were announced

Unconstrained Generics No Longer Assignable to {}

We see type errors similar to the ones mentioned in the release announcement.

We expect to add extends {} to generic type parameters to fix these issues.

lib/d.ts changes

We support the typing improvements. Generally it's clear what's changing.

These are the most common errors we observed:

  • decorators has been merged with modifiers on the declarations that support decorators.

  • ReadableStreamDefaultReadResult has changed to ReadableStreamReadResult

  • visualViewport is nullable

We expect to add casts to any to silence the error and apply proper fixes over time.

Improved Intersection Reduction, Union Compatibility, and Narrowing

We see type errors related to unknown, NonNullability<T> due to the changes mentioned in release announcement.

We expect to add relevant type cast to fix the issues.

Errors When Comparing Object and Array Literals

We see type errors similar to the ones mentioned in the release announcement.

We expect to add casts to any to silence the error and apply proper fixes over time.

@johnBartos
Copy link

ReadableStreamDefaultReadResult has changed to ReadableStreamReadResult

I also encountered this and didn't see anything mentioned in the release notes, so I'm grateful I found this issue. Would be nice to have these kinds of type changes called out in the future.

@RyanCavanaugh
Copy link
Member

Would be nice to have these kinds of type changes called out in the future.

This is part of the "lib updates"; correctness updates here are generally not considered noteworthy. Was there a false positive?

@johnBartos
Copy link

Would be nice to have these kinds of type changes called out in the future.

This is part of the "lib updates"; correctness updates here are generally not considered noteworthy. Was there a false positive?

Ah understood, I think in general it's not noteworthy. I think this specific issue had some churn because the streams definition was missing in a prior version, then added with the incorrect name, and then fixed in this version. #42970

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Issues which may not have code impact
Projects
None yet
Development

No branches or pull requests

3 participants