fix: resolve potential mount failure in createTeleport#170
fix: resolve potential mount failure in createTeleport#170hexqi merged 3 commits intoopentiny:developfrom
Conversation
WalkthroughThe changes refactor the teleportation logic in Vue components, updating the way teleport targets are resolved and passed. The approach shifts from using reactive objects to factory functions for teleport props, and updates composables to support both selector strings and HTMLElements as teleport targets. Related imports and function signatures are also adjusted. Changes
Sequence Diagram(s)sequenceDiagram
participant Component as Vue Component
participant useTeleportTarget as useTeleportTarget
participant createTeleport as createTeleport
participant Teleport as Teleport
Component->>useTeleportTarget: Call with (reference, appendTo)
useTeleportTarget-->>Component: Returns teleportTarget (HTMLElement or resolved selector)
Component->>createTeleport: Pass props factory function (returns { to: teleportTarget.value }), child render function
createTeleport->>Teleport: Mount teleport with dynamic 'to' target
Teleport-->>Component: Renders children at resolved target
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/components/src/base-popper/index.vueOops! Something went wrong! :( ESLint: 9.31.0 Error: The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it. packages/components/src/shared/composables/createTeleport.tsOops! Something went wrong! :( ESLint: 9.31.0 Error: The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it. packages/components/src/shared/composables/useTeleportTarget.tsOops! Something went wrong! :( ESLint: 9.31.0 Error: The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it.
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🧰 Additional context used🧠 Learnings (3)📓 Common learningspackages/components/src/base-popper/index.vue (3)Learnt from: gene9831 Learnt from: gene9831 Learnt from: gene9831 packages/components/src/suggestion-popover/index.vue (3)Learnt from: gene9831 Learnt from: gene9831 Learnt from: gene9831 🔇 Additional comments (14)
✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit