From c60bdb1ddcec053d55a549237c875ec554f1f4d5 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 29 Jan 2024 14:19:23 +0100 Subject: [PATCH 1/2] feat(remix): Add more missing re-exports from `@sentry/node` --- .../node-exports-test-app/scripts/consistentExports.ts | 9 ++++++--- packages/remix/src/index.server.ts | 9 +++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts b/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts index a488ef463412..872819e647d9 100644 --- a/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts +++ b/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts @@ -48,8 +48,11 @@ const DEPENDENTS: Dependent[] = [ { package: '@sentry/remix', exports: Object.keys(SentryRemix), - // TODO: Fix exports in remix - skip: true, + ignoreExports: [ + // Deprecated, no need to add this now to remix + 'getModuleFromFilename', + 'enableAnrDetection', + ], }, { package: '@sentry/serverless', @@ -58,9 +61,9 @@ const DEPENDENTS: Dependent[] = [ // Deprecated, no need to add this now to serverless 'extractTraceparentData', 'getModuleFromFilename', + 'enableAnrDetection', // TODO: Should these be exported from serverless? 'cron', - 'enableAnrDetection', 'runWithAsyncContext', 'hapiErrorPlugin', ], diff --git a/packages/remix/src/index.server.ts b/packages/remix/src/index.server.ts index 457c0e3a523b..46453714c51e 100644 --- a/packages/remix/src/index.server.ts +++ b/packages/remix/src/index.server.ts @@ -39,6 +39,7 @@ export { // eslint-disable-next-line deprecation/deprecation makeMain, setCurrentClient, + NodeClient, Scope, // eslint-disable-next-line deprecation/deprecation startTransaction, @@ -83,6 +84,14 @@ export { isInitialized, cron, parameterize, + metrics, + createGetModuleFromFilename, + functionToStringIntegration, + hapiErrorPlugin, + inboundFiltersIntegration, + linkedErrorsIntegration, + requestDataIntegration, + runWithAsyncContext, } from '@sentry/node'; // Keeping the `*` exports for backwards compatibility and types From ab9cfbc3ceef901f76e1f49eb173632ea751e26f Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 29 Jan 2024 17:02:33 +0100 Subject: [PATCH 2/2] also add deprecated exports --- .../node-exports-test-app/scripts/consistentExports.ts | 8 -------- packages/remix/src/index.server.ts | 4 ++++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts b/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts index 872819e647d9..69eee6df5571 100644 --- a/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts +++ b/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts @@ -22,8 +22,6 @@ const NODE_EXPORTS_IGNORE = [ 'DebugSession', 'AnrIntegrationOptions', 'LocalVariablesIntegrationOptions', - // deprecated - 'spanStatusfromHttpCode', ]; type Dependent = { @@ -43,16 +41,10 @@ const DEPENDENTS: Dependent[] = [ // Next.js doesn't require explicit exports, so we can just merge top level and `default` exports: // @ts-expect-error: `default` is not in the type definition but it's defined exports: Object.keys({ ...SentryNextJs, ...SentryNextJs.default }), - ignoreExports: ['withSentryConfig'], }, { package: '@sentry/remix', exports: Object.keys(SentryRemix), - ignoreExports: [ - // Deprecated, no need to add this now to remix - 'getModuleFromFilename', - 'enableAnrDetection', - ], }, { package: '@sentry/serverless', diff --git a/packages/remix/src/index.server.ts b/packages/remix/src/index.server.ts index 46453714c51e..da1e794690de 100644 --- a/packages/remix/src/index.server.ts +++ b/packages/remix/src/index.server.ts @@ -85,6 +85,8 @@ export { cron, parameterize, metrics, + // eslint-disable-next-line deprecation/deprecation + getModuleFromFilename, createGetModuleFromFilename, functionToStringIntegration, hapiErrorPlugin, @@ -92,6 +94,8 @@ export { linkedErrorsIntegration, requestDataIntegration, runWithAsyncContext, + // eslint-disable-next-line deprecation/deprecation + enableAnrDetection, } from '@sentry/node'; // Keeping the `*` exports for backwards compatibility and types