Skip to content

fix: parse head markup with the server parser in worker bundles - #5

Merged
MatthewPattell merged 1 commit into
prodfrom
fix/server-parser-in-workers
Sep 6, 2026
Merged

fix: parse head markup with the server parser in worker bundles#5
MatthewPattell merged 1 commit into
prodfrom
fix/server-parser-in-workers

Conversation

@MatthewPattell

Copy link
Copy Markdown
Contributor

Summary

  • The server entry parses head markup through html-dom-parser's string parser and html-react-parser's DOM-to-React step explicitly, so bundles built for browser/worker/workerd conditions (Cloudflare Workers, Vite SSR with ssr.target: 'webworker') no longer need an alias and never touch document. Node output, attribute casing, entities and raw script/style content are unchanged (new jsdom regression).
  • npm run test:worker bundles the built server entry with esbuild for the browser platform and the worker conditions, runs inject/getState without a DOM and compares with Node; wired into PR CI after the build. README documents Workers/edge support.

Test plan

  • lint, types, 37 tests, build, test:worker (default, worker, workerd, combined conditions)
  • browser build output unchanged

Comment thread scripts/test-worker.mjs Fixed
Comment thread scripts/test-worker.mjs Fixed
@MatthewPattell
MatthewPattell force-pushed the fix/server-parser-in-workers branch from 79dced8 to 1be33d5 Compare September 6, 2026 17:42
@sonarqubecloud

sonarqubecloud Bot commented Sep 6, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Sep 6, 2026

Copy link
Copy Markdown

@MatthewPattell
MatthewPattell merged commit 3a6767e into prod Sep 6, 2026
5 checks passed
@MatthewPattell
MatthewPattell deleted the fix/server-parser-in-workers branch September 6, 2026 17:50
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants