Swap jsdom for happy-dom test env (ui-extensions) - #7731
Conversation
There was a problem hiding this comment.
Pull request overview
This PR switches the Vitest browser-like test environment for the ui-extensions packages from jsdom to happy-dom, aiming to reduce dependency churn while keeping test behavior unchanged.
Changes:
- Update Vitest config in
ui-extensions-dev-consoleandui-extensions-server-kitto useenvironment: 'happy-dom'. - Replace
jsdomwithhappy-domin the packages’devDependencies. - Update the lockfile and add a changeset for
@shopify/ui-extensions-server-kit.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updates dependency graph to reflect happy-dom adoption and removal of direct jsdom devDeps in the affected packages. |
| packages/ui-extensions-server-kit/vite.config.mts | Switch Vitest environment from jsdom to happy-dom. |
| packages/ui-extensions-server-kit/package.json | Replace jsdom with happy-dom in devDependencies. |
| packages/ui-extensions-dev-console/vite.config.mts | Switch Vitest environment from jsdom to happy-dom. |
| packages/ui-extensions-dev-console/package.json | Replace jsdom with happy-dom in devDependencies. |
| .changeset/swap-jsdom-happy-dom-ui-extensions.md | Adds a patch changeset describing the test-environment/devDependency swap. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --- | ||
| '@shopify/ui-extensions-server-kit': patch | ||
| --- | ||
|
|
||
| Replace `jsdom` devDependency with `happy-dom` as the vitest test environment. This is an internal test-tooling change with no impact on the published package surface. |
gonzaloriestra
left a comment
There was a problem hiding this comment.
The new dependency is 2x heavier (1.17MB vs 0.55MB) and has 7x more releases (185 vs 24 in the last 2 years).
What's the point?
|
@gonzaloriestra you have to consider transitive dependencies. |
|
Right, but:
So I'm still not sure about the purpose of this 😅 What about just deduplicating jsdom instead? We have 25.0.1 and 28.1.0 now |
gonzaloriestra
left a comment
There was a problem hiding this comment.
Ok, now that jsdom was completely removed, I guess it makes sense to switch in order to reduce the number of transitive deps 👍
Co-Authored-By: Claude <noreply@anthropic.com>
Remove unnecessary changeset
7589781 to
ec31b90
Compare
|
This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. |


Swap
jsdom→happy-domtest environment in ui-extensions packagesWhy: Part of an initiative to cut low-value dependency churn (jsdom: ~2 Dependabot bumps / 24 months).
happy-domis a lighter, faster vitest browser environment with no feature gap for these packages' test suites.What changed (devDep-only — 4 files):
packages/ui-extensions-dev-console/vite.config.mts— vitestenvironment: 'jsdom'→'happy-dom'packages/ui-extensions-server-kit/vite.config.mts— vitestenvironment: 'jsdom'→'happy-dom'package.json— removed"jsdom": "^25.0.0", added"happy-dom": "^20.10.1"to devDependencies@shopify/ui-extensions-server-kit(dev-console is"private": true)Validation: All tests pass under happy-dom with no test-code changes — the swap is transparent.
(server-kit type-check ✅. dev-console has pre-existing ReactNode type errors in
.tsxfiles untouched by this change — a test-environment/devDep swap cannot affect those.)Surface impact: devDependencies only — the published artifact of
@shopify/ui-extensions-server-kitis unaffected.🤖 AI-generated draft — needs human review before merge.