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

Publish both esm and cjs #438

Merged
merged 1 commit into from
Mar 25, 2022
Merged

Publish both esm and cjs #438

merged 1 commit into from
Mar 25, 2022

Conversation

IanVS
Copy link
Contributor

@IanVS IanVS commented Feb 24, 2022

What:

This publishes both es modules and commonjs in the bundle.

Why:

Closes #437

How:

I used rollup to generate the two sets of bundles. I'm not doing any processing on either of them aside from what rollup does by default, mostly because I'm not sure what level of browser/node support this project follows. It would be pretty straightforward to add https://www.npmjs.com/package/@rollup/plugin-babel or otherwise configure the output as needed.

Checklist:

  • Documentation
  • Tests
  • Updated Type Definitions
  • Ready to be merged

I haven't updated any documentation or tests, because I wanted to see if this was at all on the right track.

@codecov
Copy link

codecov bot commented Feb 24, 2022

Codecov Report

Merging #438 (cf540f4) into main (4d0ceeb) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #438   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines          624       624           
  Branches       231       231           
=========================================
  Hits           624       624           

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 4d0ceeb...cf540f4. Read the comment docs.

@IanVS IanVS mentioned this pull request Feb 25, 2022
@IanVS
Copy link
Contributor Author

IanVS commented Feb 25, 2022

To be safe, maybe this could be released along with #379 in a major version bump.

@gnapse gnapse changed the base branch from main to next February 25, 2022 15:21
@gnapse
Copy link
Member

gnapse commented Feb 25, 2022

To be safe, maybe this could be released along with #379 in a major version bump.

Ok. I'll do it that way. So for now I'll merge this onto the next branch, so it does not get auto-released. I'll then merge #379 to next too, so that I trigger a single release when I push this all to main.

One thing I wanted to ask you about: what are the chances for surprises when this gets released? I ask because I'm a bit nervous that this cannot be tested locally? Or can it? Can I test somehow how this would work as if it was installed via npm, but without the release existing yet? Have you tested it in this way somehow?

@IanVS
Copy link
Contributor Author

IanVS commented Feb 25, 2022

@gnapse I have tested in my own vite storybook app, by running npm build, and copying the package.json and dist over to my project's node_modules.

I don't have a traditional jest project running in node to test the cjs build on, but the process would be the same.

Perhaps you could publish an alpha or beta version, that people could test out?

@IanVS
Copy link
Contributor Author

IanVS commented Mar 17, 2022

@gnapse do you still plan to release a beta version with this change? Is there anything else you'd like me to do before you're comfortable with it?

@gnapse
Copy link
Member

gnapse commented Mar 21, 2022

@IanVS sorry for the delay. I'm going to resume work on this tomorrow. I'll decide then if I go with a alpha or beta version first.

@gnapse gnapse merged commit 719b35b into testing-library:next Mar 25, 2022
@IanVS IanVS deleted the esm branch March 25, 2022 15:54
@yannbf
Copy link
Contributor

yannbf commented Aug 3, 2022

Thank you all for doing this! I was wondering whether there are plans to release this in an alpha version somewhere?

Thank you <3

@IanVS IanVS mentioned this pull request Aug 31, 2022
2 tasks
@IanVS
Copy link
Contributor Author

IanVS commented Feb 16, 2023

Hi is there any plan to release this? It's kind of a bummer that I put the work into it and there's still no way to use it.

@yannbf
Copy link
Contributor

yannbf commented Mar 21, 2023

Hey @gnapse was this change ever included in a release?

@kasperpeulen
Copy link

Can this PR also be merged to main?

@IanVS IanVS mentioned this pull request Aug 22, 2023
4 tasks
@IanVS
Copy link
Contributor Author

IanVS commented Aug 22, 2023

It looks like the other changes that were in next were cherry-picked back to main and released, but not this one. Does anyone have any information why? It would be great to publish ESM, if at all possible.

@IanVS
Copy link
Contributor Author

IanVS commented Aug 22, 2023

OK, I see now this needs to be reworked a bit based on the multiple export paths now supported for vitest, etc. I'll open a new PR. Edit: #519

@IanVS IanVS mentioned this pull request Aug 22, 2023
4 tasks
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.

Publish ES modules
4 participants