Skip to content

Commit e4ea7fd

Browse files
nicohrubecisaacscodex
authored
fix(v10/deno): Re-export portable helpers that Cloudflare exposes (#25708)
Backport of: #25491 ## Differences to the original PR - Re-exported the 16 portable helpers already implemented in v10. AI helpers remain in `@sentry/core` on v10; Prisma comes from the existing server-utils dependency. Existing exports retain their current source entry points. - Omitted `instrumentMistralAiClient`, `instrumentTypeSafeClient` and `FlueOptions`, which are absent on v10. - Omitted the SDK refactor and new `initWithoutDefaultIntegrations` / `getDefaultIntegrationsWithoutPerformance` APIs: v10 has a different integration setup. This is the missing-export subset of the original PR, not the new initialization APIs. v10 defaults remain unchanged. - Retained the export regression test for all 16 available helpers; omitted the unavailable type and initialization tests. Fixes #23896 Co-authored-by: isaacs <i@izs.me> Co-authored-by: GPT-6 <codex@openai.com>
1 parent 26744d3 commit e4ea7fd

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

‎packages/deno/src/index.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export type { DenoOptions } from './types';
2626
export {
2727
addEventProcessor,
2828
addBreadcrumb,
29+
addIntegration,
2930
captureException,
3031
captureEvent,
3132
captureMessage,
@@ -52,6 +53,7 @@ export {
5253
setAttribute,
5354
setAttributes,
5455
setUser,
56+
setConversationId,
5557
getSpanStatusFromHttpCode,
5658
setHttpStatus,
5759
withScope,
@@ -69,6 +71,8 @@ export {
6971
startNewTrace,
7072
bindScopeToEmitter,
7173
suppressTracing,
74+
withActiveSpan,
75+
getSpanDescendants,
7276
// eslint-disable-next-line typescript/no-deprecated
7377
inboundFiltersIntegration,
7478
eventFiltersIntegration,
@@ -79,6 +83,7 @@ export {
7983
dedupeIntegration,
8084
extraErrorDataIntegration,
8185
rewriteFramesIntegration,
86+
moduleMetadataIntegration,
8287
supabaseIntegration,
8388
instrumentSupabaseClient,
8489
instrumentPostgresJsSql,
@@ -95,14 +100,26 @@ export {
95100
spanToBaggageHeader,
96101
updateSpanName,
97102
wrapMcpServerWithSentry,
103+
trpcMiddleware,
104+
instrumentOpenAiClient,
105+
instrumentAnthropicAiClient,
106+
instrumentGoogleGenAIClient,
107+
createLangChainCallbackHandler,
108+
instrumentLangChainEmbeddings,
109+
instrumentStateGraph,
110+
instrumentCreateReactAgent,
111+
createConsolaReporter,
98112
featureFlagsIntegration,
113+
growthbookIntegration,
99114
metrics,
100115
withStreamedSpan,
101116
logger,
102117
consoleLoggingIntegration,
103118
spanStreamingIntegration,
104119
} from '@sentry/core';
105120

121+
export { prismaIntegration } from '@sentry/server-utils';
122+
106123
export { DenoClient } from './client';
107124

108125
export { getDefaultIntegrations, init } from './sdk';

‎packages/deno/test/exports.test.ts‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { assertEquals } from 'https://deno.land/std@0.212.0/assert/assert_equals.ts';
2+
import * as Sentry from '../build/esm/index.js';
3+
4+
// Exports that Cloudflare ships and that need no Node APIs.
5+
const EXPECTED_FUNCTION_EXPORTS = [
6+
// @sentry/core
7+
'addIntegration',
8+
'withActiveSpan',
9+
'getSpanDescendants',
10+
'setConversationId',
11+
'createConsolaReporter',
12+
'growthbookIntegration',
13+
'moduleMetadataIntegration',
14+
// @sentry/core/server
15+
'trpcMiddleware',
16+
'prismaIntegration',
17+
'instrumentOpenAiClient',
18+
'instrumentAnthropicAiClient',
19+
'instrumentGoogleGenAIClient',
20+
'createLangChainCallbackHandler',
21+
'instrumentLangChainEmbeddings',
22+
'instrumentStateGraph',
23+
'instrumentCreateReactAgent',
24+
];
25+
26+
for (const name of EXPECTED_FUNCTION_EXPORTS) {
27+
Deno.test(`exports ${name}`, () => {
28+
assertEquals(typeof (Sentry as Record<string, unknown>)[name], 'function');
29+
});
30+
}

0 commit comments

Comments
 (0)