Convert Figma logo to code with AI

sveltejs logosvelte-devtools

A browser extension to inspect Svelte application by extending your browser devtools capabilities

1,440
78
1,440
8

Top Related Projects

⚙️ Browser devtools extension for debugging Vue.js applications.

An extension that allows inspection of React component hierarchy in the Chrome and Firefox Developer Tools.

Quick Overview

Svelte DevTools is a browser extension that enhances the development experience for Svelte applications. It provides a set of tools for inspecting and debugging Svelte components, state, and props directly in the browser's developer tools.

Pros

  • Seamless integration with browser developer tools
  • Real-time component tree visualization
  • Easy inspection of component state and props
  • Improves debugging efficiency for Svelte applications

Cons

  • Limited to Svelte framework only
  • May have performance impact on large applications
  • Requires manual installation and updates
  • Learning curve for developers new to DevTools extensions

Getting Started

  1. Install the Svelte DevTools extension for your browser:

  2. Open your Svelte application in the browser

  3. Open the browser's developer tools (usually F12 or Ctrl+Shift+I)

  4. Look for the "Svelte" tab in the developer tools panel

  5. Start inspecting and debugging your Svelte components

Note: Svelte DevTools is a browser extension and not a code library, so there are no code examples or installation steps for including it in your project.

Competitor Comparisons

⚙️ Browser devtools extension for debugging Vue.js applications.

Pros of devtools-v6

  • More comprehensive feature set, including time-travel debugging and vuex state inspection
  • Larger and more active community, resulting in frequent updates and improvements
  • Better integration with the Vue ecosystem, including support for Vue 3 and Composition API

Cons of devtools-v6

  • Potentially more complex to use due to its extensive feature set
  • Heavier performance impact on applications, especially for large-scale projects
  • Steeper learning curve for developers new to Vue or devtools

Code Comparison

svelte-devtools:

export function setupDevtools(target) {
  if (!target.__svelte_devtools_injected) {
    target.__svelte_devtools_injected = true;
    injectDevtools(target);
  }
}

devtools-v6:

export function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
  const hook = getDevtoolsGlobalHook();
  if (hook) {
    hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
  }
}

Both repositories provide developer tools for their respective frameworks, but devtools-v6 offers a more feature-rich experience at the cost of increased complexity. The code snippets demonstrate the different approaches to setting up the devtools, with devtools-v6 using a plugin-based system for greater flexibility.

An extension that allows inspection of React component hierarchy in the Chrome and Firefox Developer Tools.

Pros of React DevTools

  • More mature and feature-rich, with advanced debugging capabilities
  • Supports profiling and performance monitoring
  • Larger community and more extensive documentation

Cons of React DevTools

  • Heavier and potentially slower, especially for large applications
  • More complex UI, which may be overwhelming for beginners
  • Requires more setup and configuration for optimal use

Code Comparison

React DevTools:

const MyComponent = () => {
  const [count, setCount] = useState(0);
  return <div onClick={() => setCount(count + 1)}>{count}</div>;
};

Svelte DevTools:

<script>
  let count = 0;
</script>

<div on:click={() => count++}>{count}</div>

Key Differences

  • React DevTools offers more advanced features for complex applications
  • Svelte DevTools has a simpler, more intuitive interface
  • React DevTools provides more detailed performance insights
  • Svelte DevTools integrates more seamlessly with Svelte's reactivity system
  • React DevTools has broader browser and environment support

Both tools are essential for their respective frameworks, but React DevTools is more comprehensive due to React's larger ecosystem and longer history. Svelte DevTools, while newer, offers a streamlined experience that aligns well with Svelte's simplicity-focused philosophy.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Svelte DevTools

Chrome Web Store

Svelte DevTools is a browser extension for the Svelte framework. It allows you to inspect the Svelte state and component hierarchies in the Developer Tools.

After installing you will see a new tab in Developer Tools. This tab displays a tree of Svelte components, HTMLx blocks, and DOM elements that were rendered on the page. By selecting one of the nodes in the tree, you can inspect and edit its current state in the panel to the right.

For Firefox users, you can install the .xpi file of the latest version from the GitHub releases page. Note that if you grab the .zip file, you will need to load it as a temporary extension and enable "Always Allow on localhost" in the extension settings.

2.0.0 Screenshot

Requirements

The svelte-devtools extension requires the following to be true:

  • Chrome or Firefox version 121 or higher
  • Application running Svelte version ^4.0.0
  • Application compiled with dev: true (SvelteKit does this automatically for you)

Development

Clone this repository, setup and run the build script

git clone https://github.com/sveltejs/svelte-devtools.git
cd svelte-devtools
pnpm install
pnpm build

This will build the codebase and output all the required files in the build directory. To load the extension for development, follow these steps:

  1. Navigate to the extensions settings page
  2. Turn on the 'Developer mode' switch
  3. Click 'Load Unpacked' and select the build directory

Acknowledgements

  • This extension was initially created and developed by RedHatter