-
Notifications
You must be signed in to change notification settings - Fork 53
fix: add aws-sdk to dependencies #535
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
natdurlik
approved these changes
May 28, 2025
TrevorBurnham
added a commit
to TrevorBurnham/language-server-runtimes
that referenced
this pull request
Aug 23, 2025
This is a second attempt at fixing aws#417. The first attempt was aws#425, which simply moved `aws-sdk` from `dependencies` to `devDependencies`. That change was reverted by aws#535. The reason for the revert was this claim from @suprajaven: > The package is currently not declaring a dependency but it is actually > using aws-sdk. The overall impact is not noted because when used in > conjunction with language servers package ( which has this dependency > present) the overall build is not broken. I believe this is a misunderstanding: The reason the dependency could be safely moved to `devDependencies` is that all of the references to that package were actually just importing types, which means they weren't used at runtime. Here I've gone a step further and replaced the `aws-sdk` dependency with `@types/aws-sdk2-types`. These types were pulled directly from `aws-sdk@2`, so they should match: DefinitelyTyped/DefinitelyTyped#64111 This change ensures that `aws-sdk` won't be used at runtime. As a bonus, it makes this repo's `node_modules` nearly 100MB lighter, which should speed up builds and other development processes.
TrevorBurnham
added a commit
to TrevorBurnham/language-server-runtimes
that referenced
this pull request
Aug 23, 2025
This is a second attempt at fixing aws#417. The first attempt was aws#425, which simply moved `aws-sdk` from `dependencies` to `devDependencies`. That change was reverted by aws#535. The reason for the revert was this claim from @suprajaven: > The package is currently not declaring a dependency but it is actually > using aws-sdk. The overall impact is not noted because when used in > conjunction with language servers package ( which has this dependency > present) the overall build is not broken. I believe this is a misunderstanding: The reason the dependency could be safely moved to `devDependencies` is that all of the references to that package were actually just importing types, which means they weren't used at runtime. Here I've gone a step further and replaced the `aws-sdk` dependency with `@types/aws-sdk2-types`. These types were pulled directly from `aws-sdk@2`, so they should match: DefinitelyTyped/DefinitelyTyped#64111 This change ensures that `aws-sdk` won't be used at runtime. As a bonus, it makes this repo's `node_modules` nearly 100MB lighter, which should speed up builds and other development processes.
TrevorBurnham
added a commit
to TrevorBurnham/language-server-runtimes
that referenced
this pull request
Aug 23, 2025
This is a second attempt at fixing aws#417. The first attempt was aws#425, which moved `aws-sdk` from `dependencies` to `devDependencies`. That change was reverted by aws#535. The `aws-sdk` dependency is only being used for TypeScript types. Including it in `dependencies` rather than `devDependencies` ensures that those types are available to package consumers, at the expense of bringing in a 100MB+ dependency. The solution here is to replace the `aws-sdk` dependency with `@types/aws-sdk2-types`, which is a relatively lightweight 2.3MB. These types should be identical, as they were pulled directly from `aws-sdk`: DefinitelyTyped/DefinitelyTyped#64111 I considered inlining the types with dts-bundle-generator, which would allow `@types/aws-sdk2-types` to be moved to `devDependencies`, but this turned out to be impractical with the current export structure, since the types would have to be inlined separately in each `.d.ts` file that uses them. I would recommend that solution if the package moves to having a single defined entrypoint in the future (perhaps in the next major version).
TrevorBurnham
added a commit
to TrevorBurnham/language-server-runtimes
that referenced
this pull request
Aug 23, 2025
This is a second attempt at fixing aws#417. The first attempt was aws#425, which moved `aws-sdk` from `dependencies` to `devDependencies`. That change was reverted by aws#535. The `aws-sdk` dependency is only being used for TypeScript types. Including it in `dependencies` rather than `devDependencies` ensures that those types are available to package consumers, at the expense of bringing in a 100MB+ dependency. The solution here is to replace the `aws-sdk` dependency with `@types/aws-sdk2-types`, which is a relatively lightweight 2.3MB. These types should be identical, as they were pulled directly from `aws-sdk`: DefinitelyTyped/DefinitelyTyped#64111 I considered inlining the types with dts-bundle-generator, which would allow `@types/aws-sdk2-types` to be moved to `devDependencies`, but this turned out to be impractical with the current export structure, since the types would have to be inlined separately in each `.d.ts` file that uses them. I would recommend that solution if the package moves to having a single defined entrypoint in the future (perhaps in the next major version).
I've opened a new PR to replace the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The package is currently not declaring a dependency but it is actually using aws-sdk. The overall impact is not noted because when used in conjunction with language servers package ( which has this dependency present) the overall build is not broken.
Solution
Add back the dependency.
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.