All Projects → bmeck → proposal-debugger-operands

bmeck / proposal-debugger-operands

Licence: other
Adding an optional operand to the DebuggerStatement production of JS

Programming Languages

HTML
75241 projects

Projects that are alternatives of or similar to proposal-debugger-operands

devtools-course-theory
Course on Development Tools (in Russian)
Stars: ✭ 18 (+38.46%)
Mutual labels:  devtools
useful-forks.github.io
Improving GitHub's Forks list discoverability through automatic filtering. The project offers an online tool and a Chrome extension.
Stars: ✭ 917 (+6953.85%)
Mutual labels:  devtools
linkedin connect
Configurable and easy to use LinkedIn tool to automate connections with personalized messages.
Stars: ✭ 58 (+346.15%)
Mutual labels:  devtools
dots
Minimalist developer setup
Stars: ✭ 38 (+192.31%)
Mutual labels:  devtools
Fiddler-FPlug
Fiddler Plug,Provide Host Mapping、File Mapping、Header Replace、Https to Http、ServerIP、Disable Cache、vConsole、Console Log、JS Inject
Stars: ✭ 30 (+130.77%)
Mutual labels:  devtools
react-render-tracker
React render tracker – a tool to discover performance issues related to unintentional re-renders and unmounts
Stars: ✭ 1,954 (+14930.77%)
Mutual labels:  devtools
rust-cdp
🔨 Chrome DevTools Protocol toolkit for Rust
Stars: ✭ 25 (+92.31%)
Mutual labels:  devtools
drupal-template-helper
Debug Drupal 8 templates in Chrome Devtools. drupal-template-helper is a chrome extension for Drupal that lists all available templates and the preprocess hooks to use to customize your templates.
Stars: ✭ 115 (+784.62%)
Mutual labels:  devtools
flipper-plugin-relay-devtools
Flipper plugin for Relay devtools
Stars: ✭ 26 (+100%)
Mutual labels:  devtools
hanzo
Ansible orchestration to configure a development environment -
Stars: ✭ 22 (+69.23%)
Mutual labels:  devtools
netlogs
Web extension for debugging your API
Stars: ✭ 16 (+23.08%)
Mutual labels:  devtools
exlcode
EXLcode - VS Code-based Online IDE
Stars: ✭ 42 (+223.08%)
Mutual labels:  devtools
mdebug
基于React开发的新一代web调试工具,支持React组件调试,类似于Chrome Devtools。A Lightweight, Easy To Extend Web Debugging Tool Build With React
Stars: ✭ 237 (+1723.08%)
Mutual labels:  devtools
mobx-react-form-devtools
DevTools for MobX React Form
Stars: ✭ 30 (+130.77%)
Mutual labels:  devtools
vscode-advanced-new-file
Create files anywhere in your workspace from the keyboard
Stars: ✭ 68 (+423.08%)
Mutual labels:  devtools
sfcc-devtools
Support Browser Interaction with VS Code, Eclipse, and SFCC Business Manager via DevTools Web Inspector.
Stars: ✭ 5 (-61.54%)
Mutual labels:  devtools
nanoinit
A small, proper, init process for docker containers.
Stars: ✭ 43 (+230.77%)
Mutual labels:  devtools
rkubelog
Send k8s Logs to Papertrail and Loggly Without DaemonSets (for Nodeless Clusters)
Stars: ✭ 15 (+15.38%)
Mutual labels:  devtools
redux-devtools-multiple-monitors
Integrate multiple monitors to your redux devtools.
Stars: ✭ 13 (+0%)
Mutual labels:  devtools
wurl
WebSocket curl - The WebSocket CLI for developers
Stars: ✭ 21 (+61.54%)
Mutual labels:  devtools

Debugger Operands for JS

Bradley Farias

Stage 0

This document proposes adding an optional operand to the DebuggerStatement production of JS.

A guiding example: grouping breakpoints

The following would be an example of allowing a debugging facility to interpret the operand and provide an interface to group breakpoints into logical units.

const log = (v) => {
  debugger { group: 'logging' };
  console.log(v);
};

Why not a meta function.

Presenting this syntax as a meta function would imply that the operand is always evaluated. This proposal leaves it up to the host to determine if it would like to evaluate the operand.

Detecting Debugging facilities

It should be noted that if the operand only runs when the debugging facility is active it potentially exposes this fact to JS code. Steps can be taken that avoid this such as: always evaluating the operand, preventing side effects while evaluating the operand, or never evaluating the operand.

Various libraries already are able to detect the code injection that debugging facilities use so this ability to detect debugging facilities would not be a new feature.

Use cases

Userland breakpoint grouping

const log = (v) => {
  debugger { group: 'logging' };
  console.log(v);
};

This allows debugging facilities to group breakpoints rather than leaving them opaque.

Alternatives

Debugging facilities could read labels of breakpoints to similar effect.

const log = (v) => {
  logging:debugger;
  console.log(v);
};

However this only allows string based naming. With an operand based approach libraries could use Symbols or Objects as a means to be unique.

Userland breakpoint conditions

const route = (httpRequest) => {
  debugger {
    test: () => httpRequest.tracing || !isProduction
  };
  console.log(v);
};

Alternatives

Code can be wrapped in branches to determine if it should fire a breakpoint.

const route = (httpRequest) => {
  if (httpRequest.tracing || !isProduction) {
    debugger;
  }
  console.log(v);
};

In order to reuse this logic the branch must be duplicated, or abstracted to a function call.

const routeA = (httpRequest) => {
  if (httpRequest.tracing || !isProduction) {
    debugger;
  }
  console.log(v);
};
const routeB = (httpRequest) => {
  breakOnTracing(httpRequest);
  console.log(v);
};

Userland debugging assistance

Lots of tools have browser extensions in order to achieve enhanced experiences such as React Devtools. These tools rely on code injection of the main Realm usually and are not able to handle cases where code is not exposed to the main realm. Providing a means for debugging facilities to determine the type of the breakpoint also exposes the possibility for them to read the group of breakpoints and provide extra assistance to the developer.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].