Skip to content

Use .ts files with explicit reexports to solve name conflicts #17130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Feb 12, 2025

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

The current approach we have with a .d.ts file that does not match the .js file really confuses tools that try to automatically generate docs for .ts files (e.g. jsr-io/jsr#957).

This PR reworks how we handle the conflict in a way that does not rely on lying to TypeScript with a uppercase.d.ts file that does not match uppercase.js, but instead uses a valid workaround for the problem of multiple export * with conflicting names: explicitly listing the names I want to "win".

This PR does not change the public API in any way, neither at the type level nor at the values level.

For ease of review, I split a file rename to its own commit, so that the second commit has a reasonable diff.

@nicolo-ribaudo nicolo-ribaudo added the PR: Internal 🏠 A type of pull request used for our changelog categories label Feb 12, 2025
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/58705

@nicolo-ribaudo
Copy link
Member Author

Merging this as-is, since it's just moving around functions across files to make TypeScript happy, without changing at all what is exported or any actual JS code.

@nicolo-ribaudo nicolo-ribaudo changed the title Use .ts files with explicit re-exports to solve builder conflicts Use .ts files with explicit reexports to solve name conflicts Feb 14, 2025
@nicolo-ribaudo nicolo-ribaudo merged commit 56ff65a into babel:main Feb 14, 2025
56 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the ts-builders-conflict branch February 14, 2025 11:08
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 17, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants