Skip to content

feat!: migrate parse5 to v8 and convert JSDoc packages to TypeScript#3046

Draft
bennypowers wants to merge 14 commits intonode24/esm-and-node24from
node24/parse5-and-jsdoc
Draft

feat!: migrate parse5 to v8 and convert JSDoc packages to TypeScript#3046
bennypowers wants to merge 14 commits intonode24/esm-and-node24from
node24/parse5-and-jsdoc

Conversation

@bennypowers
Copy link
Member

Summary

BREAKING CHANGE: parse5 v6 is no longer supported. Requires parse5 v7+ or v8.

parse5 v8 migration

  • Update all parse5 type imports to use DefaultTreeAdapterTypes namespace
  • Update parse5 dependencies from ^6.0.1 to ^7.0.0 || ^8.0.0
  • Remove @types/parse5 (types now bundled)
  • Update dom5 internal library for parse5 v8 compatibility

JSDoc → TypeScript conversions

  • config-loader: convert .js → .ts
  • parse5-utils: full TypeScript rewrite with parse5 v8 API
  • rollup-plugin-copy: convert .js → .ts
  • rollup-plugin-import-meta-assets: convert .js → .ts
  • storybook-utils: convert .js → .ts

Dependency upgrades

  • koa: 2.x → 3.1.1 (dev-server-core)
  • ws: 7.x → 8.18.3 (dev-server-core)
  • @types/koa: 2.x → 3.0.1
  • @types/ws: 7.x → 8.5.13

test-runner-mocha

  • Update rollup config for ESM/nodenext compatibility

This is PR 4 of 4 in the Node 24 migration stack.

Stack

  1. node24/typescript-upgrade — TypeScript upgrade + .ts imports (chore: upgrade TypeScript to 5.9.3 and enable .ts imports #3043)
  2. node24/test-migration — mocha/chai → node:test migration (chore: migrate tests from mocha/chai to node:test #3044)
  3. node24/esm-and-node24 — CJS→ESM + Node 24 requirement (feat!: require Node 24 and migrate CJS to ESM output #3045)
  4. This PR — parse5 v8 + JSDoc→TS + koa/ws upgrades

Test plan

  • npm run build passes with zero TS errors
  • CI passes
  • parse5 API migration verified

🤖 Generated with Claude Code

@changeset-bot
Copy link

changeset-bot bot commented Mar 17, 2026

⚠️ No Changeset found

Latest commit: 3d75891

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

@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch from f2b5763 to f8015fd Compare March 17, 2026 11:52
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch from dbf9c91 to dab33f2 Compare March 17, 2026 11:52
@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch from f8015fd to 18a0066 Compare March 17, 2026 12:53
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch from dab33f2 to f09bc1b Compare March 17, 2026 12:53
@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch from 18a0066 to a2a3658 Compare March 17, 2026 14:57
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch from f09bc1b to d6208f0 Compare March 17, 2026 14:57
@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch from a2a3658 to eb87c8d Compare March 17, 2026 16:48
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch from d6208f0 to e5228eb Compare March 17, 2026 16:48
@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch from eb87c8d to b1a23e2 Compare March 17, 2026 17:03
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch from e5228eb to ff9fbd4 Compare March 17, 2026 17:03
@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch from b1a23e2 to b77e600 Compare March 17, 2026 18:02
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch from ff9fbd4 to 9d8ff0d Compare March 17, 2026 18:02
@bennypowers bennypowers marked this pull request as draft March 17, 2026 18:34
@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch from b77e600 to 10e9722 Compare March 17, 2026 19:01
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch from f19d625 to 0d3918c Compare March 17, 2026 19:01
@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch from 10e9722 to d3acddd Compare March 18, 2026 12:08
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch 2 times, most recently from 09a2b50 to bf230a6 Compare March 18, 2026 13:33
@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch 2 times, most recently from 441c093 to e99e801 Compare March 18, 2026 14:47
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch from bf230a6 to ce7d2fe Compare March 18, 2026 14:47
@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch from e99e801 to f9df49b Compare March 18, 2026 14:58
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch from ce7d2fe to 094ace3 Compare March 18, 2026 14:58
BREAKING CHANGE: parse5 v6 is no longer supported.

parse5 v7+/v8 migration:
- Update all parse5 type imports to use DefaultTreeAdapterTypes namespace
- Update parse5 dependencies from ^6.0.1 to ^7.0.0 || ^8.0.0
- Remove @types/parse5 (types now bundled with parse5)
- Update dom5 internal library for parse5 v8 compatibility

JSDoc → TypeScript conversions:
- config-loader: convert .js source files to .ts
- parse5-utils: rewrite as TypeScript with parse5 v8 API
- rollup-plugin-copy: convert .js source files to .ts
- rollup-plugin-import-meta-assets: convert .js source files to .ts
- storybook-utils: convert .js source files to .ts

Additional changes:
- Upgrade koa to v3.1.1 and ws to v8.18.3 in dev-server-core
- Upgrade @types/koa to v3.0.1 and @types/ws to v8.5.13
- Fix WebSocketsManager for ws v8 API (WebSocketServer)
- Update test-runner-mocha rollup config for ESM/nodenext

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add missing `import type` keywords across 20+ source files
- Add CJS interop: isbinaryfile, ua-parser-js, pngjs, esbuildPlugin
- Delete old .js test files replaced by .mjs equivalents
- Add 84 rollup-plugin-html test fixtures
- Fix CI workflow configs for Node 24
- Remove mocha and @types/parse5 from package devDependencies
- Fix "type": "module" placement in package.json files
- Update changeset config
- Add mocks demo files

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Files were dropped when git rebase --skip was used to resolve
conflicts between PR2's test migration and PR3/PR4's changes.
Re-applied from fix/node24.

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Restore JSDoc packages (config-loader, parse5-utils, rollup-plugin-copy,
  rollup-plugin-import-meta-assets, storybook-utils) to master .js sources
  (JSDoc→TS conversion belongs in PR4)
- Restore parse5 v6 type imports (parse5 v8 migration belongs in PR4)
- Restore ws v7 API in WebSocketsManager (ws v8 belongs in PR4)
- Fix Token → Attribute import for parse5 v6 compat in rollup-plugin-html
- Fix Object.values(bundle) unknown type with explicit cast
- Add CJS interop for saucelabs and internal-ip (needed for nodenext)
- Add CJS interop for rollup plugins in storybook-builder (needed for nodenext)
- Restore master test scripts (test migration belongs in PR2)

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The .ts file was dropped during rebase. Restore from fix/node24
and remove the .js source (JSDoc→TS conversion is PR4's purpose).

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nfigs

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ts-node with module:nodenext treats .ts files as ESM, causing
"Cannot require() ES Module" errors. Override both module and
moduleResolution to commonjs/node for test execution.

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
koa v3 + @types/koa v3 and ws v8 + @types/ws v8 are required for
module:nodenext compatibility. @types/koa v2 and ws v7 types don't
resolve correctly with nodenext module resolution.

Add build script workaround to remove nested @types/koa and @types/ws
installed by transitive dependencies (@rocket/cli) which conflict
with the workspace package versions.

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bennypowers bennypowers force-pushed the node24/parse5-and-jsdoc branch from 094ace3 to 3d75891 Compare March 18, 2026 17:03
@bennypowers bennypowers force-pushed the node24/esm-and-node24 branch from f9df49b to 16c8d24 Compare March 18, 2026 17:03
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.

1 participant