Skip to content

ref(bundler-plugins): Drop @babel/core peer dependency - #25406

Merged
timfish merged 1 commit into
developfrom
ref/babel-plugin-loose-types
Oct 15, 2026
Merged

timfish merged 1 commit into
developfrom
ref/babel-plugin-loose-types

Conversation

@timfish

@timfish timfish commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

@sentry/bundler-plugins no longer uses Babel at runtime. The ./babel-plugin export runs inside the user's own Babel, and imports Babel only for types. So the optional @babel/core peer dependency had no effect: anyone who runs a Babel plugin already has Babel installed.

The peer dependency did not help with types either. The emitted .d.ts files imported from @babel/core, which ships no types of its own, so TypeScript users without @types/babel__core got broken declarations. The exported plugin functions now use small loose types (BabelApi, BabelPlugin). The full Babel types stay internal, so the declarations no longer import from @babel/core. @babel/core stays a dev dependency for the build and tests.

The babel-plugin export now declares loose public types, so its
declarations no longer import from @babel/core.
@timfish
timfish marked this pull request as ready for review October 15, 2026 14:58
@timfish
timfish merged commit 3044997 into develop Oct 15, 2026
276 checks passed
@timfish
timfish deleted the ref/babel-plugin-loose-types branch October 15, 2026 14:58
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.

2 participants