Skip to content

Convert package to ESM - #11

Merged
mattgle merged 1 commit into
devfrom
feat/esm-migration
Jun 22, 2026
Merged

mattgle merged 1 commit into
devfrom
feat/esm-migration

Conversation

@mattgle

@mattgle mattgle commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Converts this package to ESM-only output as part of moving the SDK to native ES modules (the foundation for running on browser and React Native runtimes).

What changed

  • package.json sets "type": "module" so the package emits and publishes ESM.
  • All relative imports/exports now carry explicit .js extensions, including directory imports that are now explicit (./aes./aes/index.js, ./eddsa./eddsa/index.js), since ESM does not resolve directory imports.
  • eslint.config.js converted from CommonJS to ESM.

circomlibjs named imports (buildPoseidon, buildPoseidonOpt, buildEddsa) and @noble/* imports resolve correctly under ESM. No source logic changes; the public API is unchanged. Build, lint, and the full test suite (60 tests) pass under ESM, verified against both the current and the ESM build of the bytes dependency.

@mattgle
mattgle requested a review from bhflm June 18, 2026 20:13
@mattgle mattgle self-assigned this Jun 18, 2026
@mattgle
mattgle marked this pull request as ready for review June 19, 2026 16:57
@mattgle
mattgle merged commit ff5dcdf into dev Jun 22, 2026
1 check passed
@mattgle
mattgle deleted the feat/esm-migration branch June 22, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant