Skip to content

feat: switch to ESM-only #1411

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

feat: switch to ESM-only #1411

wants to merge 1 commit into from

Conversation

43081j
Copy link
Collaborator

@43081j 43081j commented Feb 20, 2025

Switches the 3 remaining dual packages to ESM only:

  • parse5-htmlparser2-tree-adapter
  • parse5-parser-stream
  • parse5

NOTE: we still haven't decided if we are ready to do this yet. just leaving this draft here for when we do one day

@wooorm
Copy link
Collaborator

wooorm commented Feb 21, 2025

I am 👍 to esm only

@43081j
Copy link
Collaborator Author

43081j commented Feb 21, 2025

@fb55 if i can get a thumbs up from you too, ill merge and publish this under a new major version

@fb55
Copy link
Collaborator

fb55 commented Feb 21, 2025

I am unable to go ESM-only with Cheerio right now, so would prefer to keep the CJS build

@43081j
Copy link
Collaborator Author

43081j commented Feb 21, 2025

I am unable to go ESM-only with Cheerio right now, so would prefer to keep the CJS build

are you on node <20?

also, unless you see us adding features, you could just stick to the current version, no? it seems unlikely we'd change API, so won't have anything in the new major that the old one doesn't have already

@43081j
Copy link
Collaborator Author

43081j commented Mar 7, 2025

@fb55 can we discuss this?

I'm in the process of migrating a lot of other packages I maintain to esm-only. so it'd be good to wrap this one up one way or another

if you still need CJS, that's what the old version is for since its unlikely we'll add any features any time soon. if somehow there is a fix, we can backport it if needed

we don't need to be afraid of major versions. its ok to continue using the previous one in cheerio

@cardoso
Copy link
Contributor

cardoso commented Mar 7, 2025

Also #1410 is now unblocked and could land in the current major, so in addition to feature parity, the dependencies won't stay behind.

@43081j
Copy link
Collaborator Author

43081j commented May 7, 2025

@fb55 maybe lets revisit this?

my plan would be this now:

  1. fix the entities problem (not sure how yet, but do it in a way that its still dual-package but can be used without node16 resolution in typescript)
  2. release entities as ESM only (new major)
  3. release parse5 as ESM only (new major)

Switches the 3 remaining dual packages to ESM only:

- `parse5-htmlparser2-tree-adapter`
- `parse5-parser-stream`
- `parse5`
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.

4 participants