-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Deep typescript client imports no longer import all clients #3398
Deep typescript client imports no longer import all clients #3398
Conversation
ConfigurationServicePlaceholders references all clients, this means when a single client is deep imported it still transitively references all clients. The impact of this is TypeScript needs to parse all type definitions in the SDK, and there is no way for a project to avoid this. By separating client config from global config clients can be deep imported without pulling all type definitions in, greatly reducing build time
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@trivikr any chance you could take a look at this. It would make a huge difference to anyone using the aws-sdk in a TypeScript project |
The second commit is just regenerating the clients, ea14d77 contains the functional changes which is pretty small. |
@JakeGinnivan Thank you for the PR! AWS JS SDK team will prioritize reviewing this PR today (8/25) |
FWIW: Before this change one could import This broke one of our users of the aws-sdk, and I had to explicitly bump the dependency in that user. |
Ah apologies, did not think about that. I can put up another PR which re-exports the types from config-base in config fixing the breaking change |
Separates global config from service config
ConfigurationServicePlaceholders references all clients, this means when a single client is deep imported it still transitively references all clients.
The impact of this is TypeScript needs to parse all type definitions in the SDK, and there is no way for a project to avoid this.
By separating client config from global config clients can be deep imported without pulling all type definitions in, greatly reducing build time
Fixes #3034
I created a simple repo demonstrating the issue at https://github.com/JakeGinnivan/aws-sdk-deep-imports. I then used
patch-package
to apply this change directly to node modules, giving me the before/after.For ease of reviewing I have separated the regeneration of the client definitions from the main changes, if you check out the first commit it contains the actual changes.
Example program
Before
After
Checklist
.d.ts
file is updatednpm run add-change