Skip to content

Vue and Svelte component detection #9

Description

@BraedenBDev

React component detection works by reading `__reactFiber$` properties from DOM nodes (see `src/content/react-inspector.ts`). We should extend this to other popular frameworks:

Vue:

  • Vue 2 exposes `vue` on mounted DOM elements
  • Vue 3 uses `vue_app` on the app root and `__vueParentComponent` on component elements
  • Component name, props, and slots are accessible from the component instance

Svelte:

  • Svelte components in dev mode attach `__svelte_meta` with the component filename and source location
  • Svelte 5 (runes) may use different internals — needs investigation

Architecture:

  • Each framework should have its own inspector file (`vue-inspector.ts`, `svelte-inspector.ts`) following the pattern in `react-inspector.ts`
  • Framework detection should be opportunistic: try each detector, use whichever succeeds, fall back to a plain CSS selector if none match
  • A selected element might be inside multiple frameworks (e.g., a Vue app with a React widget) — pick the most specific/innermost match
  • The inspector interface should return: component name, props (serialized), file path (if available), and a human-readable component tree path

Help wanted — contributors who actively use Vue or Svelte would be especially helpful here, since testing requires real-world apps with dev mode enabled.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-importantHigh value, near-term roadmapenhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions