Skip to content

Conversation

@pi0
Copy link
Member

@pi0 pi0 commented Feb 20, 2025

regression from #116 in 2.0.3

in (ESM) environments that hash named export does not exist from node:crypto, Node.js fails.

Using default export is also not best option as in environments with hybrid polyfills (nitro and cloudflare workers), it means whole exports (both native and polyfills) are pulled in unnecessarily.

This PR uses new Node.js process.getBuiltinModule API to fix it.

Also big surprise there is huge bump in benchmarks! 1,158,352.39 => 2,074,725.02 not really sure what deoptimization before was kicking in.. (from ESM perhaps?) /cc @aquapi

@pi0 pi0 merged commit d9273a3 into main Feb 20, 2025
2 checks passed
@pi0 pi0 deleted the fix/hash-import branch February 20, 2025 17:40
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