Skip to content

fix: bump use-resize-observer to v10 for React 19 support - #1342

Merged
asyncapi-bot merged 1 commit into
asyncapi:masterfrom
boyney123:fix/use-resize-observer-v10-react-19
Aug 31, 2026
Merged

fix: bump use-resize-observer to v10 for React 19 support#1342
asyncapi-bot merged 1 commit into
asyncapi:masterfrom
boyney123:fix/use-resize-observer-v10-react-19

Conversation

@boyney123

Copy link
Copy Markdown
Contributor

Description

Changes proposed in this pull request:

  • Bump use-resize-observer from ^9.1.0 to ^10.0.0 in library/package.json (lockfile updated minimally; the transitive @juggle/resize-observer dependency goes away).
  • Switch library/src/containers/AsyncApi/Layout.tsx to the named useResizeObserver export, since v10 removed the default export.
  • Update the use-resize-observer mock in library/src/__tests__/index.test.tsx to match the named export.

Why

use-resize-observer@9 declares peerDependencies.react: "16.8.0 - 18". When @asyncapi/react-component is installed into a project using React 19, npm's resolver cannot satisfy that peer range and loops indefinitely, alternating React 18 and React 19 at the tree root — npm install never completes. We hit this as a 10-minute CI timeout while upgrading EventCatalog to React 19. pnpm only emits a peer warning, so it is easy to miss in development.

use-resize-observer@10 (released 2026-07-31) supports React 18 and 19 with an open-ended react >=18.2 peer range, drops the react-dom peer and its runtime dependency, and keeps the same useResizeObserver({ ref, onResize }) API used in Layout.tsx.

How the v10 breaking changes affect this library:

  • Default export removed → handled by the import change in this PR.
  • React floor moves to 18.2 → the library already develops against react ^18.2.0; the public peer range (>=18.0.0) is unchanged.
  • onResize now reports a measured 0 as 0 instead of undefined → the existing width === undefined guard remains safe; a 0 width falls through to the container:xl branch as before.
  • /polyfilled entry point removed → not used here.

Testing

  • npm run test:unit — 13 suites, 201 tests pass.
  • npm run build:prod in library — ESM, CJS, UMD and standalone bundles build successfully (webpack 5 resolves the new exports map).
  • npm ci from the updated lockfile installs cleanly; npm ls use-resize-observer reports a single 10.0.0.

Documentation

No documentation changes needed — no public API or configuration changes.

Related issue(s)

See also event-catalog/eventcatalog#2828 (React 19 upgrade blocked by the use-resize-observer@9 peer range).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@sonarqubecloud

Copy link
Copy Markdown

@AceTheCreator AceTheCreator left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AceTheCreator

Copy link
Copy Markdown
Member

/rtm

@asyncapi-bot
asyncapi-bot merged commit c567ca4 into asyncapi:master Aug 31, 2026
20 checks passed
@asyncapi-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.1.7 🎉

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants