Skip to content

feat(astro)!: Remove unstable_sentryVitePluginOptions - #23370

Open
chargome wants to merge 1 commit into
charlygomez/js-3361-sveltekit-remove-unstable_sentryvitepluginoptionsfrom
charlygomez/js-3358-astro-remove-unstable_sentryvitepluginoptions
Open

feat(astro)!: Remove unstable_sentryVitePluginOptions#23370
chargome wants to merge 1 commit into
charlygomez/js-3361-sveltekit-remove-unstable_sentryvitepluginoptionsfrom
charlygomez/js-3358-astro-remove-unstable_sentryvitepluginoptions

Conversation

@chargome

@chargome chargome commented Aug 12, 2026

Copy link
Copy Markdown
Member

Removes unstable_sentryVitePluginOptions from the Astro integration options — both the top-level option and the deprecated copy inside sourceMapsUploadOptions.

Everything it exposed is reachable as a top-level build option. Adds a build-time warning, routed through Astro's integration logger.

The warning matters more here than elsewhere: SentryOptions intersects Record<string, unknown>, so TypeScript accepts any key and would otherwise leave the removal entirely silent. The key is also excluded from the generic "additional options" warning, which would wrongly tell users to move it into their sentry.client.config file.

Fixes #23342

@chargome chargome self-assigned this Aug 12, 2026
@linear-code

linear-code Bot commented Aug 12, 2026

Copy link
Copy Markdown

JS-3358

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.3 kB - -
@sentry/browser - with treeshaking flags 28.47 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.81 kB - -
@sentry/browser (incl. Tracing) 48.54 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.55 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.43 kB - -
@sentry/browser (incl. Tracing, Replay) 87.94 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.32 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.67 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.36 kB - -
@sentry/browser (incl. Feedback) 47.65 kB - -
@sentry/browser (incl. sendFeedback) 35.13 kB - -
@sentry/browser (incl. FeedbackAsync) 40.28 kB - -
@sentry/browser (incl. Metrics) 31.24 kB - -
@sentry/browser (incl. Logs) 31.52 kB - -
@sentry/browser (incl. Metrics & Logs) 32.15 kB - -
@sentry/react 32.09 kB - -
@sentry/react (incl. Tracing) 50.73 kB - -
@sentry/vue 35.31 kB - -
@sentry/vue (incl. Tracing) 50.5 kB - -
@sentry/svelte 30.33 kB - -
CDN Bundle 31.61 kB - -
CDN Bundle (incl. Tracing) 48.87 kB - -
CDN Bundle (incl. Logs, Metrics) 33.8 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.79 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.31 kB - -
CDN Bundle (incl. Tracing, Replay) 86.46 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.16 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.11 kB - -
CDN Bundle - uncompressed 93.84 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.72 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.14 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.41 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.08 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.98 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.68 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.34 kB - -
@sentry/nextjs (client) 53.26 kB - -
@sentry/sveltekit (client) 48.96 kB - -
@sentry/core/server 65.34 kB - -
@sentry/core/browser 51.69 kB - -
@sentry/node 117.67 kB +0.01% +1 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 82.06 kB - -
@sentry/aws-serverless 91.47 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 213.99 kB - -
@sentry/cloudflare (withSentry) 528.78 kB - -

View base workflow run

@chargome
chargome force-pushed the charlygomez/js-3358-astro-remove-unstable_sentryvitepluginoptions branch from 38665cc to 265e7ba Compare August 12, 2026 14:51
@chargome
chargome changed the base branch from charlygomez/js-3355-core-add-build-time-options-for-bundler-plugin-parity to charlygomez/js-3361-sveltekit-remove-unstable_sentryvitepluginoptions August 12, 2026 14:51
@chargome
chargome force-pushed the charlygomez/js-3358-astro-remove-unstable_sentryvitepluginoptions branch from 265e7ba to f36f76b Compare August 13, 2026 09:28
@chargome
chargome force-pushed the charlygomez/js-3358-astro-remove-unstable_sentryvitepluginoptions branch from f36f76b to 72ed096 Compare August 13, 2026 09:44
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

Comment thread packages/astro/src/integration/index.ts
Comment thread packages/astro/src/integration/index.ts
@chargome
chargome force-pushed the charlygomez/js-3358-astro-remove-unstable_sentryvitepluginoptions branch from 72ed096 to 365eee0 Compare August 13, 2026 10:02
@chargome
chargome force-pushed the charlygomez/js-3358-astro-remove-unstable_sentryvitepluginoptions branch 2 times, most recently from 94eaa37 to e123255 Compare August 13, 2026 11:45
@chargome
chargome force-pushed the charlygomez/js-3358-astro-remove-unstable_sentryvitepluginoptions branch from e123255 to b79a3ff Compare August 13, 2026 12:26
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b79a3ff. Configure here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chargome
chargome force-pushed the charlygomez/js-3358-astro-remove-unstable_sentryvitepluginoptions branch from b79a3ff to c4990d7 Compare August 13, 2026 13:17
@chargome
chargome marked this pull request as ready for review August 13, 2026 13:45
@chargome
chargome requested a review from a team as a code owner August 13, 2026 13:45
@chargome
chargome requested review from mydea and s1gr1d and removed request for a team August 13, 2026 13:45

expectTypeOf(viteOptions).toEqualTypeOf<SentryOptions>();
expectTypeOf(options).toEqualTypeOf<SentryOptions>();
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The type test for unstable_sentryVitePluginOptions is misleading. expectTypeOf(options).toEqualTypeOf<SentryOptions>() passes trivially because options is explicitly annotated, not because the extra property is correctly handled.
Severity: LOW

Suggested Fix

Remove the expectTypeOf(options).toEqualTypeOf<SentryOptions>() assertion. The @ts-expect-error comment is sufficient on its own to test and document that TypeScript correctly flags the deprecated property as an error.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/astro/test/buildOptions.test-d.ts#L147

Potential issue: The type test at `buildOptions.test-d.ts:147` is intended to verify
that the deprecated `unstable_sentryVitePluginOptions` property is rejected by the
`SentryOptions` type. However, the test is flawed. It uses `@ts-expect-error` to
suppress the type error on assignment, but then asserts
`expectTypeOf(options).toEqualTypeOf<SentryOptions>()`. Because the `options` variable
is explicitly annotated with the `SentryOptions` type, this assertion simply compares
the type to itself and always passes. It does not actually verify that an object with
the extra property is considered a different type, making the test ineffective and
providing a false sense of security.

Did we get this right? 👍 / 👎 to inform future reviews.

@chargome
chargome requested a review from andreiborza August 13, 2026 13:48
@chargome
chargome requested a review from nicohrubec August 13, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

astro: Remove unstable_sentryVitePluginOptions

3 participants