Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Add exports to package.json #1499

wants to merge 1 commit into from

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Apr 19, 2021

Closes: #1464

@codecov
Copy link

codecov bot commented Apr 19, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@3bb1c8c). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1499   +/-   ##
=======================================
  Coverage        ?   95.58%           
=======================================
  Files           ?       19           
  Lines           ?    11139           
  Branches        ?     1736           
=======================================
  Hits            ?    10647           
  Misses          ?      486           
  Partials        ?        6           
Flag Coverage Δ
test262 61.02% <ø> (?)
tests 91.76% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3bb1c8c...edfcd6a. Read the comment docs.

Copy link
Collaborator

@cjtenny cjtenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥅

@ljharb
Copy link
Member

ljharb commented Apr 19, 2021

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)

Comment on lines +8 to +11
"exports": {
"import": "./lib/index.mjs",
"require": "./dist/index.js"
},
Copy link
Member

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:

Suggested change
"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)

@ptomato
Copy link
Collaborator Author

ptomato commented Apr 19, 2021

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)

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 ptomato closed this Apr 19, 2021
@ptomato ptomato deleted the 1464-exports branch April 19, 2021 21:21
@ljharb
Copy link
Member

ljharb commented Apr 19, 2021

@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.

@littledan
Copy link
Member

What's wrong with a breaking change on something at version 0.8?

@ptomato
Copy link
Collaborator Author

ptomato commented Apr 28, 2021

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.

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.

[polyfil] Two suggestions
4 participants