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 ESM/CJS import tests #84

Merged
merged 16 commits into from
Mar 8, 2024
Merged

Add ESM/CJS import tests #84

merged 16 commits into from
Mar 8, 2024

Conversation

sangaline
Copy link
Contributor

@sangaline sangaline commented Mar 7, 2024

This adds some basic tests to make sure that the ESM and CJS builds are working. It's easy to accidentally add a library that doesn't work with one of the builds, or to do something that pushes the library under a default property on the CJS build. I've added and reverted a few commits here that demonstrate these issues and the tests catching them.

In particular, see these commits which introduce different errors:

  • a182acf - Introduce an ESM-only dependency
  • 019fd03 - Force the CJS build to export the library under .default
  • 495f335 - Use a CJS only library as an ESM import

Closes #63

Copy link
Contributor

@katiemckeon katiemckeon left a comment

Choose a reason for hiding this comment

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

Appreciate the visibility into this.

My main exposure to the CJS vs ESM problem is one where I clone a codebase that does nearly what I want (e.g. a snarkjs app or tiny-noir-js demo website) and revise commands to show how you can easily export proof requests via our SDK. Honestly I'm pretty lost on the finer comparison between the two, but I appreciate that we are making it a priority to support both.

@sangaline sangaline merged commit 8a54d78 into main Mar 8, 2024
5 checks passed
@sangaline sangaline deleted the ews-add-import-tests branch March 8, 2024 22:58
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.

Add ESM/CJS import tests
2 participants