Skip to content

ref(nextjs/remix): Use buildMetadata from core SDK #7405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/nextjs/src/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hasTracingEnabled } from '@sentry/core';
import { buildMetadata, hasTracingEnabled } from '@sentry/core';
import { RewriteFrames } from '@sentry/integrations';
import type { BrowserOptions } from '@sentry/react';
import { configureScope, init as reactInit, Integrations } from '@sentry/react';
Expand All @@ -7,7 +7,6 @@ import type { EventProcessor } from '@sentry/types';

import { devErrorSymbolicationEventProcessor } from '../common/devErrorSymbolicationEventProcessor';
import { getVercelEnv } from '../common/getVercelEnv';
import { buildMetadata } from '../common/metadata';
import { addOrUpdateIntegration } from '../common/userIntegrations';
import { nextRouterInstrumentation } from './performance';
import { applyTunnelRouteOption } from './tunnelRoute';
Expand Down Expand Up @@ -40,7 +39,7 @@ const globalWithInjectedValues = global as typeof global & {
/** Inits the Sentry NextJS SDK on the browser with the React SDK. */
export function init(options: BrowserOptions): void {
applyTunnelRouteOption(options);
buildMetadata(options, ['nextjs', 'react']);
buildMetadata(options, 'nextjs', ['nextjs', 'react']);

options.environment = options.environment || getVercelEnv(true) || process.env.NODE_ENV;

Expand Down
23 changes: 0 additions & 23 deletions packages/nextjs/src/common/metadata.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/nextjs/src/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Carrier } from '@sentry/core';
import { getHubFromCarrier, getMainCarrier, hasTracingEnabled } from '@sentry/core';
import { buildMetadata, getHubFromCarrier, getMainCarrier, hasTracingEnabled } from '@sentry/core';
import { RewriteFrames } from '@sentry/integrations';
import type { NodeOptions } from '@sentry/node';
import { configureScope, getCurrentHub, init as nodeInit, Integrations } from '@sentry/node';
Expand All @@ -10,7 +10,6 @@ import * as path from 'path';

import { devErrorSymbolicationEventProcessor } from '../common/devErrorSymbolicationEventProcessor';
import { getVercelEnv } from '../common/getVercelEnv';
import { buildMetadata } from '../common/metadata';
import type { IntegrationWithExclusionOption } from '../common/userIntegrations';
import { addOrUpdateIntegration } from '../common/userIntegrations';
import { isBuild } from './utils/isBuild';
Expand Down Expand Up @@ -79,7 +78,7 @@ export function init(options: NodeOptions): void {
return;
}

buildMetadata(options, ['nextjs', 'node']);
buildMetadata(options, 'nextjs', ['nextjs', 'node']);

options.environment =
options.environment || process.env.SENTRY_ENVIRONMENT || getVercelEnv(false) || process.env.NODE_ENV;
Expand Down
4 changes: 2 additions & 2 deletions packages/remix/src/index.client.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/export */
import { buildMetadata } from '@sentry/core';
import { configureScope, init as reactInit, Integrations } from '@sentry/react';

import { buildMetadata } from './utils/metadata';
import type { RemixOptions } from './utils/remixOptions';
export { remixRouterInstrumentation, withSentry } from './performance/client';
export { BrowserTracing } from '@sentry/tracing';
Expand All @@ -10,7 +10,7 @@ export * from '@sentry/react';
export { Integrations };

export function init(options: RemixOptions): void {
buildMetadata(options, ['remix', 'react']);
buildMetadata(options, 'remix', ['remix', 'react']);
options.environment = options.environment || process.env.NODE_ENV;

reactInit(options);
Expand Down
4 changes: 2 additions & 2 deletions packages/remix/src/index.server.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable import/export */
import { buildMetadata } from '@sentry/core';
import { configureScope, getCurrentHub, init as nodeInit } from '@sentry/node';
import { logger } from '@sentry/utils';

import { instrumentServer } from './utils/instrumentServer';
import { buildMetadata } from './utils/metadata';
import type { RemixOptions } from './utils/remixOptions';

export { ErrorBoundary, withErrorBoundary } from '@sentry/react';
Expand All @@ -19,7 +19,7 @@ function sdkAlreadyInitialized(): boolean {

/** Initializes Sentry Remix SDK on Node. */
export function init(options: RemixOptions): void {
buildMetadata(options, ['remix', 'node']);
buildMetadata(options, 'remix', ['remix', 'node']);

if (sdkAlreadyInitialized()) {
__DEBUG_BUILD__ && logger.log('SDK already initialized');
Expand Down
23 changes: 0 additions & 23 deletions packages/remix/src/utils/metadata.ts

This file was deleted.