-
Notifications
You must be signed in to change notification settings - Fork 163
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
Add exports to package.json #1499
Conversation
Closes: #1464
Codecov Report
@@ Coverage Diff @@
## main #1499 +/- ##
=======================================
Coverage ? 95.58%
=======================================
Files ? 19
Lines ? 11139
Branches ? 1736
=======================================
Hits ? 10647
Misses ? 486
Partials ? 6
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥅
Note that adding this is a breaking change; the format you've used won't work in every node version, and I'm not sure why this improvement is needed given that the polyfill should theoretically be deprecated very soon? (arguably, should have been deprecated a month ago, per prior agreements) |
"exports": { | ||
"import": "./lib/index.mjs", | ||
"require": "./dist/index.js" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what would be needed if you wanted to actually support every node version:
"exports": { | |
"import": "./lib/index.mjs", | |
"require": "./dist/index.js" | |
}, | |
"exports": { | |
".": [ | |
{ | |
"import": "./lib/index.mjs", | |
"default": "./dist/index.js" | |
}, | |
"./dist/index.js" | |
] | |
}, |
but note that this is still a breaking change unless these are the only two files included in the package (which i can see they aren't from the "browser" field above)
I don't agree that that precludes changes to leave it in a good place, but I didn't realize this was a breaking change. |
@ptomato "leaving it in a good place" is fine within a reasonable timeframe, ofc - adding new features tho, breaking or otherwise, seems a bit out of scope of that. |
What's wrong with a breaking change on something at version 0.8? |
Certainly breaking changes are fine at version 0.8, but once I realized this was breaking, it seemed like just churn without a clear benefit, unlike the other breaking changes we've had. |
Closes: #1464