Skip to content

Commit b34a37b

Browse files
authored
ref(node): Make RequestData integration default (#5980)
This adds the new `RequestData` integration to the node SDK's default integrations, in order to be able to use it in SDKs besides just nextjs. (It therefore also removes it from the nextjs SDK's specific defaults.) In cases where we haven't yet set up our request handlers to use the integration, the event processor it adds will no-op because it won't find a request object in `sdkProcessingMetadata`.
1 parent c1d9c66 commit b34a37b

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

packages/nextjs/src/index.server.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ function addServerIntegrations(options: NextjsOptions): void {
118118
});
119119
integrations = addOrUpdateIntegration(defaultRewriteFramesIntegration, integrations);
120120

121-
const defaultRequestDataIntegration = new Integrations.RequestData();
122-
integrations = addOrUpdateIntegration(defaultRequestDataIntegration, integrations);
123-
124121
if (hasTracingEnabled(options)) {
125122
const defaultHttpTracingIntegration = new Integrations.Http({ tracing: true });
126123
integrations = addOrUpdateIntegration(defaultHttpTracingIntegration, integrations, {

packages/nextjs/test/index.server.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,8 @@ describe('Server init()', () => {
148148

149149
const nodeInitOptions = nodeInit.mock.calls[0][0] as ModifiedInitOptions;
150150
const rewriteFramesIntegration = findIntegrationByName(nodeInitOptions.integrations, 'RewriteFrames');
151-
const requestDataIntegration = findIntegrationByName(nodeInitOptions.integrations, 'RequestData');
152151

153152
expect(rewriteFramesIntegration).toBeDefined();
154-
expect(requestDataIntegration).toBeDefined();
155153
});
156154

157155
it('supports passing unrelated integrations through options', () => {

packages/node/src/sdk.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
Modules,
2828
OnUncaughtException,
2929
OnUnhandledRejection,
30+
RequestData,
3031
} from './integrations';
3132
import { getModule } from './module';
3233
import { makeNodeTransport } from './transports';
@@ -46,6 +47,7 @@ export const defaultIntegrations = [
4647
new ContextLines(),
4748
new Context(),
4849
new Modules(),
50+
new RequestData(),
4951
// Misc
5052
new LinkedErrors(),
5153
];

0 commit comments

Comments
 (0)