![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
view-launcher
Advanced tools
ViewLaucherA tool for inspecting and opening view files in your code editor <s
When you're working on a rather large project, you may have lots of views, whenever you want to make a change to a specific view, you have to figure out where it was located first.
Even if you just want to change a single letter of the view, you have to first find out the view, to me, this is super tedious and unproductive‼ Especially when collaborating with other people, chances are that you'll have a hard time finding the view file…
This package provides you a simple way to locate the view file. Just click the HTML element from the browser, it'll jump to the view file in your code editor automagically.
Kind of like a "sourcemap of markup", helps you inspect your view at light speed ⚡⚡️️
A full demo(for Vue.js using Vite) can be found at the playground directory.
If you'd like to have it a try, just cd into playground
run yarn dev
.
The default shortcuts for inspecting elements are:
Key | Action |
---|---|
A A | Toggle inspect mode |
C C | Toggle inspect mode, but only inspect components |
D | Open with your editor(the default setting is VSCode) |
E | Inspect the parent element of current inspecting element |
Notice: This is the usage guide for client-side lib of ViewLauncher.
For framework specific installation guide see:
You can ignore this if you are using one of the above packages, you are going to have the same options in there.
import { viewLauncher } from 'view-launcher'
const options = {
theme: 'light',
editor: 'vscode',
shortcuts: {
open: 'd',
inspect: 'a a',
inspectComponent: 'c c',
inspectParent: 'e',
},
}
viewLauncher(options)
The following options are available.
type Options = {
/**
* The color theme to be used.
*/
theme: 'dark' | 'light'
/**
* The editor you'd like to use.
*/
editor: Editor
/**
* The shortcuts settings.
* see the link below for the possible values.
* @link https://github.com/ccampbell/mousetrap
*/
shortcuts: {
/**
* Open the editor.
*/
open: string
/**
* Toggle inspect mode.
*/
inspect: string
/**
* Toggle inspect mode, but only inspect components.
*/
inspectComponent: string
/**
* Inspect the parent element of current inspecting element.
*/
inspectParent: string
}
}
sublime
textmate
emacs
macvim
phpstorm
webstorm
idea
vscode
vscode-insiders
atom
Elements where have the data-tag-info
attribute will be marked as "inspectable elements".
An example of the value of data-tag-info
attribute may look like this:
{
"view": "/path/to/the/view/file",
"line": 100,
"column": 23,
"component": "Modal"
}
ViewLauncher(client-side lib) is going to use the information taken from data-tag-info
to open the view files.
The data-tag-info
attribute should be injected automatically at the compile-time of view file.
For instance, in the case of Vue-SFC, data-tag-info
attributes are injected at the load/transform stage of your bundler.
PR is always welcomed. Let me know if you are considering implementing any new support for other template languages 🖐🏼.
FAQs
ViewLaucherA tool for inspecting and opening view files in your code editor <s
The npm package view-launcher receives a total of 13 weekly downloads. As such, view-launcher popularity was classified as not popular.
We found that view-launcher demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.