Skip to content

Conversation

trentm
Copy link
Contributor

@trentm trentm commented Jul 31, 2025

For some background, in #1804 the @types/express dep was removed from instr-express's dependencies after some long discussion. At the time it was moved to a devDep.

However, @types/express isn't used at all in these packages. Can we drop them?
Or is there some slight downside for possible IDE completion when developing express examples or similar in this repo by removing these?

Note that I only bothered looking at these because of this bot PR to update these deps: #2925 (comment)

@trentm trentm self-assigned this Jul 31, 2025
@trentm trentm requested a review from a team as a code owner July 31, 2025 23:42
@github-actions github-actions bot added pkg:instrumentation-express pkg:instrumentation-fastify pkg-status:unmaintained This package is unmaintained. Only bugfixes may be acceped until a new owner has been found. labels Jul 31, 2025
Copy link

codecov bot commented Jul 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.79%. Comparing base (96d1cbb) to head (d5dd6c6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2962      +/-   ##
==========================================
+ Coverage   89.53%   89.79%   +0.25%     
==========================================
  Files         183      188       +5     
  Lines        8985     9295     +310     
  Branches     1867     1907      +40     
==========================================
+ Hits         8045     8346     +301     
- Misses        940      949       +9     

see 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

github-actions bot commented Aug 1, 2025

This package does not have an assigned component owner and is considered unmaintained. As such this package is in feature-freeze and this PR will be closed with 14 days unless a new owner or a sponsor (a member of @open-telemetry/javascript-approvers) for the feature is found. It is the responsibility of the author to find a sponsor for this feature.
Are you familiar with this package? Consider becoming a component owner.

@david-luna
Copy link
Contributor

In @opentelemetry/instrumentation-express the types are used internally

So the compilation step should fail if the types are not present. But if we list where the dependency is

npm ls @types/express
[email protected] /Users/david/Documents/repos/otel/opentelemetry-js-contrib
├─┬ @opentelemetry/[email protected] -> ./packages/instrumentation-express
│ └── @types/[email protected]
├─┬ @opentelemetry/[email protected] -> ./packages/instrumentation-fastify
│ └── @types/[email protected] deduped
└─┬ @opentelemetry/[email protected] -> ./packages/instrumentation-koa
  └─┬ @types/[email protected]
    └─┬ @types/[email protected]
      └── @types/[email protected] deduped

We can see that we get the express types as a dependency from @types/koa so the editor and the compiler can see them because they are installed at the root level. That would explain why compilation succeeds.

IMHO removing @types/express from @opentelemetry/instrumentation-fastify is okay but we should keep them for @opentelemetry/instrumentation-express. @opentelemetry/instrumentation-koa is unlikely to change but there is the possibility @types/koa gets an update that removes the dependency.

@david-luna david-luna added the has:sponsor This package or feature has a sponsor that has volunteered to review PRs and respond to questions label Aug 1, 2025
…dentifying that @types/express *is* used in the test files)
@trentm trentm changed the title chore(instrumentation-express, instrumentation-fastify): drop unused devDep @types/express chore(instrumentation-fastify): drop unused devDep @types/express Aug 11, 2025
@trentm
Copy link
Contributor Author

trentm commented Aug 11, 2025

In @opentelemetry/instrumentation-express the types are used internally

Thanks! Updated.

Copy link
Contributor

@david-luna david-luna left a comment

Choose a reason for hiding this comment

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

Thanks for working on this :)

@trentm trentm enabled auto-merge (squash) August 18, 2025 17:29
@trentm trentm merged commit 3cb0394 into open-telemetry:main Aug 18, 2025
23 checks passed
@trentm trentm deleted the trentm-drop-unused-types-express-devDep branch August 18, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has:sponsor This package or feature has a sponsor that has volunteered to review PRs and respond to questions pkg:instrumentation-fastify pkg-status:unmaintained:autoclose-scheduled pkg-status:unmaintained This package is unmaintained. Only bugfixes may be acceped until a new owner has been found.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants