Skip to content

feat: add esm compat imports; - #1430

Closed
denisx wants to merge 4 commits into
toss:mainfrom
denisx:feat/add_default_imports
Closed

denisx wants to merge 4 commits into
toss:mainfrom
denisx:feat/add_default_imports

Conversation

@denisx

@denisx denisx commented Oct 1, 2025 •

Copy link
Copy Markdown

Add esm imports for compat version

Helpful for lodash migrations (like https://gist.github.com/denisx/a06fc2b518ec152d2ef631674ac87b30)

@vercel

vercel Bot commented Oct 1, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
es-toolkit Ready Ready Preview Comment Oct 6, 2025 4:20pm

@denisx
denisx marked this pull request as draft October 1, 2025 13:45
@denisx
denisx marked this pull request as ready for review October 1, 2025 13:54
@denisx denisx changed the title feat: add default imports; feat: add esm compet imports; Oct 1, 2025
@denisx denisx changed the title feat: add esm compet imports; feat: add esm compat imports; Oct 1, 2025
@raon0211

raon0211 commented Oct 3, 2025

Copy link
Copy Markdown
Collaborator

Hey! Thanks for the PR. Quick question: since importing from es-toolkit/compat/func already tree-shakes and only pulls in what you need, do we really need ESM exports? What's the benefit we'd get from them? (Just asking because dual CJS/ESM packages can introduce risks like dual package hazards, so I want to make sure it's worth it.)

@denisx

denisx commented Oct 3, 2025 •

Copy link
Copy Markdown
Author

@raon0211 i see more clear build with esm imports. 'require' not well.
if you care about default require compability, we can make second build folder, such as compat-esm or any )

4 step to future from work experiments (ui build, d - desktop, m - mobile)

Screenshot+2025-10-01+at+23 12 20

a bit clear zip size (-1.5 kb) and more effective raw size (-8.5 kb) from 'require' compat

@raon0211

Copy link
Copy Markdown
Collaborator

This was fixed in #1757 and was released in v1.47.1. Thanks for opening a pull request, and looking forward to your next contribution!

@raon0211 raon0211 closed this Jun 27, 2026

This branch was successfully deployed

1 active deployment
Preview — 040f9971 Deployed Oct 6, 2025 by vercel[bot]
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.

3 participants