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

Switch to CJS only exports #15

Closed
wants to merge 7 commits into from
Closed

Switch to CJS only exports #15

wants to merge 7 commits into from

Conversation

timostamm
Copy link
Member

@timostamm timostamm commented Sep 29, 2023

Supporting dual packages with the solution against dual package hazards proposed in bufbuild/protobuf-es#509 is not trivial here, because the environment needs to be a default export.

The most simple solution here is to only export CommonJS, because that is what Jest expects (verified with the example; also verified with "type": "module").

This fixes the dual package hazard with the solution proposed in bufbuild/protobuf-es#509.
It seems rather unlikely that anybody would run into the hazard using @bufbuild/jest-environment-jsdom. But consistency alone seems to be worth the change.
It would be really nice to run attw against this before we publish, though.

scripts/gen-esm-proxy.mjs Outdated Show resolved Hide resolved
@timostamm timostamm changed the title Add ESM wrapper to avoid dual package hazard Switch to CJS only exports Oct 2, 2023
@timostamm timostamm closed this Oct 2, 2023
@timostamm
Copy link
Member Author

For posterity, this was superseded by #27

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.

2 participants