Repository navigation
feat(react-router): Support sourcemaps.upload, injectDebugIds and delete - #26607
Conversation
…etry An unset option sent the text "undefined" as its tag value. The telemetry snapshots of the integration tests now hold the three new tags.
size-limit report 📦Compared: 7230380 (PR test merge using develop at bd043ee) Against: bd043ee (develop) · base run #67052 ✅ Baseline matches: this diff contains only this PR's changes.
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 3 not successful, 58 successful. See the run.
Successful checks
|
a3aed62 to
36f613c
Compare
…sourcemap-options
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ac864aa. Configure here.
| } | ||
| } | ||
|
|
||
| // `disable: 'disable-upload'` still injects debug IDs, so that source maps can be |
There was a problem hiding this comment.
Conflicting sourcemap options emit no warning
Low Severity
resolveSourceMapsFeatures correctly drops a conflicting upload: true when injectDebugIds is false, and delete: false still honors filesToDeleteAfterUpload, but neither path warns. New options also win over disable with no warning. The bundler plugin warns in these cases; React Router never reaches that validator because sentryOnBuildEnd owns upload and deletion. I flagged this because the review rules require those warnings.
Additional Locations (1)
Triggered by learned rule: Delete only maps the upload actually sent
Reviewed by Cursor Bugbot for commit ac864aa. Configure here.
| } else if (typeof userFilesToDeleteAfterUpload === 'undefined') { | ||
| // set a default value no option was set | ||
| updatedFilesToDeleteAfterUpload = defaultFilesToDelete; |
There was a problem hiding this comment.
I know this is listed under "still open", but as-is the type docs are wrong for React Router. Could we either only apply the default glob when the SDK enabled the maps (source map setting was unset), matching the bundler plugin, or if that needs to wait for v12, override the JSDoc for delete in packages/react-router/src/vite/types.ts so it describes the current behaviour?
There was a problem hiding this comment.
Went with the first option: without delete, the SDK now deletes only the maps it turned on itself, as the bundler plugin does.


React Router uploads with the CLI in
sentryOnBuildEnd, and the bundler plugin's source map handling stays off. The SDK applies the new options there:uploadgates the upload,injectDebugIdsthe debug ID injection.delete: truedeletes every map next to the user'sfilesToDeleteAfterUpload, also without an upload, and switchesbuild.sourcemap: trueto'hidden'.delete: falsedeletes only the user's files. Withoutdelete, the SDK deletes the maps after an upload only when it turned them on itself. With the source map setting unset, Sentry turns on hidden maps only when it uploads them or whendelete: falsekeeps them.Fixes:
release.create: falseis now respected. The SDK created the release anyway.delete, maps the user turned on are no longer deleted, also not after a failed upload.Still open:
assets,ignoreandrewriteSourcesare accepted but never applied.disable: truestill turns on hidden maps and leaves them in the output.upload: falseandinjectDebugIds: falsedo not turn them on.E2E:
react-router-8-sourcemapsgets "manual upload" and "delete all" variants.