-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 3.9 #9012
Update to TypeScript 3.9 #9012
Conversation
@@ -472,6 +472,8 @@ export function padStart( | |||
targetLength: number, | |||
padString: string = " " | |||
): string { | |||
// TS doesn't know this code needs to run downlevel sometimes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this change unexpected (TS3.8 should complain as much) but it should complain and so having the expect error is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me, but I'm not seeing any change in our CI build times.
@@ -134,7 +134,7 @@ export class Containers { | |||
}; | |||
} | |||
|
|||
const response = await this.clientContext.create<ContainerRequest>({ | |||
const response = await this.clientContext.create<ContainerRequest, ContainerDefinition>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What changed that made it required to specify ContainerDefinition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requests can specify partitionKey with a string (you can see how it gets expanded above before the request is made.)
The server, however, responds with the object form, which we expect. The create
wrapper defaults to having the input shape match the output shape... which isn't quite correct as we know we've normalized partitionKey already.
The mismatch in types of partitionKey was blowing up when we construct the ContainerResponse
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so TypeScript was complaining as it should have been already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surprised this wasn’t complaining before, but the change and explanation is right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
@@ -134,7 +134,7 @@ export class Containers { | |||
}; | |||
} | |||
|
|||
const response = await this.clientContext.create<ContainerRequest>({ | |||
const response = await this.clientContext.create<ContainerRequest, ContainerDefinition>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so TypeScript was complaining as it should have been already?
@southpolesteve Can you take a look as one of the cosmosdb source files is being edited? |
Cosmos changes are correct |
Thanks @southpolesteve @xirzec Let's wait for someone from the Storage team to sign off as well and then we can merge |
@XiaoningLiu @ljian3377 @jiacfan do you have any feedback on this PR? 😄 |
This PR updates TypeScript to the latest version (3.9) to take advantage of compiler speed improvements.
I also fixed a few minor issues where the compiler was being more strict, such as object spread causing the same property to be written twice to an object.