@sentry/react-router 10.68.0 → 11.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/build/cjs/client/createClientInstrumentation.js +18 -12
  2. package/build/cjs/client/createClientInstrumentation.js.map +1 -1
  3. package/build/cjs/client/hydratedRouter.js +4 -1
  4. package/build/cjs/client/hydratedRouter.js.map +1 -1
  5. package/build/cjs/client/tracingIntegration.js +1 -0
  6. package/build/cjs/client/tracingIntegration.js.map +1 -1
  7. package/build/cjs/client/utils.js +6 -2
  8. package/build/cjs/client/utils.js.map +1 -1
  9. package/build/cjs/index.server.js +0 -4
  10. package/build/cjs/index.server.js.map +1 -1
  11. package/build/cjs/server/createSentryHandleRequest.js.map +1 -1
  12. package/build/cjs/server/createServerInstrumentation.js +71 -65
  13. package/build/cjs/server/createServerInstrumentation.js.map +1 -1
  14. package/build/cjs/server/integration/reactRouterServer.js +1 -40
  15. package/build/cjs/server/integration/reactRouterServer.js.map +1 -1
  16. package/build/cjs/server/serverBuild.js +0 -4
  17. package/build/cjs/server/serverBuild.js.map +1 -1
  18. package/build/cjs/server/serverGlobals.js +0 -9
  19. package/build/cjs/server/serverGlobals.js.map +1 -1
  20. package/build/cjs/vite/buildEnd/handleOnBuildEnd.js +26 -14
  21. package/build/cjs/vite/buildEnd/handleOnBuildEnd.js.map +1 -1
  22. package/build/cjs/vite/makeCustomSentryVitePlugins.js +29 -10
  23. package/build/cjs/vite/makeCustomSentryVitePlugins.js.map +1 -1
  24. package/build/cjs/vite/makeServerBuildCapturePlugin.js +2 -6
  25. package/build/cjs/vite/makeServerBuildCapturePlugin.js.map +1 -1
  26. package/build/cjs/vite/plugin.js +2 -0
  27. package/build/cjs/vite/plugin.js.map +1 -1
  28. package/build/esm/client/createClientInstrumentation.js +20 -14
  29. package/build/esm/client/createClientInstrumentation.js.map +1 -1
  30. package/build/esm/client/hydratedRouter.js +4 -1
  31. package/build/esm/client/hydratedRouter.js.map +1 -1
  32. package/build/esm/client/tracingIntegration.js +1 -0
  33. package/build/esm/client/tracingIntegration.js.map +1 -1
  34. package/build/esm/client/utils.js +7 -3
  35. package/build/esm/client/utils.js.map +1 -1
  36. package/build/esm/index.server.js +0 -2
  37. package/build/esm/index.server.js.map +1 -1
  38. package/build/esm/package.json +1 -1
  39. package/build/esm/server/createSentryHandleRequest.js.map +1 -1
  40. package/build/esm/server/createServerInstrumentation.js +73 -67
  41. package/build/esm/server/createServerInstrumentation.js.map +1 -1
  42. package/build/esm/server/integration/reactRouterServer.js +3 -41
  43. package/build/esm/server/integration/reactRouterServer.js.map +1 -1
  44. package/build/esm/server/serverBuild.js +1 -4
  45. package/build/esm/server/serverBuild.js.map +1 -1
  46. package/build/esm/server/serverGlobals.js +1 -8
  47. package/build/esm/server/serverGlobals.js.map +1 -1
  48. package/build/esm/vite/buildEnd/handleOnBuildEnd.js +26 -14
  49. package/build/esm/vite/buildEnd/handleOnBuildEnd.js.map +1 -1
  50. package/build/esm/vite/makeCustomSentryVitePlugins.js +28 -9
  51. package/build/esm/vite/makeCustomSentryVitePlugins.js.map +1 -1
  52. package/build/esm/vite/makeServerBuildCapturePlugin.js +2 -6
  53. package/build/esm/vite/makeServerBuildCapturePlugin.js.map +1 -1
  54. package/build/esm/vite/plugin.js +2 -0
  55. package/build/esm/vite/plugin.js.map +1 -1
  56. package/build/types/client/createClientInstrumentation.d.ts.map +1 -1
  57. package/build/types/client/hydratedRouter.d.ts.map +1 -1
  58. package/build/types/client/tracingIntegration.d.ts.map +1 -1
  59. package/build/types/client/utils.d.ts.map +1 -1
  60. package/build/types/index.types.d.ts +1 -0
  61. package/build/types/index.types.d.ts.map +1 -1
  62. package/build/types/server/createSentryHandleRequest.d.ts.map +1 -1
  63. package/build/types/server/createServerInstrumentation.d.ts.map +1 -1
  64. package/build/types/server/index.d.ts +0 -2
  65. package/build/types/server/index.d.ts.map +1 -1
  66. package/build/types/server/integration/reactRouterServer.d.ts +0 -3
  67. package/build/types/server/integration/reactRouterServer.d.ts.map +1 -1
  68. package/build/types/server/serverGlobals.d.ts +0 -10
  69. package/build/types/server/serverGlobals.d.ts.map +1 -1
  70. package/build/types/vite/buildEnd/handleOnBuildEnd.d.ts.map +1 -1
  71. package/build/types/vite/makeCustomSentryVitePlugins.d.ts.map +1 -1
  72. package/build/types/vite/makeServerBuildCapturePlugin.d.ts.map +1 -1
  73. package/build/types/vite/plugin.d.ts.map +1 -1
  74. package/build/types/vite/types.d.ts +1 -1
  75. package/build/types/vite/types.d.ts.map +1 -1
  76. package/package.json +14 -14
  77. package/build/cjs/server/instrumentation/reactRouter.js +0 -106
  78. package/build/cjs/server/instrumentation/reactRouter.js.map +0 -1
  79. package/build/cjs/server/instrumentation/util.js +0 -24
  80. package/build/cjs/server/instrumentation/util.js.map +0 -1
  81. package/build/cjs/server/wrapServerAction.js +0 -56
  82. package/build/cjs/server/wrapServerAction.js.map +0 -1
  83. package/build/cjs/server/wrapServerLoader.js +0 -56
  84. package/build/cjs/server/wrapServerLoader.js.map +0 -1
  85. package/build/esm/server/instrumentation/reactRouter.js +0 -104
  86. package/build/esm/server/instrumentation/reactRouter.js.map +0 -1
  87. package/build/esm/server/instrumentation/util.js +0 -18
  88. package/build/esm/server/instrumentation/util.js.map +0 -1
  89. package/build/esm/server/wrapServerAction.js +0 -54
  90. package/build/esm/server/wrapServerAction.js.map +0 -1
  91. package/build/esm/server/wrapServerLoader.js +0 -54
  92. package/build/esm/server/wrapServerLoader.js.map +0 -1
  93. package/build/types/server/instrumentation/reactRouter.d.ts +0 -19
  94. package/build/types/server/instrumentation/reactRouter.d.ts.map +0 -1
  95. package/build/types/server/instrumentation/util.d.ts +0 -31
  96. package/build/types/server/instrumentation/util.d.ts.map +0 -1
  97. package/build/types/server/wrapServerAction.d.ts +0 -33
  98. package/build/types/server/wrapServerAction.d.ts.map +0 -1
  99. package/build/types/server/wrapServerLoader.d.ts +0 -33
  100. package/build/types/server/wrapServerLoader.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { sentryVitePlugin } from '@sentry/vite-plugin';
1
+ import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';
2
2
 
