Repository navigation
feat(core): Report React and Next.js versions in SDK config experiment - #27085
nicohrubec wants to merge 5 commits into
Conversation
Co-Authored-By: OpenAI Codex <codex@openai.com>
size-limit report 📦Compared: 12b6e63 (PR test merge using develop at 29e62cd) Against: 1c10c6f (develop) · base run #68574
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 5 not successful, 60 successful. See the run.
Successful checks
|
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
|
@sentry-junior review |
There was a problem hiding this comment.
[m] No integration or E2E test for a feat PR
REVIEW-RULES.md / Tests: "A feat PR has at least one integration or E2E test." This PR is a feat, and the only tests are unit tests (packages/core/test/lib/integrations/reportSdkConfig.test.ts, packages/nextjs/test/client/sdk.test.ts, packages/react/test/sdk.test.ts). The nextjs-16 tests/sdk-config.test.ts E2E test that an earlier commit added was removed in 5acd452, so nothing checks that the injected _sentryNextJsVersion reaches the client SDK in a real build (webpack or Turbopack value injection).
For the human reviewer
- Is it OK that
sdk.packagesnow holds non-Sentry packages (npm:next,npm:react) while the payload stays atversion: 4? Consumers of that field may assume Sentry packages only. - Should server-side Next.js config reports also carry the
nextversion? Only the browser client setsframeworkstoday, so a product decision.
Co-Authored-By: OpenAI Codex <codex@openai.com>
| opts._metadata = { | ||
| ...opts._metadata, | ||
| frameworks: { ...opts._metadata?.frameworks, react: version }, | ||
| }; |
There was a problem hiding this comment.
nit: the spread thing might be a recurring theme, worth extracting to a helper? Not needed now but maybe later if we extend this to more frameworks.
There was a problem hiding this comment.
I'll keep it for now then we can refactor this properly once we expand this to other places.
What
Add framework versions to
sdk.packagesin the experimental browser config report. Example payload diff:{ - "version": 4, + "version": 5, "sdk": { "name": "sentry.javascript.nextjs", "version": "11.22.0", "packages": [ { "name": "npm:@sentry/nextjs", "version": "11.22.0" }, - { "name": "npm:@sentry/react", "version": "11.22.0" } + { "name": "npm:@sentry/react", "version": "11.22.0" }, + { "name": "npm:next", "version": "16.0.3" }, + { "name": "npm:react", "version": "19.2.0" } ] } }Protocol v5 identifies reports with framework-version collection support. React uses its runtime version; Next.js uses its injected build version when available. These entries participate in the config hash.
Why
Distinguish framework upgrades even when the Sentry SDK version and options stay the same.