Repository navigation
Conversation
isaacs
added this pull request to stack #25589
October 20, 2026 22:30
Member
Author
|
Bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b8ffd22. Configure here.
isaacs
marked this pull request as ready for review
October 20, 2026 23:42
isaacs
requested review from
JPeer264 and
mydea
and removed request for
a team
October 20, 2026 23:42
isaacs
force-pushed
the
isaacschlueter/js-3968-common-server-options-create-shared-type
branch
2 times, most recently
from
October 21, 2026 01:12
f6dbbc1 to
b8ffd22
Compare
Node, Deno, Bun and Cloudflare each have their own options for incoming HTTP requests, and the option sets drift. Bun.serve takes only `maxRequestBodySize`, and Cloudflare has no span options. When we add an option to one runtime, nothing reminds us to add it to the others. `ServerRequestOptions` in `@sentry/core/server` lists the options that every incoming request integration should support. Each runtime options type is checked against it with `CheckServerRequestOptions`. The check lists the options that the runtime does not support yet, with a comment that says why. It fails to compile when a shared option is neither declared nor listed, when a listed option is declared, or when a callback written for the shared type does not fit the runtime option. The runtime types do not extend the shared type. With `extends`, a new shared option would appear in every runtime type, supported or not, and nothing would fail to compile. Each runtime keeps its own declarations and docs. Node and Bun now type the request in `ignoreRequestBody` as `RequestOptions & HttpIncomingMessage`. The value was always an `IncomingMessage`. Callbacks typed with `RequestOptions` still compile. The `RequestOptions` part is deprecated, for removal in v12. A new BUGBOT rule flags an incoming request option that applies to more than one runtime but is not in the shared type. There is no runtime behavior change. Fixes JS-3968 Fixes #25570 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
isaacs
force-pushed
the
isaacschlueter/js-3968-common-server-options-create-shared-type
branch
from
October 21, 2026 01:15
b8ffd22 to
80afcb3
Compare
JPeer264
approved these changes
Oct 21, 2026
| HttpOptions, | ||
| HttpIncomingMessage, | ||
| HttpServerResponse, | ||
| // Not supported yet. |
Member
There was a problem hiding this comment.
q: To double check. Going up the PR stack, I see that onSpanEnd is being supported then right? So this is here only temporarily?
Member
There was a problem hiding this comment.
This branch has not been deployed
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.
Node, Deno, Bun and Cloudflare each have their own options for incoming HTTP requests, and the option sets drift. Bun.serve takes only
maxRequestBodySize, and Cloudflare has no span options. When we add an option to one runtime, nothing reminds us to add it to the others.ServerRequestOptionsin@sentry/core/serverlists the options that every incoming request integration should support. Each runtime options type is checked against it withCheckServerRequestOptions. The check lists the options that the runtime does not support yet, with a comment that says why. It fails to compile when a shared option is neither declared nor listed, when a listed option is declared, or when a callback written for the shared type does not fit the runtime option.The runtime types do not extend the shared type. With
extends, a new shared option would appear in every runtime type, supported or not, and nothing would fail to compile. Each runtime keeps its own declarations and docs.Node and Bun now type the request in
ignoreRequestBodyasRequestOptions & HttpIncomingMessage. The value was always anIncomingMessage. Callbacks typed withRequestOptionsstill compile. TheRequestOptionspart is deprecated, for removal in v12.A new BUGBOT rule flags an incoming request option that applies to more than one runtime but is not in the shared type.
There is no runtime behavior change.
Fixes JS-3968
Fixes #25570