3
3
  async function makeCustomSentryVitePlugins(options) {
4
4
  const {
@@ -13,6 +13,14 @@ async function makeCustomSentryVitePlugins(options) {
13
13
  reactComponentAnnotation,
14
14
  release
15
15
  } = options;
16
+ const unstableSourcemapsDisable = unstable_sentryVitePluginOptions?.sourcemaps?.disable;
17
+ if (unstableSourcemapsDisable !== void 0 && unstableSourcemapsDisable !== true) {
18
+ console.warn(
19
+ `[Sentry] \`unstable_sentryVitePluginOptions.sourcemaps.disable: ${JSON.stringify(
20
+ unstableSourcemapsDisable
21
+ )}\` does not apply to the Vite plugin. Debug ID injection and source map upload are handled by the \`sentryOnBuildEnd\` hook for React Router, so letting the Vite plugin do it as well would inject a second debug ID per chunk. The option still applies to \`sentryOnBuildEnd\`.`
22
+ );
23
+ }
16
24
  const sentryVitePlugins = sentryVitePlugin({
17
25
  applicationKey,
18
26
  authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
@@ -21,27 +29,38 @@ async function makeCustomSentryVitePlugins(options) {
21
29
  org: org ?? process.env.SENTRY_ORG,
22
30
  project: project ?? process.env.SENTRY_PROJECT,
23
31
  telemetry: telemetry ?? true,
32
+ // Spread here so it can override the plain options above, but not the objects
33
+ // merged below - object spread replaces whole keys rather than deep-merging.
34
+ ...unstable_sentryVitePluginOptions,
24
35
  _metaOptions: {
36
+ ...unstable_sentryVitePluginOptions?._metaOptions,
25
37
  telemetry: {
38
+ ...unstable_sentryVitePluginOptions?._metaOptions?.telemetry,
26
39
  metaFramework: "react-router"
27
- },
28
- ...unstable_sentryVitePluginOptions?._metaOptions
40
+ }
29
41
  },
30
42
  reactComponentAnnotation: {
31
- enabled: reactComponentAnnotation?.enabled ?? void 0,
32
- ignoredComponents: reactComponentAnnotation?.ignoredComponents ?? void 0,
43
+ // Only assign when set, as an explicit `undefined` would erase the unstable value
44
+ ...reactComponentAnnotation?.enabled !== void 0 && { enabled: reactComponentAnnotation.enabled },
45
+ ...reactComponentAnnotation?.ignoredComponents !== void 0 && {
46
+ ignoredComponents: reactComponentAnnotation.ignoredComponents
47
+ },
33
48
  ...unstable_sentryVitePluginOptions?.reactComponentAnnotation
34
49
  },
35
50
  release: {
36
51
  ...unstable_sentryVitePluginOptions?.release,
37
52
  ...release
38
53
  },
39
- // will be handled in buildEnd hook
40
54
  sourcemaps: {
55
+ ...unstable_sentryVitePluginOptions?.sourcemaps,
56
+ // Injection and upload are handled in the buildEnd hook, so the Vite plugin must
57
+ // never do it too. This is deliberately not overridable - see the warning above.
41
58
  disable: true,
42
- ...unstable_sentryVitePluginOptions?.sourcemaps
43
- },
44
- ...unstable_sentryVitePluginOptions
59
+ // The plugin deletes these in a `finally` block that runs regardless of `disable`,
60
+ // which would remove the maps before `sentryOnBuildEnd` gets to upload them.
61
+ // Deletion is handled there instead, from the same option.
62
+ filesToDeleteAfterUpload: void 0
63
+ }
45
64
  });
46
65
  return sentryVitePlugins;
47
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"makeCustomSentryVitePlugins.js","sources":["../../../src/vite/makeCustomSentryVitePlugins.ts"],"sourcesContent":["import { sentryVitePlugin } from '@sentry/vite-plugin';\nimport { type Plugin } from 'vite';\nimport type { SentryReactRouterBuildOptions } from './types';\n\n/**\n * Create a custom subset of sentry's vite plugins\n */\nexport async function makeCustomSentryVitePlugins(options: SentryReactRouterBuildOptions): Promise<Plugin[]> {\n const {\n debug,\n unstable_sentryVitePluginOptions,\n bundleSizeOptimizations,\n applicationKey,\n authToken,\n org,\n project,\n telemetry,\n reactComponentAnnotation,\n release,\n } = options;\n\n const sentryVitePlugins = sentryVitePlugin({\n applicationKey,\n authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,\n bundleSizeOptimizations,\n debug: debug ?? false,\n org: org ?? process.env.SENTRY_ORG,\n project: project ?? process.env.SENTRY_PROJECT,\n telemetry: telemetry ?? true,\n _metaOptions: {\n telemetry: {\n metaFramework: 'react-router',\n },\n ...unstable_sentryVitePluginOptions?._metaOptions,\n },\n reactComponentAnnotation: {\n enabled: reactComponentAnnotation?.enabled ?? undefined,\n ignoredComponents: reactComponentAnnotation?.ignoredComponents ?? undefined,\n ...unstable_sentryVitePluginOptions?.reactComponentAnnotation,\n },\n release: {\n ...unstable_sentryVitePluginOptions?.release,\n ...release,\n },\n // will be handled in buildEnd hook\n sourcemaps: {\n disable: true,\n ...unstable_sentryVitePluginOptions?.sourcemaps,\n },\n ...unstable_sentryVitePluginOptions,\n }) as Plugin[];\n\n return sentryVitePlugins;\n}\n"],"names":[],"mappings":";;AAOA,eAAsB,4BAA4B,OAAA,EAA2D;AAC3G,EAAA,MAAM;AAAA,IACJ,KAAA;AAAA,IACA,gCAAA;AAAA,IACA,uBAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA;AAAA,IACA,GAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,wBAAA;AAAA,IACA;AAAA,GACF,GAAI,OAAA;AAEJ,EAAA,MAAM,oBAAoB,gBAAA,CAAiB;AAAA,IACzC,cAAA;AAAA,IACA,SAAA,EAAW,SAAA,IAAa,OAAA,CAAQ,GAAA,CAAI,iBAAA;AAAA,IACpC,uBAAA;AAAA,IACA,OAAO,KAAA,IAAS,KAAA;AAAA,IAChB,GAAA,EAAK,GAAA,IAAO,OAAA,CAAQ,GAAA,CAAI,UAAA;AAAA,IACxB,OAAA,EAAS,OAAA,IAAW,OAAA,CAAQ,GAAA,CAAI,cAAA;AAAA,IAChC,WAAW,SAAA,IAAa,IAAA;AAAA,IACxB,YAAA,EAAc;AAAA,MACZ,SAAA,EAAW;AAAA,QACT,aAAA,EAAe;AAAA,OACjB;AAAA,MACA,GAAG,gCAAA,EAAkC;AAAA,KACvC;AAAA,IACA,wBAAA,EAA0B;AAAA,MACxB,OAAA,EAAS,0BAA0B,OAAA,IAAW,MAAA;AAAA,MAC9C,iBAAA,EAAmB,0BAA0B,iBAAA,IAAqB,MAAA;AAAA,MAClE,GAAG,gCAAA,EAAkC;AAAA,KACvC;AAAA,IACA,OAAA,EAAS;AAAA,MACP,GAAG,gCAAA,EAAkC,OAAA;AAAA,MACrC,GAAG;AAAA,KACL;AAAA;AAAA,IAEA,UAAA,EAAY;AAAA,MACV,OAAA,EAAS,IAAA;AAAA,MACT,GAAG,gCAAA,EAAkC;AAAA,KACvC;AAAA,IACA,GAAG;AAAA,GACJ,CAAA;AAED,EAAA,OAAO,iBAAA;AACT;;;;"}
1
+ {"version":3,"file":"makeCustomSentryVitePlugins.js","sources":["../../../src/vite/makeCustomSentryVitePlugins.ts"],"sourcesContent":["import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';\nimport { type Plugin } from 'vite';\nimport type { SentryReactRouterBuildOptions } from './types';\n\n/**\n * Create a custom subset of sentry's vite plugins\n */\nexport async function makeCustomSentryVitePlugins(options: SentryReactRouterBuildOptions): Promise<Plugin[]> {\n const {\n debug,\n unstable_sentryVitePluginOptions,\n bundleSizeOptimizations,\n applicationKey,\n authToken,\n org,\n project,\n telemetry,\n reactComponentAnnotation,\n release,\n } = options;\n\n const unstableSourcemapsDisable = unstable_sentryVitePluginOptions?.sourcemaps?.disable;\n\n // Anything other than `true` would have the Vite plugin inject debug IDs on top of the\n // ones `sentryOnBuildEnd` injects, which breaks source map resolution. The value still\n // applies to the buildEnd hook - only the Vite plugin ignores it.\n if (unstableSourcemapsDisable !== undefined && unstableSourcemapsDisable !== true) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] \\`unstable_sentryVitePluginOptions.sourcemaps.disable: ${JSON.stringify(\n unstableSourcemapsDisable,\n )}\\` does not apply to the Vite plugin. Debug ID injection and source map upload are handled by the \\`sentryOnBuildEnd\\` hook for React Router, so letting the Vite plugin do it as well would inject a second debug ID per chunk. The option still applies to \\`sentryOnBuildEnd\\`.`,\n );\n }\n\n const sentryVitePlugins = sentryVitePlugin({\n applicationKey,\n authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,\n bundleSizeOptimizations,\n debug: debug ?? false,\n org: org ?? process.env.SENTRY_ORG,\n project: project ?? process.env.SENTRY_PROJECT,\n telemetry: telemetry ?? true,\n // Spread here so it can override the plain options above, but not the objects\n // merged below - object spread replaces whole keys rather than deep-merging.\n ...unstable_sentryVitePluginOptions,\n _metaOptions: {\n ...unstable_sentryVitePluginOptions?._metaOptions,\n telemetry: {\n ...unstable_sentryVitePluginOptions?._metaOptions?.telemetry,\n metaFramework: 'react-router',\n },\n },\n reactComponentAnnotation: {\n // Only assign when set, as an explicit `undefined` would erase the unstable value\n ...(reactComponentAnnotation?.enabled !== undefined && { enabled: reactComponentAnnotation.enabled }),\n ...(reactComponentAnnotation?.ignoredComponents !== undefined && {\n ignoredComponents: reactComponentAnnotation.ignoredComponents,\n }),\n ...unstable_sentryVitePluginOptions?.reactComponentAnnotation,\n },\n release: {\n ...unstable_sentryVitePluginOptions?.release,\n ...release,\n },\n sourcemaps: {\n ...unstable_sentryVitePluginOptions?.sourcemaps,\n // Injection and upload are handled in the buildEnd hook, so the Vite plugin must\n // never do it too. This is deliberately not overridable - see the warning above.\n disable: true,\n // The plugin deletes these in a `finally` block that runs regardless of `disable`,\n // which would remove the maps before `sentryOnBuildEnd` gets to upload them.\n // Deletion is handled there instead, from the same option.\n filesToDeleteAfterUpload: undefined,\n },\n }) as Plugin[];\n\n return sentryVitePlugins;\n}\n"],"names":[],"mappings":";;AAOA,eAAsB,4BAA4B,OAAA,EAA2D;AAC3G,EAAA,MAAM;AAAA,IACJ,KAAA;AAAA,IACA,gCAAA;AAAA,IACA,uBAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA;AAAA,IACA,GAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,wBAAA;AAAA,IACA;AAAA,GACF,GAAI,OAAA;AAEJ,EAAA,MAAM,yBAAA,GAA4B,kCAAkC,UAAA,EAAY,OAAA;AAK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;AAAA;AAAA,MAIT,wBAAA,EAA0B;AAAA;AAC5B,GACD,CAAA;AAED,EAAA,OAAO,iBAAA;AACT;;;;"}
@@ -2,15 +2,11 @@ import { GLOBAL_KEY } from '../server/serverBuild.js';
2
2
 
3
3
  const SERVER_BUILD_MODULE_ID = "virtual:react-router/server-build";
4
4
  function makeServerBuildCapturePlugin() {
5
- let isSsrBuild = false;
6
5
  return {
7
6
  name: "sentry-react-router-server-build-capture",
8
7
  enforce: "post",
9
- configResolved(config) {
10
- isSsrBuild = !!config.build.ssr;
11
- },
12
- transform(code, id) {
13
- if (!isSsrBuild) {
8
+ transform(code, id, options) {
9
+ if (!options?.ssr) {
14
10
  return null;
15
11
  }
16
12
  if (!id.includes(SERVER_BUILD_MODULE_ID)) {
@@ -1 +1 @@
1
- {"version":3,"file":"makeServerBuildCapturePlugin.js","sources":["../../../src/vite/makeServerBuildCapturePlugin.ts"],"sourcesContent":["import { type Plugin } from 'vite';\nimport { GLOBAL_KEY } from '../server/serverBuild';\n\nconst SERVER_BUILD_MODULE_ID = 'virtual:react-router/server-build';\n\n/**\n * A Sentry plugin for React Router to capture the server build for middleware name resolution.\n */\nexport function makeServerBuildCapturePlugin(): Plugin {\n let isSsrBuild = false;\n\n return {\n name: 'sentry-react-router-server-build-capture',\n enforce: 'post',\n\n configResolved(config) {\n isSsrBuild = !!config.build.ssr;\n },\n\n transform(code, id) {\n if (!isSsrBuild) {\n return null;\n }\n\n if (!id.includes(SERVER_BUILD_MODULE_ID)) {\n return null;\n }\n\n // `routes` is a module-scope export in the virtual:react-router/server-build module\n const injectedCode = `${code}\nif (typeof globalThis !== 'undefined' && typeof globalThis[\"${GLOBAL_KEY}\"] === 'function') {\n globalThis[\"${GLOBAL_KEY}\"]({ routes });\n}\n`;\n\n return { code: injectedCode, map: null };\n },\n };\n}\n"],"names":[],"mappings":";;AAGA,MAAM,sBAAA,GAAyB,mCAAA;AAKxB,SAAS,4BAAA,GAAuC;AACrD,EAAA,IAAI,UAAA,GAAa,KAAA;AAEjB,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,0CAAA;AAAA,IACN,OAAA,EAAS,MAAA;AAAA,IAET,eAAe,MAAA,EAAQ;AACrB,MAAA,UAAA,GAAa,CAAC,CAAC,MAAA,CAAO,KAAA,CAAM,GAAA;AAAA,IAC9B,CAAA;AAAA,IAEA,SAAA,CAAU,MAAM,EAAA,EAAI;AAClB,MAAA,IAAI,CAAC,UAAA,EAAY;AACf,QAAA,OAAO,IAAA;AAAA,MACT;AAEA,MAAA,IAAI,CAAC,EAAA,CAAG,QAAA,CAAS,sBAAsB,CAAA,EAAG;AACxC,QAAA,OAAO,IAAA;AAAA,MACT;AAGA,MAAA,MAAM,YAAA,GAAe,GAAG,IAAI;AAAA,4DAAA,EAC4B,UAAU,CAAA;AAAA,cAAA,EACxD,UAAU,CAAA;AAAA;AAAA,CAAA;AAIpB,MAAA,OAAO,EAAE,IAAA,EAAM,YAAA,EAAc,GAAA,EAAK,IAAA,EAAK;AAAA,IACzC;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"makeServerBuildCapturePlugin.js","sources":["../../../src/vite/makeServerBuildCapturePlugin.ts"],"sourcesContent":["import { type Plugin } from 'vite';\nimport { GLOBAL_KEY } from '../server/serverBuild';\n\nconst SERVER_BUILD_MODULE_ID = 'virtual:react-router/server-build';\n\n/**\n * A Sentry plugin for React Router to capture the server build for middleware name resolution.\n */\nexport function makeServerBuildCapturePlugin(): Plugin {\n return {\n name: 'sentry-react-router-server-build-capture',\n enforce: 'post',\n\n transform(code, id, options) {\n // Only inject into the server build module when transforming for the SSR environment.\n // `options.ssr` is set for the SSR module in both dev (`react-router dev`) and production\n // builds, so this covers both - unlike `config.build.ssr`, which is only true during a build.\n if (!options?.ssr) {\n return null;\n }\n\n if (!id.includes(SERVER_BUILD_MODULE_ID)) {\n return null;\n }\n\n // `routes` is a module-scope export in the virtual:react-router/server-build module\n const injectedCode = `${code}\nif (typeof globalThis !== 'undefined' && typeof globalThis[\"${GLOBAL_KEY}\"] === 'function') {\n globalThis[\"${GLOBAL_KEY}\"]({ routes });\n}\n`;\n\n return { code: injectedCode, map: null };\n },\n };\n}\n"],"names":[],"mappings":";;AAGA,MAAM,sBAAA,GAAyB,mCAAA;AAKxB,SAAS,4BAAA,GAAuC;AACrD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,0CAAA;AAAA,IACN,OAAA,EAAS,MAAA;AAAA,IAET,SAAA,CAAU,IAAA,EAAM,EAAA,EAAI,OAAA,EAAS;AAI3B,MAAA,IAAI,CAAC,SAAS,GAAA,EAAK;AACjB,QAAA,OAAO,IAAA;AAAA,MACT;AAEA,MAAA,IAAI,CAAC,EAAA,CAAG,QAAA,CAAS,sBAAsB,CAAA,EAAG;AACxC,QAAA,OAAO,IAAA;AAAA,MACT;AAGA,MAAA,MAAM,YAAA,GAAe,GAAG,IAAI;AAAA,4DAAA,EAC4B,UAAU,CAAA;AAAA,cAAA,EACxD,UAAU,CAAA;AAAA;AAAA,CAAA;AAIpB,MAAA,OAAO,EAAE,IAAA,EAAM,YAAA,EAAc,GAAA,EAAK,IAAA,EAAK;AAAA,IACzC;AAAA,GACF;AACF;;;;"}
@@ -1,3 +1,4 @@
1
+ import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';
1
2
  import { makeConfigInjectorPlugin } from './makeConfigInjectorPlugin.js';
2
3
  import { makeCustomSentryVitePlugins } from './makeCustomSentryVitePlugins.js';
3
4
  import { makeEnableSourceMapsPlugin } from './makeEnableSourceMapsPlugin.js';
@@ -8,6 +9,7 @@ async function sentryReactRouter(options = {}, viteConfig) {
8
9
  plugins.push(makeConfigInjectorPlugin(options));
9
10
  plugins.push(makeServerBuildCapturePlugin());
10
11
  if (process.env.NODE_ENV !== "development" && viteConfig.command === "build" && viteConfig.mode !== "development") {
12
+ plugins.push(sentryOrchestrionPlugin({ buildTimeInstrumentation: options.buildTimeInstrumentation }));
11
13
  plugins.push(makeEnableSourceMapsPlugin(options));
12
14
  plugins.push(...await makeCustomSentryVitePlugins(options));
13
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["../../../src/vite/plugin.ts"],"sourcesContent":["import type { ConfigEnv, Plugin } from 'vite';\nimport { makeConfigInjectorPlugin } from './makeConfigInjectorPlugin';\nimport { makeCustomSentryVitePlugins } from './makeCustomSentryVitePlugins';\nimport { makeEnableSourceMapsPlugin } from './makeEnableSourceMapsPlugin';\nimport { makeServerBuildCapturePlugin } from './makeServerBuildCapturePlugin';\nimport type { SentryReactRouterBuildOptions } from './types';\n\n/**\n * A Vite plugin for Sentry that handles source map uploads and bundle size optimizations.\n *\n * @param options - Configuration options for the Sentry Vite plugin\n * @param viteConfig - The Vite user config object\n * @returns An array of Vite plugins\n */\nexport async function sentryReactRouter(\n options: SentryReactRouterBuildOptions = {},\n viteConfig: ConfigEnv,\n): Promise<Plugin[]> {\n const plugins: Plugin[] = [];\n\n plugins.push(makeConfigInjectorPlugin(options));\n plugins.push(makeServerBuildCapturePlugin());\n\n if (process.env.NODE_ENV !== 'development' && viteConfig.command === 'build' && viteConfig.mode !== 'development') {\n plugins.push(makeEnableSourceMapsPlugin(options));\n plugins.push(...(await makeCustomSentryVitePlugins(options)));\n }\n\n return plugins;\n}\n"],"names":[],"mappings":";;;;;AAcA,eAAsB,iBAAA,CACpB,OAAA,GAAyC,EAAC,EAC1C,UAAA,EACmB;AACnB,EAAA,MAAM,UAAoB,EAAC;AAE3B,EAAA,OAAA,CAAQ,IAAA,CAAK,wBAAA,CAAyB,OAAO,CAAC,CAAA;AAC9C,EAAA,OAAA,CAAQ,IAAA,CAAK,8BAA8B,CAAA;AAE3C,EAAA,IAAI,OAAA,CAAQ,IAAI,QAAA,KAAa,aAAA,IAAiB,WAAW,OAAA,KAAY,OAAA,IAAW,UAAA,CAAW,IAAA,KAAS,aAAA,EAAe;AACjH,IAAA,OAAA,CAAQ,IAAA,CAAK,0BAAA,CAA2B,OAAO,CAAC,CAAA;AAChD,IAAA,OAAA,CAAQ,IAAA,CAAK,GAAI,MAAM,2BAAA,CAA4B,OAAO,CAAE,CAAA;AAAA,EAC9D;AAEA,EAAA,OAAO,OAAA;AACT;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["../../../src/vite/plugin.ts"],"sourcesContent":["import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';\nimport type { ConfigEnv, Plugin } from 'vite';\nimport { makeConfigInjectorPlugin } from './makeConfigInjectorPlugin';\nimport { makeCustomSentryVitePlugins } from './makeCustomSentryVitePlugins';\nimport { makeEnableSourceMapsPlugin } from './makeEnableSourceMapsPlugin';\nimport { makeServerBuildCapturePlugin } from './makeServerBuildCapturePlugin';\nimport type { SentryReactRouterBuildOptions } from './types';\n\n/**\n * A Vite plugin for Sentry that handles source map uploads and bundle size optimizations.\n *\n * @param options - Configuration options for the Sentry Vite plugin\n * @param viteConfig - The Vite user config object\n * @returns An array of Vite plugins\n */\nexport async function sentryReactRouter(\n options: SentryReactRouterBuildOptions = {},\n viteConfig: ConfigEnv,\n): Promise<Plugin[]> {\n const plugins: Plugin[] = [];\n\n plugins.push(makeConfigInjectorPlugin(options));\n plugins.push(makeServerBuildCapturePlugin());\n\n if (process.env.NODE_ENV !== 'development' && viteConfig.command === 'build' && viteConfig.mode !== 'development') {\n plugins.push(sentryOrchestrionPlugin({ buildTimeInstrumentation: options.buildTimeInstrumentation }));\n plugins.push(makeEnableSourceMapsPlugin(options));\n plugins.push(...(await makeCustomSentryVitePlugins(options)));\n }\n\n return plugins;\n}\n"],"names":[],"mappings":";;;;;;AAeA,eAAsB,iBAAA,CACpB,OAAA,GAAyC,EAAC,EAC1C,UAAA,EACmB;AACnB,EAAA,MAAM,UAAoB,EAAC;AAE3B,EAAA,OAAA,CAAQ,IAAA,CAAK,wBAAA,CAAyB,OAAO,CAAC,CAAA;AAC9C,EAAA,OAAA,CAAQ,IAAA,CAAK,8BAA8B,CAAA;AAE3C,EAAA,IAAI,OAAA,CAAQ,IAAI,QAAA,KAAa,aAAA,IAAiB,WAAW,OAAA,KAAY,OAAA,IAAW,UAAA,CAAW,IAAA,KAAS,aAAA,EAAe;AACjH,IAAA,OAAA,CAAQ,KAAK,uBAAA,CAAwB,EAAE,0BAA0B,OAAA,CAAQ,wBAAA,EAA0B,CAAC,CAAA;AACpG,IAAA,OAAA,CAAQ,IAAA,CAAK,0BAAA,CAA2B,OAAO,CAAC,CAAA;AAChD,IAAA,OAAA,CAAQ,IAAA,CAAK,GAAI,MAAM,2BAAA,CAA4B,OAAO,CAAE,CAAA;AAAA,EAC9D;AAEA,EAAA,OAAO,OAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createClientInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/client/createClientInstrumentation.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,qBAAqB,EAA6C,MAAM,iBAAiB,CAAC;AA+BxG;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,wCAA6C,GACrD,qBAAqB,CAkSvB;AA0BD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
1
+ {"version":3,"file":"createClientInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/client/createClientInstrumentation.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,qBAAqB,EAA6C,MAAM,iBAAiB,CAAC;AAgCxG;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,wCAA6C,GACrD,qBAAqB,CAuSvB;AA0BD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"hydratedRouter.d.ts","sourceRoot":"","sources":["../../../src/client/hydratedRouter.ts"],"names":[],"mappings":"AAkCA;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAoI/C"}
1
+ {"version":3,"file":"hydratedRouter.d.ts","sourceRoot":"","sources":["../../../src/client/hydratedRouter.ts"],"names":[],"mappings":"AAkCA;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAuI/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"tracingIntegration.d.ts","sourceRoot":"","sources":["../../../src/client/tracingIntegration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAEL,KAAK,wCAAwC,EAC9C,MAAM,+BAA+B,CAAC;AAGvC;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACnD;;OAEG;IACH,sBAAsB,CAAC,EAAE,wCAAwC,CAAC;IAElE,uHAAuH;IACvH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE;;;;;;OAMG;IACH,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;CACvD;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,oCAAyC,GACjD,6BAA6B,CAqB/B"}
1
+ {"version":3,"file":"tracingIntegration.d.ts","sourceRoot":"","sources":["../../../src/client/tracingIntegration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAEL,KAAK,wCA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IAAI,GAAG,IAAI,CAOzE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/client/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,cAAc,CAAC;AAQ5D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAc1D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAU1D;AA0BD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CASvF;AAED;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAcpE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAGtE;AAED;;;;;;;GAOG;AACH,wBAAgB,qCAAqC,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,CAoBhG;AAED;;;GAGG;AACH,wBAAgB,wCAAwC,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAOzE"}
@@ -9,6 +9,7 @@ export declare function init(options: Options | clientSdk.BrowserOptions | serve
9
9
  export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
10
10
  export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
11
11
  export declare const spanStreamingIntegration: typeof clientSdk.spanStreamingIntegration;
12
+ export declare const withStaticSpan: typeof clientSdk.withStaticSpan;
12
13
  export declare const withStreamedSpan: typeof clientSdk.withStreamedSpan;
13
14
  export declare const defaultStackParser: StackParser;
14
15
  export declare const getDefaultIntegrations: (options: Options) => Integration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;AAEtB;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,0BAA0B,GAClC,8BAA8B,GAAG,2BAA2B,CAqE9D"}
1
+ {"version":3,"file":"createSentryHandleRequest.d.ts","sourceRoot":"","sources":["../../../src/server/createSentryHandleRequest.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAKtG,KAAK,6BAA6B,GAAG;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,KAAK,4BAA4B,GAAG;IAClC,IAAI,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,cAAc,KAAK,IAAI,CAAC;IACnD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,KAAK,8BAA8B,GAAG,CACpC,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,6BAA6B,KACnC,4BAA4B,CAAC;AAElC,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,sBAAsB,EAAE,8BAA8B,CAAC;IAEvD;;OAEG;IACH,YAAY,EAAE,OAAO,YAAY,CAAC;IAElC;;OAEG;IACH,gCAAgC,EAAE,OAAO,gCAAgC,CAAC;IAE1E;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,8BAA8B,GAAG,CACpC,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,MAAM,EAC1B,eAAe,EAAE,OAAO,EACxB,aAAa,EAAE,YAAY,EAC3B,WAAW,EAAE,cAAc,KACxB,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,KAAK,2BAA2B,GAAG,CACjC,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,MAAM,EAC1B,eAAe,EAAE,OAAO,EACxB,aAAa,EAAE,YAAY,EAC3B,WAAW,EAAE,qBAAqB,KAC/B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,0BAA0B,GAClC,8BAA8B,GAAG,2BAA2B,CAoE9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"createServerInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/server/createServerInstrumentation.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAqD,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAQhH,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,wCAA6C,GACrD,qBAAqB,CAwMvB"}
1
+ {"version":3,"file":"createServerInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/server/createServerInstrumentation.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAqD,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAYhH,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,wCAA6C,GACrD,qBAAqB,CA2MvB"}
@@ -2,8 +2,6 @@ export * from '@sentry/node';
2
2
  export { init } from './sdk';
3
3
  export { wrapSentryHandleRequest, sentryHandleRequest } from './wrapSentryHandleRequest';
4
4
  export { createSentryHandleRequest, type SentryHandleRequestOptions } from './createSentryHandleRequest';
5
- export { wrapServerAction } from './wrapServerAction';
6
- export { wrapServerLoader } from './wrapServerLoader';
7
5
  export { createSentryHandleError, type SentryHandleErrorOptions } from './createSentryHandleError';
8
6
  export { getMetaTagTransformer } from './getMetaTagTransformer';
9
7
  export { createSentryServerInstrumentation, isInstrumentationApiUsed, type CreateSentryServerInstrumentationOptions, } from './createServerInstrumentation';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,KAAK,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAEzG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,KAAK,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EACL,iCAAiC,EACjC,wBAAwB,EACxB,KAAK,wCAAwC,GAC9C,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,KAAK,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzG,OAAO,EAAE,uBAAuB,EAAE,KAAK,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EACL,iCAAiC,EACjC,wBAAwB,EACxB,KAAK,wCAAwC,GAC9C,MAAM,+BAA+B,CAAC"}
@@ -1,6 +1,3 @@
1
- export declare const instrumentReactRouterServer: (() => void) & {
2
- id: "ReactRouterServer";
3
- };
4
1
  /**
5
2
  * Integration capturing tracing data for React Router server functions.
6
3
  */
@@ -1 +1 @@
1
- {"version":3,"file":"reactRouterServer.d.ts","sourceRoot":"","sources":["../../../../src/server/integration/reactRouterServer.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,2BAA2B,SAClC,IAAI;;CAMT,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B;;CAwDvC,CAAC"}
1
+ {"version":3,"file":"reactRouterServer.d.ts","sourceRoot":"","sources":["../../../../src/server/integration/reactRouterServer.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,4BAA4B;;CAQvC,CAAC"}
@@ -7,14 +7,4 @@ export declare function markInstrumentationApiUsed(): void;
7
7
  * Check if React Router's instrumentation API is being used on the server.
8
8
  */
9
9
  export declare function isInstrumentationApiUsed(): boolean;
10
- /**
11
- * Enable OTEL data-loader span creation for React Router server.
12
- * @internal
13
- */
14
- export declare function enableOtelDataLoaderSpanCreation(): void;
15
- /**
16
- * Check if OTEL data-loader span creation is enabled for React Router server.
17
- * @internal
18
- */
19
- export declare function isOtelDataLoaderSpanCreationEnabled(): boolean;
20
10
  //# sourceMappingURL=serverGlobals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serverGlobals.d.ts","sourceRoot":"","sources":["../../../src/server/serverGlobals.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAElD;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,IAAI,OAAO,CAE7D"}
1
+ {"version":3,"file":"serverGlobals.d.ts","sourceRoot":"","sources":["../../../src/server/serverGlobals.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAElD"}
@@ -1 +1 @@
1
- {"version":3,"file":"handleOnBuildEnd.d.ts","sourceRoot":"","sources":["../../../../src/vite/buildEnd/handleOnBuildEnd.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAMvD,KAAK,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AAWpD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,YA+H9B,CAAC"}
1
+ {"version":3,"file":"handleOnBuildEnd.d.ts","sourceRoot":"","sources":["../../../../src/vite/buildEnd/handleOnBuildEnd.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAMvD,KAAK,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AAyBpD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,YA4I9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"makeCustomSentryVitePlugins.d.ts","sourceRoot":"","sources":["../../../src/vite/makeCustomSentryVitePlugins.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D;;GAEG;AACH,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA8C3G"}
1
+ {"version":3,"file":"makeCustomSentryVitePlugins.d.ts","sourceRoot":"","sources":["../../../src/vite/makeCustomSentryVitePlugins.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D;;GAEG;AACH,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAuE3G"}
@@ -1 +1 @@
1
- {"version":3,"file":"makeServerBuildCapturePlugin.d.ts","sourceRoot":"","sources":["../../../src/vite/makeServerBuildCapturePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAKnC;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CA8BrD"}
1
+ {"version":3,"file":"makeServerBuildCapturePlugin.d.ts","sourceRoot":"","sources":["../../../src/vite/makeServerBuildCapturePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAKnC;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CA2BrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAK9C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,6BAA6B,YAAK,EAC3C,UAAU,EAAE,SAAS,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC,CAYnB"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAK9C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,6BAA6B,YAAK,EAC3C,UAAU,EAAE,SAAS,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC,CAanB"}
@@ -1,5 +1,5 @@
1
1
  import type { BuildTimeOptionsBase, UnstableVitePluginOptions } from '@sentry/core';
2
- import type { SentryVitePluginOptions } from '@sentry/vite-plugin';
2
+ import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';
3
3
  type SourceMapsOptions = {
4
4
  /**
5
5
  * If this flag is `true`, and an auth token is detected, the Sentry SDK will
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vite/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,KAAK,iBAAiB,GAAG;IACvB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;;OASG;IACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAElD;;;;;;OAMG;IAEH,OAAO,CAAC,EAAE;QACR;;;;;;;;;;WAUG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,oBAAoB,GAC9D,yBAAyB,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,GAAG;IAC5D;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE;QACzB;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAElB;;WAEG;QACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;IAEF;;;OAGG;IACH,uBAAuB,CAAC,EAAE,iBAAiB,CAAC;CAE7C,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vite/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5E,KAAK,iBAAiB,GAAG;IACvB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;;OASG;IACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAElD;;;;;;OAMG;IAEH,OAAO,CAAC,EAAE;QACR;;;;;;;;;;WAUG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,oBAAoB,GAC9D,yBAAyB,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,GAAG;IAC5D;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE;QACzB;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAElB;;WAEG;QACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;IAEF;;;OAGG;IACH,uBAAuB,CAAC,EAAE,iBAAiB,CAAC;CAE7C,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sentry/react-router",
3
- "version": "10.68.0",
3
+ "version": "11.0.0-alpha.0",
4
4
  "description": "Official Sentry SDK for React Router (Framework)",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/react-router",
7
7
  "author": "Sentry",
8
8
  "license": "MIT",
9
9
  "engines": {
10
- "node": ">=20"
10
+ "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0"
11
11
  },
12
12
  "files": [
13
13
  "/build"
@@ -46,27 +46,27 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@opentelemetry/api": "^1.9.1",
49
- "@opentelemetry/instrumentation": "^0.220.0",
50
- "@sentry/browser": "10.68.0",
49
+ "@sentry/browser": "11.0.0-alpha.0",
51
50
  "@sentry/cli": "^2.58.6",
52
51
  "@sentry/conventions": "^0.16.0",
53
- "@sentry/core": "10.68.0",
54
- "@sentry/node": "10.68.0",
55
- "@sentry/react": "10.68.0",
56
- "@sentry/vite-plugin": "^5.3.0",
52
+ "@sentry/core": "11.0.0-alpha.0",
53
+ "@sentry/node": "11.0.0-alpha.0",
54
+ "@sentry/react": "11.0.0-alpha.0",
55
+ "@sentry/server-utils": "11.0.0-alpha.0",
56
+ "@sentry/bundler-plugins": "11.0.0-alpha.0",
57
57
  "glob": "^13.0.6"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@react-router/dev": "^7.17.0",
61
- "@react-router/node": "^7.13.1",
61
+ "@react-router/node": "^7.15.0",
62
62
  "react": "^18.3.1",
63
- "react-router": "^7.17.0",
63
+ "react-router": "^7.18.0",
64
64
  "vite": "^6.4.3"
65
65
  },
66
66
  "peerDependencies": {
67
- "@react-router/node": "7.x || ^8.x",
67
+ "@react-router/node": ">=7.15.0 || ^8.x",
68
68
  "react": ">=18",
69
- "react-router": "7.x || ^8.x"
69
+ "react-router": ">=7.15.0 || ^8.x"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "run-p build:transpile build:types",
@@ -80,8 +80,8 @@
80
80
  "build:tarball": "npm pack",
81
81
  "circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts",
82
82
  "clean": "rimraf build coverage sentry-react-router-*.tgz",
83
- "lint:fix": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --fix --type-aware",
84
- "lint": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --type-aware",
83
+ "lint:fix": "oxlint . --fix --type-aware",
84
+ "lint": "oxlint . --type-aware",
85
85
  "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module",
86
86
  "test": "yarn test:unit",
87
87
  "test:unit": "vitest run",
@@ -1,106 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const instrumentation = require('@opentelemetry/instrumentation');
4
- const attributes = require('@sentry/conventions/attributes');
5
- const core = require('@sentry/core');
6
- const debugBuild = require('../../common/debug-build.js');
7
- const serverBuild = require('../serverBuild.js');
8
- const serverGlobals = require('../serverGlobals.js');
9
- const util = require('./util.js');
10
-
11
- const supportedVersions = [">=7.0.0"];
12
- const COMPONENT = "react-router";
13
- class ReactRouterInstrumentation extends instrumentation.InstrumentationBase {
14
- constructor(config = {}) {
15
- super("ReactRouterInstrumentation", core.SDK_VERSION, config);
16
- }
17
- /**
18
- * Initializes the instrumentation by defining the React Router server modules to be patched.
19
- */
20
- // eslint-disable-next-line @typescript-eslint/naming-convention
21
- init() {
22
- const reactRouterServerModule = new instrumentation.InstrumentationNodeModuleDefinition(
23
- COMPONENT,
24
- supportedVersions,
25
- (moduleExports) => {
26
- return this._createPatchedModuleProxy(moduleExports);
27
- },
28
- (_moduleExports) => {
29
- return _moduleExports;
30
- }
31
- );
32
- return reactRouterServerModule;
33
- }
34
- /**
35
- * Creates a proxy around the React Router module exports that patches the createRequestHandler function.
36
- * This allows us to wrap the request handler to add performance monitoring for data loaders and actions.
37
- */
38
- _createPatchedModuleProxy(moduleExports) {
39
- return new Proxy(moduleExports, {
40
- get(target, prop, receiver) {
41
- if (prop === "createRequestHandler") {
42
- const original = target[prop];
43
- return function sentryWrappedCreateRequestHandler(...args) {
44
- const build = args[0];
45
- if (serverBuild.isServerBuildLike(build)) {
46
- serverBuild.setServerBuild(build);
47
- } else if (typeof build === "function") {
48
- const originalBuildFn = build;
49
- args[0] = async function sentryWrappedBuildFn() {
50
- const resolvedBuild = await originalBuildFn();
51
- if (serverBuild.isServerBuildLike(resolvedBuild)) {
52
- serverBuild.setServerBuild(resolvedBuild);
53
- }
54
- return resolvedBuild;
55
- };
56
- }
57
- const originalRequestHandler = original.apply(this, args);
58
- return async function sentryWrappedRequestHandler(request, initialContext) {
59
- if (serverGlobals.isInstrumentationApiUsed() || !serverGlobals.isOtelDataLoaderSpanCreationEnabled()) {
60
- return originalRequestHandler(request, initialContext);
61
- }
62
- let url;
63
- try {
64
- url = new URL(request.url);
65
- } catch {
66
- return originalRequestHandler(request, initialContext);
67
- }
68
- if (!util.isDataRequest(url.pathname)) {
69
- return originalRequestHandler(request, initialContext);
70
- }
71
- const activeSpan = core.getActiveSpan();
72
- const rootSpan = activeSpan && core.getRootSpan(activeSpan);
73
- if (!rootSpan) {
74
- debugBuild.DEBUG_BUILD && core.debug.log("No active root span found, skipping tracing for data request");
75
- return originalRequestHandler(request, initialContext);
76
- }
77
- const spanData = core.spanToJSON(rootSpan);
78
- const target2 = spanData.data[attributes.HTTP_TARGET] || url.pathname;
79
- core.updateSpanName(rootSpan, `${request.method} ${target2}`);
80
- rootSpan.setAttributes({
81
- [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url",
82
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.react_router.server"
83
- });
84
- return core.startSpan(
85
- {
86
- name: util.getSpanName(url.pathname, request.method),
87
- attributes: {
88
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.react_router.server",
89
- [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: util.getOpName(url.pathname, request.method)
90
- }
91
- },
92
- () => {
93
- return originalRequestHandler(request, initialContext);
94
- }
95
- );
96
- };
97
- };
98
- }
99
- return Reflect.get(target, prop, receiver);
100
- }
101
- });
102
- }
103
- }
104
-
105
- exports.ReactRouterInstrumentation = ReactRouterInstrumentation;
106
- //# sourceMappingURL=reactRouter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactRouter.js","sources":["../../../../src/server/instrumentation/reactRouter.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { HTTP_TARGET } from '@sentry/conventions/attributes';\nimport {\n debug,\n getActiveSpan,\n getRootSpan,\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n spanToJSON,\n startSpan,\n updateSpanName,\n} from '@sentry/core';\nimport type * as reactRouter from 'react-router';\nimport { DEBUG_BUILD } from '../../common/debug-build';\nimport { isServerBuildLike, setServerBuild } from '../serverBuild';\nimport { isInstrumentationApiUsed, isOtelDataLoaderSpanCreationEnabled } from '../serverGlobals';\nimport { getOpName, getSpanName, isDataRequest } from './util';\n\ntype ReactRouterModuleExports = typeof reactRouter;\n\nconst supportedVersions = ['>=7.0.0'];\nconst COMPONENT = 'react-router';\n\n/**\n * Instrumentation for React Router's server request handler.\n * This patches the requestHandler function to add Sentry performance monitoring for data loaders.\n */\nexport class ReactRouterInstrumentation extends InstrumentationBase<InstrumentationConfig> {\n public constructor(config: InstrumentationConfig = {}) {\n super('ReactRouterInstrumentation', SDK_VERSION, config);\n }\n\n /**\n * Initializes the instrumentation by defining the React Router server modules to be patched.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected init(): InstrumentationNodeModuleDefinition {\n const reactRouterServerModule = new InstrumentationNodeModuleDefinition(\n COMPONENT,\n supportedVersions,\n (moduleExports: ReactRouterModuleExports) => {\n return this._createPatchedModuleProxy(moduleExports);\n },\n (_moduleExports: unknown) => {\n // nothing to unwrap here\n return _moduleExports;\n },\n );\n\n return reactRouterServerModule;\n }\n\n /**\n * Creates a proxy around the React Router module exports that patches the createRequestHandler function.\n * This allows us to wrap the request handler to add performance monitoring for data loaders and actions.\n */\n private _createPatchedModuleProxy(moduleExports: ReactRouterModuleExports): ReactRouterModuleExports {\n return new Proxy(moduleExports, {\n get(target, prop, receiver) {\n if (prop === 'createRequestHandler') {\n const original = target[prop];\n return function sentryWrappedCreateRequestHandler(this: unknown, ...args: unknown[]) {\n // Capture the ServerBuild reference for middleware name lookup\n const build = args[0];\n if (isServerBuildLike(build)) {\n setServerBuild(build);\n } else if (typeof build === 'function') {\n // Build arg can be a factory function (dev mode HMR). Wrap to capture resolved build.\n const originalBuildFn = build as () => unknown;\n args[0] = async function sentryWrappedBuildFn() {\n const resolvedBuild = await originalBuildFn();\n if (isServerBuildLike(resolvedBuild)) {\n setServerBuild(resolvedBuild);\n }\n return resolvedBuild;\n };\n }\n\n const originalRequestHandler = original.apply(this, args);\n\n return async function sentryWrappedRequestHandler(request: Request, initialContext?: unknown) {\n // Skip OTEL span creation when instrumentation API is active or when span creation is not enabled.\n // Checked per-request (not at handler-creation time) because in dev, createRequestHandler runs before entry.server.tsx.\n if (isInstrumentationApiUsed() || !isOtelDataLoaderSpanCreationEnabled()) {\n return originalRequestHandler(request, initialContext);\n }\n\n let url: URL;\n try {\n url = new URL(request.url);\n } catch {\n return originalRequestHandler(request, initialContext);\n }\n\n // We currently just want to trace loaders and actions\n if (!isDataRequest(url.pathname)) {\n return originalRequestHandler(request, initialContext);\n }\n\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan && getRootSpan(activeSpan);\n\n if (!rootSpan) {\n DEBUG_BUILD && debug.log('No active root span found, skipping tracing for data request');\n return originalRequestHandler(request, initialContext);\n }\n\n // We cannot rely on the regular span name inferral here, as the express instrumentation sets `*` as the route\n // So we force this to be a more sensible name here\n // TODO: try to set derived parameterized route from build here (args[0])\n const spanData = spanToJSON(rootSpan);\n // eslint-disable-next-line typescript/no-deprecated\n const target = spanData.data[HTTP_TARGET] || url.pathname;\n updateSpanName(rootSpan, `${request.method} ${target}`);\n rootSpan.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.server',\n });\n\n return startSpan(\n {\n name: getSpanName(url.pathname, request.method),\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.server',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: getOpName(url.pathname, request.method),\n },\n },\n () => {\n return originalRequestHandler(request, initialContext);\n },\n );\n };\n };\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","isServerBuildLike","setServerBuild","isInstrumentationApiUsed","isOtelDataLoaderSpanCreationEnabled","isDataRequest","getActiveSpan","getRootSpan","DEBUG_BUILD","debug","spanToJSON","target","HTTP_TARGET","updateSpanName","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","startSpan","getSpanName","SEMANTIC_ATTRIBUTE_SENTRY_OP","getOpName"],"mappings":";;;;;;;;;;AAuBA,MAAM,iBAAA,GAAoB,CAAC,SAAS,CAAA;AACpC,MAAM,SAAA,GAAY,cAAA;AAMX,MAAM,mCAAmCA,mCAAA,CAA2C;AAAA,EAClF,WAAA,CAAY,MAAA,GAAgC,EAAC,EAAG;AACrD,IAAA,KAAA,CAAM,4BAAA,EAA8BC,kBAAa,MAAM,CAAA;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMU,IAAA,GAA4C;AACpD,IAAA,MAAM,0BAA0B,IAAIC,mDAAA;AAAA,MAClC,SAAA;AAAA,MACA,iBAAA;AAAA,MACA,CAAC,aAAA,KAA4C;AAC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AGC,eAAU,GAAA,CAAI,QAAA,EAAU,QAAQ,MAAM;AAAA;AACxE,iBACF;AAAA,gBACA,MAAM;AACJ,kBAAA,OAAO,sBAAA,CAAuB,SAAS,cAAc,CAAA;AAAA,gBACvD;AAAA,eACF;AAAA,YACF,CAAA;AAAA,UACF,CAAA;AAAA,QACF;AACA,QAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,IAAA,EAAM,QAAQ,CAAA;AAAA,MAC3C;AAAA,KACD,CAAA;AAAA,EACH;AACF;;;;"}
@@ -1,24 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- function getOpName(pathName, requestMethod) {
4
- return isLoaderRequest(pathName, requestMethod) ? "function.react_router.loader" : isActionRequest(pathName, requestMethod) ? "function.react_router.action" : "function.react_router";
5
- }
6
- function getSpanName(pathName, requestMethod) {
7
- return isLoaderRequest(pathName, requestMethod) ? "Executing Server Loader" : isActionRequest(pathName, requestMethod) ? "Executing Server Action" : "Unknown Data Request";
8
- }
9
- function isLoaderRequest(pathname, requestMethod) {
10
- return isDataRequest(pathname) && requestMethod === "GET";
11
- }
12
- function isActionRequest(pathname, requestMethod) {
13
- return isDataRequest(pathname) && requestMethod === "POST";
14
- }
15
- function isDataRequest(pathname) {
16
- return pathname.endsWith(".data");
17
- }
18
-
19
- exports.getOpName = getOpName;
20
- exports.getSpanName = getSpanName;
21
- exports.isActionRequest = isActionRequest;
22
- exports.isDataRequest = isDataRequest;
23
- exports.isLoaderRequest = isLoaderRequest;
24
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sources":["../../../../src/server/instrumentation/util.ts"],"sourcesContent":["/**\n * Gets the op name for a request based on whether it's a loader or action request.\n * @param pathName The URL pathname to check\n * @param requestMethod The HTTP request method\n */\nexport function getOpName(pathName: string, requestMethod: string): string {\n return isLoaderRequest(pathName, requestMethod)\n ? 'function.react_router.loader'\n : isActionRequest(pathName, requestMethod)\n ? 'function.react_router.action'\n : 'function.react_router';\n}\n\n/**\n * Gets the span name for a request based on whether it's a loader or action request.\n * @param pathName The URL pathname to check\n * @param requestMethod The HTTP request method\n */\nexport function getSpanName(pathName: string, requestMethod: string): string {\n return isLoaderRequest(pathName, requestMethod)\n ? 'Executing Server Loader'\n : isActionRequest(pathName, requestMethod)\n ? 'Executing Server Action'\n : 'Unknown Data Request';\n}\n\n/**\n * Checks if the request is a server loader request\n * @param pathname The URL pathname to check\n * @param requestMethod The HTTP request method\n */\nexport function isLoaderRequest(pathname: string, requestMethod: string): boolean {\n return isDataRequest(pathname) && requestMethod === 'GET';\n}\n\n/**\n * Checks if the request is a server action request\n * @param pathname The URL pathname to check\n * @param requestMethod The HTTP request method\n */\nexport function isActionRequest(pathname: string, requestMethod: string): boolean {\n return isDataRequest(pathname) && requestMethod === 'POST';\n}\n\n/**\n * Checks if the request is a react-router data request\n * @param pathname The URL pathname to check\n */\nexport function isDataRequest(pathname: string): boolean {\n return pathname.endsWith('.data');\n}\n\nexport const SEMANTIC_ATTRIBUTE_SENTRY_OVERWRITE = 'sentry.overwrite-route';\n"],"names":[],"mappings":";;AAKO,SAAS,SAAA,CAAU,UAAkB,aAAA,EAA+B;AACzE,EAAA,OAAO,eAAA,CAAgB,UAAU,aAAa,CAAA,GAC1C,iCACA,eAAA,CAAgB,QAAA,EAAU,aAAa,CAAA,GACrC,8BAAA,GACA,uBAAA;AACR;AAOO,SAAS,WAAA,CAAY,UAAkB,aAAA,EAA+B;AAC3E,EAAA,OAAO,eAAA,CAAgB,UAAU,aAAa,CAAA,GAC1C,4BACA,eAAA,CAAgB,QAAA,EAAU,aAAa,CAAA,GACrC,yBAAA,GACA,sBAAA;AACR;AAOO,SAAS,eAAA,CAAgB,UAAkB,aAAA,EAAgC;AAChF,EAAA,OAAO,aAAA,CAAc,QAAQ,CAAA,IAAK,aAAA,KAAkB,KAAA;AACtD;AAOO,SAAS,eAAA,CAAgB,UAAkB,aAAA,EAAgC;AAChF,EAAA,OAAO,aAAA,CAAc,QAAQ,CAAA,IAAK,aAAA,KAAkB,MAAA;AACtD;AAMO,SAAS,cAAc,QAAA,EAA2B;AACvD,EAAA,OAAO,QAAA,CAAS,SAAS,OAAO,CAAA;AAClC;;;;;;;;"}
@@ -1,56 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const attributes = require('@sentry/conventions/attributes');
4
- const core = require('@sentry/core');
5
- const debugBuild = require('../common/debug-build.js');
6
- const serverGlobals = require('./serverGlobals.js');
7
-
8
- let hasWarnedAboutDuplicateActionInstrumentation = false;
9
- function wrapServerAction(options = {}, actionFn) {
10
- return async function(args) {
11
- if (serverGlobals.isInstrumentationApiUsed()) {
12
- if (debugBuild.DEBUG_BUILD && !hasWarnedAboutDuplicateActionInstrumentation) {
13
- hasWarnedAboutDuplicateActionInstrumentation = true;
14
- core.debug.warn(
15
- "wrapServerAction is redundant when using the instrumentation API. The action is already instrumented automatically. You can safely remove wrapServerAction."
16
- );
17
- }
18
- return actionFn(args);
19
- }
20
- const name = options.name || "Executing Server Action";
21
- const active = core.getActiveSpan();
22
- if (active) {
23
- const root = core.getRootSpan(active);
24
- const spanData = core.spanToJSON(root);
25
- if (spanData.origin === "auto.http.otel.http") {
26
- const target = spanData.data[attributes.HTTP_TARGET];
27
- if (target) {
28
- core.updateSpanName(root, `${args.request.method} ${target}`);
29
- root.setAttributes({
30
- [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url",
31
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.react_router.action"
32
- });
33
- }
34
- }
35
- }
36
- try {
37
- return await core.startSpan(
38
- {
39
- name,
40
- ...options,
41
- attributes: {
42
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.react_router.action",
43
- [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "function.react_router.action",
44
- ...options.attributes
45
- }
46
- },
47
- () => actionFn(args)
48
- );
49
- } finally {
50
- await core.flushIfServerless();
51
- }
52
- };
53
- }
54
-
55
- exports.wrapServerAction = wrapServerAction;
56
- //# sourceMappingURL=wrapServerAction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wrapServerAction.js","sources":["../../../src/server/wrapServerAction.ts"],"sourcesContent":["import { HTTP_TARGET } from '@sentry/conventions/attributes';\nimport type { SpanAttributes } from '@sentry/core';\nimport {\n debug,\n flushIfServerless,\n getActiveSpan,\n getRootSpan,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n spanToJSON,\n startSpan,\n updateSpanName,\n} from '@sentry/core';\nimport type { ActionFunctionArgs } from 'react-router';\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport { isInstrumentationApiUsed } from './serverGlobals';\n\ntype SpanOptions = {\n name?: string;\n attributes?: SpanAttributes;\n};\n\n// Track if we've already warned about duplicate instrumentation\nlet hasWarnedAboutDuplicateActionInstrumentation = false;\n\n// todo(v11): Remove this deprecated wrapper in favor of the instrumentation API (`createSentryServerInstrumentation`).\n/**\n * Wraps a React Router server action function with Sentry performance monitoring.\n *\n * @deprecated Use React Router's instrumentation API instead: export\n * `instrumentations = [createSentryServerInstrumentation()]` from your `entry.server.tsx` to instrument all server\n * actions without wrapping them individually. This manual wrapper will be removed in a future major.\n *\n * @param options - Optional span configuration options including name, operation, description and attributes\n * @param actionFn - The server action function to wrap\n *\n * @example\n * ```ts\n * // Wrap an action function with custom span options\n * export const action = wrapServerAction(\n * {\n * name: 'Submit Form Data',\n * description: 'Processes form submission data',\n * },\n * async ({ request }) => {\n * // ... your action logic\n * }\n * );\n * ```\n */\nexport function wrapServerAction<T>(\n options: SpanOptions = {},\n actionFn: (args: ActionFunctionArgs) => Promise<T>,\n): (args: ActionFunctionArgs) => Promise<T> {\n return async function (args: ActionFunctionArgs): Promise<T> {\n // Skip instrumentation if instrumentation API is already handling it\n if (isInstrumentationApiUsed()) {\n if (DEBUG_BUILD && !hasWarnedAboutDuplicateActionInstrumentation) {\n hasWarnedAboutDuplicateActionInstrumentation = true;\n debug.warn(\n 'wrapServerAction is redundant when using the instrumentation API. ' +\n 'The action is already instrumented automatically. You can safely remove wrapServerAction.',\n );\n }\n return actionFn(args);\n }\n\n const name = options.name || 'Executing Server Action';\n const active = getActiveSpan();\n if (active) {\n const root = getRootSpan(active);\n const spanData = spanToJSON(root);\n if (spanData.origin === 'auto.http.otel.http') {\n // eslint-disable-next-line typescript/no-deprecated\n const target = spanData.data[HTTP_TARGET];\n\n if (target) {\n // We cannot rely on the regular span name inferral here, as the express instrumentation sets `*` as the route\n // So we force this to be a more sensible name here\n updateSpanName(root, `${args.request.method} ${target}`);\n root.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.action',\n });\n }\n }\n }\n\n try {\n return await startSpan(\n {\n name,\n ...options,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.action',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react_router.action',\n ...options.attributes,\n },\n },\n () => actionFn(args),\n );\n } finally {\n await flushIfServerless();\n }\n };\n}\n"],"names":["isInstrumentationApiUsed","DEBUG_BUILD","debug","getActiveSpan","getRootSpan","spanToJSON","HTTP_TARGET","updateSpanName","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","startSpan","SEMANTIC_ATTRIBUTE_SENTRY_OP","flushIfServerless"],"mappings":";;;;;;;AAwBA,IAAI,4CAAA,GAA+C,KAAA;AA2B5C,SAAS,gBAAA,CACd,OAAA,GAAuB,EAAC,EACxB,QAAA,EAC0C;AAC1C,EAAA,OAAO,eAAgB,IAAA,EAAsC;AAE3D,IAAA,IAAIA,wCAAyB,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