fix: add connectedMoveCallback to the WC implementation#170
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for atomic DOM moves to the Web Component implementation by implementing the connectedMoveCallback lifecycle method. This fixes issue #168 by preventing iframes from reloading when the <ui-resource-renderer> custom element is moved within the DOM using the moveBefore() API in browsers that support atomic moves.
- Extends the base Web Component class with
connectedMoveCallbackimplementation - Adds comprehensive test coverage for the new atomic move functionality
- Includes detailed documentation explaining the feature and its purpose
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
sdks/typescript/client/src/components/UIResourceRendererWC.tsx |
Refactors Web Component definition to use class extension pattern and adds empty connectedMoveCallback method to opt into atomic move behavior |
sdks/typescript/client/src/components/__tests__/UIResourceRendererWC.test.tsx |
Adds comprehensive test suite with 4 test cases covering method existence, invocation, element movement, and class instance verification |
…nt/v5.17.3) (2025-12-20) ### Bug Fixes * add connectedMoveCallback to the WC implementation ([#170](#170)) ([5ac4734](5ac4734))
|
🎉 This PR is included in version 5.17.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…/v5.18.0-alpha.1...client/v5.18.0-alpha.2) (2025-12-20) ### Bug Fixes * add connectedMoveCallback to the WC implementation ([#170](#170)) ([5ac4734](5ac4734))
|
🎉 This PR is included in version 5.18.0-alpha.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…/v5.17.0-alpha.1...server/v5.17.0-alpha.2) (2025-12-20) ### Bug Fixes * add connectedMoveCallback to the WC implementation ([#170](#170)) ([5ac4734](5ac4734))
|
🎉 This PR is included in version 5.17.0-alpha.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…ent/v5.17.2...client/v5.17.3) (2025-12-20) ### Bug Fixes * add connectedMoveCallback to the WC implementation ([#170](MCP-UI-Org/mcp-ui#170)) ([9c653a8](MCP-UI-Org/mcp-ui@9c653a8))
This PR adds an empty
connectedMoveCallbackmethod to the Web Component implementation, fixing #168 (thanks @JuanmanDev !).