Drop @opentelemetry/api from peerDependencies - #6116
Open
candrewlee14 wants to merge 1 commit into
Open
Conversation
It is a type-only import in src/tracing.ts, and the runtime import is commented out, so `otel` is never assigned and startActiveSpan always takes the `if (!otel) return fn()` path. `tracer` is marked @internal and is not exported from the public entry, so published 1.0.0-rc.1 has no runtime or .d.ts reference to @opentelemetry/api. It is already in devDependencies, so types still resolve when building. Declaring it as an optional peer makes package managers that specialise per peer set install a separate copy of drizzle-orm for each consumer that has a different mix of optional peers installed. TypeScript then treats those copies as unrelated types, so values like SQL stop being assignable between packages. Removing the peer entry drops one cause of that at no cost here.
hknakn
reviewed
Sep 1, 2026
There was a problem hiding this comment.
Verified against main: the @opentelemetry/api import in src/tracing.ts is type-only with the runtime await import commented out, nothing else under drizzle-orm/src references it, and it's already in devDependencies at the same ^1.4.1. No-op at runtime and for published types.
We're hit by the wider issue in #6115 — the expo-sqlite entry puts 76 Expo/RN packages into our Node images. Opened #6219 for that one.
This looks safe to merge on its own.
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
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.
Small one, from #6115.
Why
@opentelemetry/apiis only used for types insrc/tracing.ts, and the runtime import is commented out:So
otelis never assigned andstartActiveSpanalways takes theif (!otel) return fn()path.traceris@internaland isn't exported from the public entry, so published 1.0.0-rc.1 has no runtime or.d.tsreference to it.It's already in
devDependencies, so types still resolve when you build.What it fixes
Listing it as an optional peer makes package managers that install a separate copy per peer combination give each consumer its own copy of drizzle-orm. TypeScript then treats those copies as unrelated, so values like
SQLstop being assignable between packages in a workspace. In ours that was one of the causes of ~50 type errors.This drops one cause of that and costs nothing here.
Scope
Four deleted lines in
drizzle-orm/package.json. No code changes. If you'd rather keep the peer entry for documentation, feel free to close — the other suggestions in #6115 are the larger part.