8000 feat!: add exports map by kyletsang · Pull Request #6901 · react-bootstrap/react-bootstrap · GitHub
[go: up one dir, main page]

Skip to content

feat!: add exports map #6901

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 4 commits into from
Apr 14, 2025
Merged

feat!: add exports map #6901

merged 4 commits into from
Apr 14, 2025

Conversation

kyletsang
Copy link
Member
@kyletsang kyletsang commented Feb 10, 2025

BREAKING CHANGE: Add package.json exports map and remove proxy directories. Removes SSR utilities.

Supersedes #6897
Closes #6797

BREAKING CHANGE: Add package.json exports map and remove proxy directories
@kyletsang kyletsang marked this pull request as draft February 10, 2025 04:20
@kyletsang kyletsang marked this pull request as ready for review February 11, 2025 07:14
@kyletsang kyletsang requested a review from jquense February 11, 2025 07:14
@nwalters512
Copy link
Contributor

Maybe this is to come in a future PR, but I want to make sure this is on your radar: even after these changes, the files in lib/ aren't valid ESM because they're missing extensions on their relative imports. Node and probably other runtimes that have strict ESM behavior will error on those imports at runtime.

@kyletsang
Copy link
Member Author

Maybe this is to come in a future PR, but I want to make sure this is on your radar: even after these changes, the files in lib/ aren't valid ESM because they're missing extensions on their relative imports. Node and probably other runtimes that have strict ESM behavior will error on those imports at runtime.

Yeah that's correct, this isn't true ESM. There are a number of upstream dependencies that RB includes that also don't ship proper ESM, so we have to work on those/look at alternatives.

It's a long road 😄

@nwalters512
Copy link
Contributor
nwalters512 commented Feb 13, 2025

Glad you're aware of this. I would strongly advise against adding exports until the import condition can point to actual ESM code, otherwise that'll render this package unusable in Node for folks using native ESM.

@kyletsang
Copy link
Member Author

@jquense any thoughts on this PR? This mimics the config in restart/ui and technically we only supported "faux ESM" with bundlers in the past, so this change shouldn't affect compatibility. I did a quick test on next + vite and it works.

@jquense
Copy link
Member
jquense commented Apr 11, 2025

Lgtm, there is usually a few random things to adjust, so worth publishing some pre releases and testing in projects

@kyletsang kyletsang merged commit 20c8687 into master Apr 14, 2025
6 of 11 checks passed
@kyletsang kyletsang deleted the new-build branch April 14, 2025 14:38
@nwalters512
Copy link
Contributor

This will in fact impact compatibility if the "faux" ESM issue isn't addressed before this is released. I opened #6919 with a compatibility escape hatch, and I included more information about the actual problem there.

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.

Typescript fails with ESM + Node16 (NodeNext)
3 participants
0