DEV Community

Cover image for element-source: Resolve DOM Element Source Locations at Runtime
jQueryScript
jQueryScript

Posted on

element-source: Resolve DOM Element Source Locations at Runtime

element-source: a JavaScript library that resolves the source file location, component name, and full stack trace for any DOM element at runtime.

Key features:

  • Works with React, Preact, Vue, Svelte, and Solid
  • Async API with resolveElementInfo, resolveSource, resolveStack, and resolveComponentName
  • Custom framework resolver support via createSourceResolver
  • Built-in stack formatting with formatStack and formatStackFrame
  • Originally built to power React Grab, a browser tool for feeding source context to AI coding agents

๐Ÿ‘‰ Blog Post

๐Ÿ‘‰ GitHub Repo

๐Ÿ‘‰ Live Demo

Top comments (0)