# What changed in parse5

> 31 changes in parse5 4 to 8 from its official release notes, upgrade guides and advisories: 13 breaking, 7 new APIs and options. Each one cited. Sources checked 2026-10-23. HTML: https://unstale.sh/npm/parse5/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## parse5 8

### Breaking changes

- parse5 is now ESM-only; applications using CommonJS must adapt their imports. (8.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v8.0.0)

### Performance

- Uses String.fromCharCode for BMP characters in the tokenizer, a performance optimization. (8.0.1) — [release notes](https://github.com/inikulin/parse5/releases/tag/v8.0.1)

## parse5 7

### Breaking changes

- All parse5 packages are now ECMAScript Modules; dual packages are provided for parse5 and parse5-htmlparser2-tree-adapter. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)
- Parsing results might differ in edge cases as parse5 catches up with the HTML spec. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)
- The adapter now uses domhandler’s node interface, and the format of tree nodes has changed slightly. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)
- The package was removed; use the serialize function exported by parse5. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)
- The rewriting stream no longer escapes text in special tags. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)

### New APIs and options

- Support for fragments was added to the parser stream. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)
- Added the scriptingEnabled option. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)
- Added serializeOuter, like .outerHTML. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)
- Hooks for stack events were added to the tree adapter interface. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)

### Performance

- Version 7.0.0 is reported as 45% faster with default options and 167% faster with location information enabled in the bench/perf benchmark on an M1 Mac. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)

### Behavior and default changes

- The rewriting stream now splits very long text sections. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)

### Tooling

- parse5 now ships its own types, so remove @types/parse5*. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)

### Fixes and other changes

- Fixed parsing of << in comments, which was wrongly parsed as <!. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)
- Fixed the position of endTag for mixed-case foreign elements. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)
- Fixed the end position of html and body. (7.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v7.0.0)

## parse5 6

### Breaking changes

- The Tree adapter interface adds this method, enabling usage of custom location info formats; the change is breaking. (6.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v6.0.0)

## parse5 5

### Breaking changes

- Functionality is shipped in separate packages; the parse5 package contains only basic functionality. (5.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v5.0.0)
- SAXParser now passes token objects to event handlers instead of separate arguments. (5.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v5.0.0)
- The location info property name used by currently implemented tree adapters changes from __location to sourceCodeLocation. (5.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v5.0.0)
- The location info property line is renamed to startLine. (5.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v5.0.0)
- parse5 no longer ships TypeScript definitions; existing definitions have moved to DefinitelyTyped. (5.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v5.0.0)

### New APIs and options

- Adds the endLine location info property. (5.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v5.0.0)
- Adds an HTML rewriting stream package. (5.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v5.0.0)
- Tree adapters should implement this method to control the source code location property. (5.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v5.0.0)

## parse5 4

### Breaking changes

- TypeScript definitions are disabled by default; developers must enable them to use the definitions. (4.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v4.0.0)

### Behavior and default changes

- This Node.js-specific API is now lazily loaded, enabling bundling of basic functionality for other platforms. (4.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v4.0.0)
- This Node.js-specific API is now lazily loaded, enabling bundling of basic functionality for other platforms. (4.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v4.0.0)
- This Node.js-specific API is now lazily loaded, enabling bundling of basic functionality for other platforms. (4.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v4.0.0)
- This Node.js-specific API is now lazily loaded, enabling bundling of basic functionality for other platforms. (4.0.0) — [release notes](https://github.com/inikulin/parse5/releases/tag/v4.0.0)
