Skip to content

feat(modules)!: share ESM and CommonJS exports - #72

Merged
BridgeAR merged 3 commits into
mainfrom
BridgeAR/2026-10-12-esm-cjs
Oct 13, 2026
Merged

BridgeAR merged 3 commits into
mainfrom
BridgeAR/2026-10-12-esm-cjs

Conversation

@BridgeAR

Copy link
Copy Markdown
Owner

The implementation is cached after the first load, so removing its global export leaves the other wrapper without an export. Retain a version-specific symbol so ESM imports, CommonJS requires, and independent copies of one version receive the same function.

BREAKING CHANGE: Require Node.js 18 or later.

The implementation is cached after the first load, so removing its global
export leaves the other wrapper without an export. Retain a version-specific
symbol so ESM imports, CommonJS requires, and independent copies of one
version receive the same function.

BREAKING CHANGE: Require Node.js 18 or later.
The retained export is enumerable, so object spreads of globalThis copy the
function along with other global properties.
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-10-12-esm-cjs branch from 66709aa to 8ebf2a1 Compare October 13, 2026 05:50
Comment thread esm/package.json Outdated
@BridgeAR
BridgeAR marked this pull request as ready for review October 13, 2026 05:55
@BridgeAR
BridgeAR merged commit c05878f into main Oct 13, 2026
5 checks passed
@BridgeAR
BridgeAR deleted the BridgeAR/2026-10-12-esm-cjs branch October 13, 2026 05:57
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.

1 participant