Add DOM.Iterable to hydrogen-react tsconfig lib
WHY are these changes introduced?
The packages/hydrogen-react/tsconfig.json lib setting was ["DOM", "ESNext"], which is missing DOM.Iterable. Without it, the type definitions for URLSearchParams, FormData, Headers, NodeList, and similar DOM iterables do not expose their [Symbol.iterator] method, so iterating them (or spreading them into Object.fromEntries) does not type-check.
This forced a workaround in useSelectedOptionInUrlParam.tsx: two @ts-ignore directives plus matching eslint-disable comments, alongside an outdated TODO: update ts lib. The root tsconfig.json at the monorepo root already sets lib: ["DOM", "DOM.Iterable", "ESNext"], so this brings the package into line with the rest of the workspace.
WHAT is this pull request doing?
- Adds
DOM.Iterableto thelibarray inpackages/hydrogen-react/tsconfig.json. - Removes the
@ts-ignore/eslint-disableworkaround and the staleTODOcomment inuseSelectedOptionInUrlParam.tsx. The runtime behaviour is unchanged. - Adds a patch changeset.
HOW to test your changes?
From the repo root after pnpm install:
cd packages/hydrogen-react
pnpm run typecheck:code
tsc --noEmit passes with the workaround removed.
Checklist
- [x] I've read the Contributing Guidelines
- [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
- [x] I've added a changeset if this PR contains user-facing or functional changes. Test changes or internal-only config changes do not require a changeset.
- [ ] I've added tests to cover my changes
- [ ] I've added or updated the documentation