-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Google feedback on TS 4.5-beta #46665
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
Comments
So the hope here is that you can omit all the type arguments to |
The direct equivalent though is to wrap the multiple type arguments in a tuple. |
@andrewbranch looks like it might be not always that straightforward #46651 |
It seems like type inference with Thanks for clarifying how |
I've tested TS 4.5-rc and the results were identical to TS 4.5-beta with the addition of the following:
Impact summary
The Announced column indicates whether we were able to connect the observed lib.dom.d.ts Changessrc/lib/dom.generated.d.ts has been updated in Update TypeScript DOM Libs The following two changes that update the Compare(MediaRecorderEventMap):
Compare(MediaRecorder):
Exactly how we resolve this error will be determined later. We will likely
|
Hey all, commenting on this thread as it's the only existing one that makes mention of On our team, we upgraded from TS 3.8 to 4.4 and noticed that the |
Looking again, I see that Chromium attaches an |
This GitHub issue contains feedback on the TS 4.5-beta release from the team
that is responsible for keeping Google's internal software working with the
latest version of TypeScript.
Executive summary
4.5.
4.5.
related to the announced changes.
code errors but others will need further inspection.
to unblock the upgrade.
Impact summary
The Announced column indicates whether we were able to connect the observed
change with a section in the
TS4.5-beta announcement.
The following sections give more detailed explanations of the changes listed
above.
Changes which were announced
lib/d.ts Changes
We support the typing improvements. Generally it's clear what's changing.
Our fix will be casting away the errors in existing code.
We observed the following breakdown within this category:
HTMLElement
related breakages : 65%Promise.all Changes
Providing more than 1 parameter to
Promise.all
breaks.Examples:
Promise.all<boolean>
builds successfully.Promise.all<boolean, boolean>
fails - TS2558: Expected 1 type arguments,but got 2.
Promise.all<void, boolean, void>
fails - TS2558: Expected 1 typearguments, but got 3.
Promise.all<string|null, string|null>
fails - TS2558: Expected 1 typearguments, but got 2.
Exactly how we resolve this error will be determined later.
Template String Types Changes
Template string literals are sometimes recognized as a type when explicitly
being cast to a different type.
Example:
return `r${variable1}` as Type1;
fails - TS2352: Conversion of type'r${variable1}' to type 'Type1' may be a mistake because neither type
sufficiently overlaps with the other.
We will likely resolve this error by inserting a cast to
any
for the erroralong with a
TODO
comment containing the error message and a request to theteam owning the code to investigate and make a more correct fix when they can.
Awaited Type Changes
Type inference with
Awaited
fails in some cases.Some of the breakages we have seen look like:
mistake because neither type sufficiently overlaps with the other.
We will likely resolve this error by inserting a cast to
any
for the erroralong with a
TODO
comment containing the error message and a request to theteam owning the code to investigate and make a more correct fix when they can.
Changes which were not announced
Added isTypeOnly attribute to ImportSpecifier and ExportSpecifier in typescript.d.ts
ImportSpecifier
andExportSpecifier
in typescript.d.tshave an added
isTypeOnly
attribute that is not optional. Any code thatincludes calls
createImportSpecifier
,updateImportSpecifier
,createExportSpecifier
,updateExportSpecifier
breaks because of this addedisTypeOnly
parameter. This breaks Angular and our tsickle tool.Compare(ImportSpecifier):
Compare(ExportSpecifier):
Our fix would be adding the
isTypeOnly
parameter to allts.factory.(create/update)(Import/Export)Specifier
calls.The text was updated successfully, but these errors were encountered: