Skip to content

Conversation

@trivikr
Copy link
Contributor

@trivikr trivikr commented Jan 21, 2021

Issue #, if available:
Fixes: aws/aws-sdk-js-v3#1919

Description of changes:
use downlevel-dts to generate TS 3.4 compatible types for clients in AWS SDK for JavaScript

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr
Copy link
Contributor Author

trivikr commented Jan 21, 2021

aws-sdk-js-v3 aws/aws-sdk-js-v3#1943

@trivikr trivikr requested review from AllanZhengYP and mtdowling and removed request for mtdowling January 22, 2021 18:04
Copy link
Contributor

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

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

Should this be in the AWS repo only? I feel like other SDK implementer should not use this.

@trivikr
Copy link
Contributor Author

trivikr commented Jan 22, 2021

Should this be in the AWS repo only? I feel like other SDK implementer should not use this.

If we put this code in smithy-typescript, it would a recommendation from AWS to support old versions of TypeScript type definitions. And I would like to have that explicit recommendation.

Without this recommendation, the SDK implementers will not be aware that their TypeScript types may not work with old versions of TypeScript. The implementer is always free to remove postbuild script, downlevel-dts dependency and typesVersions key.

@AllanZhengYP
Copy link
Contributor

OK I was assuming the downleveled *.d.ts will be shipped to all users, that will compromise the user experience, until to understand typesVersion. According to the TypeScript doc. The consumers will only use the downleveled *.d.ts when their local TypeScript version is older. The consumers using newer TypeScript can still use the newer features. It's just the built client will generate and be shipped with multiple versions of *.d.ts.

It has some overhead regarding the download package size. But they don't goes to the .js file and it helpers users able to support broader development environments, outweights the drawbacks.

Copy link
Contributor

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

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

Approve again

@trivikr trivikr merged commit 8c51968 into smithy-lang:main Jan 22, 2021
@trivikr trivikr deleted the downlevel-dts branch January 22, 2021 22:01
srchase pushed a commit to srchase/smithy-typescript that referenced this pull request Mar 17, 2023
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.

Typescript 3.7.x breaking @aws-sdk/types

2 participants