Skip to content

feat: switch to ESM-only#1411

Merged
43081j merged 1 commit intomasterfrom
esm-only
Jul 9, 2025
Merged

feat: switch to ESM-only#1411
43081j merged 1 commit intomasterfrom
esm-only

Conversation

@43081j
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

wooorm commented Feb 21, 2025

I am 👍 to esm only

@43081j
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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`
@43081j
Copy link
Copy Markdown
Collaborator Author

43081j commented Jun 13, 2025

we actually fixed the entities problem and the other internal issue without having to change esm/CJS in the end

so this should be unblocked now!

if I can get the go ahead from you @fb55 , I'll catch this up and sort out a new major etc

@43081j
Copy link
Copy Markdown
Collaborator Author

43081j commented Jul 9, 2025

@fb55 any chance we can get your thoughts on this one?

would be good to figure out if we can move it forward or if it is blocked

@43081j 43081j marked this pull request as ready for review July 9, 2025 17:59
Copy link
Copy Markdown
Collaborator

@fb55 fb55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this!

@43081j
Copy link
Copy Markdown
Collaborator Author

43081j commented Jul 9, 2025

awesome 🎉

doing one last check over it - we will need to also release a new major of @parse5/tools i think, as it currently depends on parse5 rather than having it as a peer

i do wonder if it should be a peer instead (but would still need a new major to change that)

@43081j 43081j merged commit 058fc58 into master Jul 9, 2025
11 checks passed
@43081j 43081j deleted the esm-only branch July 9, 2025 18:22
@43081j
Copy link
Copy Markdown
Collaborator Author

43081j commented Jul 9, 2025

ok cool i just tried it inside lit and all seems good! ill get this released

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