Skip to content

Javascript dependency: Bump use-resize-observer from 9.1.0 to 10.0.0 (#10265) - #10299

Open
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix/use-resize-observer-10
Open

Javascript dependency: Bump use-resize-observer from 9.1.0 to 10.0.0 (#10265)#10299
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix/use-resize-observer-10

Conversation

@dpage

@dpage dpage commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Supersedes #10265, which could not be merged as it stood.

use-resize-observer 10.0.0 removes the default export in favour of a named one, whilst web/pgadmin/static/js/PgTreeView/index.jsx:19 imported it as a default. Left alone, useResizeObserver resolves to undefined and the Object Explorer dies the moment the hook is called, so the bump needs the import change to go with it:

-import useResizeObserver from 'use-resize-observer';
+import { useResizeObserver } from 'use-resize-observer';

I checked the published package rather than relying on the release notes: v10 exports useResizeObserver as a named export only, in both dist/index.mjs and dist/index.cjs, with no default in either. The hook signature still returns the { ref, width, height } shape that line 81 destructures, this is the only use of the package in the tree, and there is no webpack or jest alias for it.

The rest of v10 costs us nothing: it drops the /polyfilled entrypoint and the @juggle/resize-observer dependency, no longer takes react-dom as a peer, and requires React >= 18.2, comfortably met on React 19.

Testing

Verified by hand in both Chrome and Safari against a local PostgreSQL 18, with the tree expanded through databases, schemas, casts, tables and tablespaces, resizing both the Object Explorer panel and the window. The tree renders and redraws correctly in both.

Worth stating why this one was hand-tested rather than merged on a green board: run-javascript-tests cannot see this class of breakage, since the component only fails when it mounts. That is exactly how the pickr bump in #10264 reached master and took the feature tests down for three days (reverted in #10278), and why #10287 was closed rather than merged.

Summary by CodeRabbit

  • Bug Fixes
    • Improved tree view resizing compatibility following an update to the resize observer dependency.
    • Preserved existing tree view behavior while ensuring resize detection continues to work correctly.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e2915a88-8e52-48c2-a94c-22573bb3a127

📥 Commits

Reviewing files that changed from the base of the PR and between 81ac803 and 7cc2628.

⛔ Files ignored due to path filters (1)
  • web/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • web/package.json
  • web/pgadmin/static/js/PgTreeView/index.jsx

Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review.


Walkthrough

The PR updates use-resize-observer to version 10 and changes PgTreeView to use its named useResizeObserver export.

Changes

Resize observer update

Layer / File(s) Summary
Dependency and import update
web/package.json, web/pgadmin/static/js/PgTreeView/index.jsx
The dependency changes from ^9.1.0 to ^10.0.0. PgTreeView changes from the default import to the named useResizeObserver import.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 7cc26

This updates the resize-observer dependency and its import to preserve Object Explorer behavior; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the dependency upgrade that is the main change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…gadmin-org#10265)

v10 removes the default export in favour of a named one, so the import in
PgTreeView had to change with it; left as it was, useResizeObserver resolves
to undefined and the Object Explorer dies when the hook is called. The rest of
the v10 changes cost us nothing: it drops the /polyfilled entrypoint and its
@juggle/resize-observer dependency, no longer takes react-dom as a peer, and
requires React >= 18.2, which is comfortably met on React 19. The hook still
returns the { ref, width, height } shape the tree destructures.

Verified by hand in Chrome and Safari with the tree expanded through
databases, schemas, tables and tablespaces, resizing the panel and the window.
@dpage
dpage force-pushed the fix/use-resize-observer-10 branch from 538ad0d to 7cc2628 Compare August 18, 2026 08:24
@hiteshjambhale
hiteshjambhale requested review from hiteshjambhale and a lite review from Copilot and removed request for Copilot August 18, 2026 10:12
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.

2 participants