Bump parse5 from 6.0.1 to 7.0.0
Bumps parse5 from 6.0.1 to 7.0.0.
Release notes
Sourced from parse5's releases.
v7.0.0
Welcome to [email protected]! ✨ This is a huge release with many changes, features and fixes.
From an organisational perspective, the most important change is that parse5 is now maintained by a team, consisting of James (
@43081j), Titus (@wooorm) and me (@fb55). We come from three projects that rely on parse5 — namely Cheerio, rehype, and Lit.We need your support to continue the project! If you care about parse5, please support us financially on OpenCollective.
Headlining features of this release are ES Modules, TypeScript, and performance improvements: 7.0.0 is 45% faster than 6.0.1 with default options, and 167% faster with location information enabled (for the
bench/perfbenchmark, on an M1 Mac). Version 7.0.0 is a revamp of every part of the library. There are too many changes to list them all here, so here is a high-level overview:Breaking: ESM
All of parse5’s packages are now ECMAScript Modules. We are providing dual packages for
parse5andparse5-htmlparser2-tree-adapterfor now (see inikulin/parse5#418 and inikulin/parse5#496).To migrate, please read this Gist on how to update. Note that private internals are no longer available; instead, everything that you need should be imported from the main package.
Implemented by
@43081jin #351Breaking: TypeScript
The codebase has been ported to TypeScript. This helped uncover a number of subtle logic bugs, such as dc4e269022ebbae0767d8f790a29d6be1835fe1e, b4b5d4ad6f90b3c9fd03a90e2ed5267929979a11, or a0aff9578bb44511bc169c1d7f9e2f2780f7f8a0. TypeScript also helps us refactor with confidence and a lot of the changes in this release would have been much harder to do without it.
To migrate, please remove
@types/parse5*as we now ship our own types.Potentially breaking changes
- parse5 was caught up with the HTML spec, and parsing results might differ in edge-cases (inikulin/parse5#442, inikulin/parse5#451)
- The
parse5-serializer-streampackage was removed inikulin/parse5#481
- To migrate, use the
serializefunction exported byparse5.- The rewriting stream now splits very long text sections (inikulin/parse5#434) and doesn’t escape text in special tags anymore (#434). If you worked around these issues before, you might have to update your code.
- The htmlparser2 adapter now uses
domhandler’s node interface (inikulin/parse5#327 by@TrySound)
- The format of the tree nodes has changed slightly; eg. some previous properties are now getters and setters, and vice versa.
If you are using deep imports for any parts of the codebase, you will likely encounter some breakages:
- The tokenizer now uses the state machine pattern from htmlparser2 [
5d7a780(#362)](inikulin/parse5#362)- The token queue was replaced with callbacks (inikulin/parse5#404, inikulin/parse5#405, inikulin/parse5#419)
- The
OpenElementStacknow uses callbacks inikulin/parse5#429- Mixins were removed (as part of #362)
- Location tracking now has a substantially lower overhead inikulin/parse5#402
getNextTokenwas removed inikulin/parse5#461- The parser’s
_bootstrapmethod was removed inikulin/parse5#384- We now drop chunks from the tokenizer right after they are emitted inikulin/parse5#432
- The serializer is no longer a class; instead, different serializer functions call on each other inikulin/parse5#383
- parse5 now uses the
entitiesmodule for encoding and decoding entities, sharing maintenance & optimisation work with projects such as htmlparser2 ([2b92054(#362)](inikulin/parse5#362), inikulin/parse5#486)
entitiesadopted a variant of parse5’s approach of decoding entities. As a result, decoding performance is equivalent, while memory consumption is slightly lower.
... (truncated)
Commits
abec4c2chore(package): Bump versions to 7.0.0 (#509)8168960fix(package): Don't publish source maps (#508)041b8f3chore(deps-dev): bump@typescript-eslint/eslint-plugin(#507)eed0304chore(deps-dev): bump@typescript-eslint/parserfrom 5.19.0 to 5.20.0 (#506)497ece0Bump domhandler to 5.0.2 (#494)99b16a7chore(deps-dev): bump lint-staged from 12.3.7 to 12.3.8 (#505)f243ef5docs: Update projects in README (#504)159ef28refactor: Narrowentitiesimport, enabled isolated modules (#495)7b1401afeat(htmlparser2-adapter): Add CJS build (#496)f854f04chore(deps-dev): bump@typescript-eslint/eslint-plugin(#502)- Additional commits viewable in compare view
Maintainer changes
This version was pushed to npm by feedic, a new releaser for parse5 since your current version.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
⚠️ No Changeset found
Latest commit: a09d5450ecc3a49a30b11e1fb27160d9aeaafdd9
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Superseded by #214.