Skip to content

VS Code extension

The Vue Why Render extension shows which components re-render, why, and how often, without leaving VS Code. The app streams its data to the extension over a local WebSocket.

  • Component tree: a sidebar panel listing the tracked components, sorted by render count.
  • Dependencies: the reactive sources (refs, props, stores) and the components that use them.
  • CodeLens: render count and average duration above components in .vue files.
  • Status bar: the total render count and the number of hot components.
  • Commands: connect, disconnect, pause, resume and reset the scanner from the command palette.
  1. Install the extension.
  2. Turn on the bridge in the app with the vscode option:
import { scan } from 'vue-why-render'
scan(app, {
vscode: true, // connect to VS Code on port 7710
// vscode: { port: 8080, host: 'localhost' } // custom port and host
})
  1. The extension starts a WebSocket server on port 7710 and waits for the app to connect. The browser side reconnects by itself every 3 seconds, so the order of starting the app and VS Code does not matter.
Setting Default Description
vueWhyRender.port 7710 WebSocket port
vueWhyRender.autoConnect true Start listening on activation

If you change the port, change it in the app too: vscode: { port }.

Command Description
Why Render: Connect to App Start the WebSocket server
Why Render: Disconnect Stop the server
Why Render: Pause Scanner Pause data collection
Why Render: Resume Scanner Resume data collection
Why Render: Reset Counters Reset all render counters