aws-xray-sdk-fetch: move tsd from dependencies to devDependencies
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript, typescript
- Domain
- tooling
Research direction
Open sdk_contrib/fetch/package.json and inspect the dependency sections and the test and test-d scripts. Move tsd to the development-only section, then run npm test and npm run test-d and verify a production install no longer includes tsd or its TypeScript tooling.
Written by the indexing model from the issue text.
Description
Summary
sdk_contrib/fetch/package.json declares tsd as a runtime dependency, but tsd is only used to run TypeScript declaration tests via the test and test-d scripts. It is never require()d by any file in lib/.
Impact
tsd@0.28.x transitively pulls in @tsd/typescript (~52 MB) plus a top-level hoisted typescript (~24 MB). Every consumer who runs npm install --production or yarn install --production ships ~80 MB of unused TypeScript compiler binaries with their application.
For AWS Lambda users specifically, this is more than an inconvenience — it can push deployments past Lambda's 250 MB unzipped layer/function limit. We hit this directly.
After installing only aws-xray-sdk-fetch@3.12.0 and its declared dependencies:
node_modules/tsd 1.3 MB
node_modules/@tsd 55 MB (← @tsd/typescript)
node_modules/typescript 24 MB (← hoisted via tsd → typescript)
Verification that tsd is unused at runtime
lib/fetch_p.js only requires:
const AWSXRay = require('aws-xray-sdk-core');
require('./subsegment_fetch');
grep -r "tsd" lib/ returns nothing.
Proposed fix
Move tsd from dependencies to devDependencies in sdk_contrib/fetch/package.json:
- "dependencies": {
- "tsd": "^0.28.1"
- }
+ "devDependencies": {
+ ...,
+ "tsd": "^0.28.1"
+ }
tsd is invoked only via npm test and npm run test-d, both of which run in dev contexts where devDependencies are present.
Happy to open a PR if useful.
- Dominant language
- JavaScript
- Stars
- 280
- Forks
- 157
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-xray-sdk-node
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
aws/aws-xray-sdk-node#760 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
aws/aws-xray-sdk-node#718 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
aws/aws-xray-sdk-node#717 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
aws/aws-xray-sdk-node#716 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
aws/aws-xray-sdk-node#715 · 6 comments ·
All issues in aws/aws-xray-sdk-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·