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

feat: use downlevel-dts to generate TS 3.4 compatible types #1943

Merged
merged 4 commits into from
Jan 22, 2021

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Jan 21, 2021

Issue #, if available:
Fixes: #1919

Description of changes:
Use downlevel-dts to generate TS 3.4 compatible types.

Testing:

clients/client-dynamodb
$ ls types                        
commands             endpoints.d.ts  pagination                  runtimeConfig.d.ts         ts3.4
DynamoDBClient.d.ts  index.d.ts      protocols                   runtimeConfig.native.d.ts  waiters
DynamoDB.d.ts        models          runtimeConfig.browser.d.ts  runtimeConfig.shared.d.ts
$ ls types/ts3.4                  
commands             endpoints.d.ts  pagination                  runtimeConfig.d.ts         waiters
DynamoDBClient.d.ts  index.d.ts      protocols                   runtimeConfig.native.d.ts
DynamoDB.d.ts        models          runtimeConfig.browser.d.ts  runtimeConfig.shared.d.ts
packages/types
$ ls types
abort.d.ts    credentials.d.ts  http.d.ts    middleware.d.ts  serde.d.ts      ts3.4
client.d.ts   crypto.d.ts       index.d.ts   pagination.d.ts  signature.d.ts  util.d.ts
command.d.ts  eventStream.d.ts  logger.d.ts  response.d.ts    transfer.d.ts
$ ls types/ts3.4
abort.d.ts    credentials.d.ts  http.d.ts    middleware.d.ts  serde.d.ts      util.d.ts
client.d.ts   crypto.d.ts       index.d.ts   pagination.d.ts  signature.d.ts
command.d.ts  eventStream.d.ts  logger.d.ts  response.d.ts    transfer.d.ts
lib/storage
$ ls types            
data-chunk  index.d.ts  ts3.4  upload  utils
$ ls types/ts3.4 
data-chunk  index.d.ts  upload  utils

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

@trivikr trivikr force-pushed the downlevel-dts-postbuild branch from d8a08ca to 33d6ddb Compare January 21, 2021 19:13
@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: 33d6ddb
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@trivikr trivikr marked this pull request as ready for review January 21, 2021 20:31
@trivikr trivikr changed the title wip: use downlevel-dts to generate TS 3.4 compatible types feat: use downlevel-dts to generate TS 3.4 compatible types Jan 21, 2021
@trivikr
Copy link
Member Author

trivikr commented Jan 21, 2021

smithy-typescript PR smithy-lang/smithy-typescript#266

@AllanZhengYP
Copy link
Contributor

Quote my comment on the Smithy PR for record:

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.

@trivikr trivikr merged commit 63ad215 into aws:master Jan 22, 2021
@trivikr trivikr deleted the downlevel-dts-postbuild branch January 22, 2021 22:01
@github-actions
Copy link

github-actions bot commented Feb 6, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript 3.7.x breaking @aws-sdk/types
3 participants