feat(astro)!: Remove unstable_sentryVitePluginOptions - #23370
Conversation
size-limit report 📦
|
38665cc to
265e7ba
Compare
265e7ba to
f36f76b
Compare
f36f76b to
72ed096
Compare
|
bugbot run |
72ed096 to
365eee0
Compare
94eaa37 to
e123255
Compare
e123255 to
b79a3ff
Compare
|
bugbot run |
There was a problem hiding this comment.
✅ 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>
b79a3ff to
c4990d7
Compare
|
|
||
| expectTypeOf(viteOptions).toEqualTypeOf<SentryOptions>(); | ||
| expectTypeOf(options).toEqualTypeOf<SentryOptions>(); | ||
| }); |
There was a problem hiding this comment.
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.
Removes
unstable_sentryVitePluginOptionsfrom the Astro integration options — both the top-level option and the deprecated copy insidesourceMapsUploadOptions.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:
SentryOptionsintersectsRecord<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 theirsentry.client.configfile.Fixes #23342