refactor: switch use-resize-observer for a custom hook#3579
refactor: switch use-resize-observer for a custom hook#3579NexPB wants to merge 9 commits intoShopify:mainfrom
use-resize-observer for a custom hook#3579Conversation
|
I did notice comments at |
packages/hydrogen/src/vite/virtual-routes/components/FlameChartWrapper.tsx
Outdated
Show resolved
Hide resolved
use-resize-observer for usehooks-tsuse-resize-observer for a custom hook
|
the CI failure is because the virtual-routes build pipeline assumes all source files are
fix is three one-liners - widen the globs to cheers! |
The virtual-routes build pipeline assumed all source files were .tsx.
The new useResizeObserver.ts hook (correctly .ts — no JSX) was excluded
from tsup entry globs and the build-check extension mapping couldn't
resolve it.
- Widen tsup entry globs from `**/*.tsx` to `**/*.{ts,tsx}` in both
CLI and Hydrogen configs
- Fix build-check.mjs to map both .ts and .tsx to .jsx using a regex,
and remove the dead .replace('src', 'dist') call
(cherry picked from commit 30002f2)
Cherry picked, thanks! |
Merge main into branch to resolve pnpm-lock.yaml conflict. Regenerated lockfile via pnpm install. Updated .husky/pre-commit to use pnpx/pnpm (npx/npm are deprecated in Shopify's dev environment). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fredericoo
left a comment
There was a problem hiding this comment.
nice work removing the third-party dep - using the native ResizeObserver API directly is much cleaner. couple of things to sort before merging though.
packages/hydrogen/src/vite/virtual-routes/components/FlameChartWrapper.tsx
Outdated
Show resolved
Hide resolved
packages/hydrogen/src/vite/virtual-routes/components/RequestDetails.tsx
Outdated
Show resolved
Hide resolved
|
non-blocking: |
…tWrapper.tsx Co-authored-by: ✦ freddie <45042736+fredericoo@users.noreply.github.com>
…tails.tsx Co-authored-by: ✦ freddie <45042736+fredericoo@users.noreply.github.com>
WHY are these changes introduced?
(Mostly done to bring awareness to the outstanding issue #3428)
Currently depends on
use-resize-observerfor dev tooling UI, removeduse-resize-observerthird-party dependency and replaced it with a custom useResizeObserver hook using native browser APIs.WHAT is this pull request doing?
use-resize-observerand replace with custom hook in the@shopify/hydrogenpackageRequestDetailsandFlameChartWrapperto import newuseResizeObserveroptimizeDepslist to removeuse-resize-observerHOW to test your changes?
pnpm installpnpm --filter @shopify/hydrogen testPost-merge steps
None.
Checklist