Skip to content
jankeromnes edited this page Dec 1, 2011 · 5 revisions

Purple

Main Components

Purple will need three main components to get off the ground:

  1. Interactive Log,
  2. JavaScript Instrumentation,
  3. Runtime Control.

Interactive Log

The Log is a long array of events. Some events arrive from the Chrome browser, both devtools events and chrome.extension events. (todo) Some events arrive from the JavaScript instrumentation system. (todo) Some events arrive from other processes or machines (see Causeway).

The Log output shows up in an interactive console-like UI. The interaction includes:

  1. browsing for more detailed information (opening twistys),
  2. (todo) searching for related information (findAnything bar),
  3. editing source related to log entries,
  4. (todo) opening external editors on log entries,
  5. (todo) triggering instrumentation and re-execution to create new Log entries.

JavaScript Instrumentation

(todo) The JS instrumentation includes:

  1. Manipulate the runtime using the Chrome devtools API,
  2. Re-compile the JavaScript using Traceur's code generator to add statements that extract information
  3. Shim the DOM API to log/control/modify the interaction of the app with the browser.

Runtime Control

(todo) The runtime control includes:

  1. Automated reload/re-submit events,
  2. Re-execution of event loops,
  3. Simulation of re-load/re-execution (proxied I/O)
  4. Checkpoint browser state.

Roadmap

1. Cool Console

Start with the Log and its UI: these can be built and useful without instrumentation or runtime control. So goal #1 is a useful tool for rapid, small edits based on browser events and console logs. This may not win any users, but this stage should support some dogfood use to drive quality and function on the Log. (The current system is a prototype for this goal #1).

2. Hot-load JavaScript

Dev tools already supports function replacement. We need to leverage this and learn its limitations.

3. Beyond Stack Traces

Add instrumentation of JS exceptions. Many exceptions can be solved with one line edits; others can be solved with more data than current stack traces give.
The instrumentation may be all through dev tools APIs. This will exercise the Cool Console and Hot-load JS in a realistic way.

4. Traceur on All

Run a complete web site's JS through the Traceur compiler. This intermediate step does not help Purple, but it would provide a way to test Traceur on arbitrary sites.

5. Set a reproduction point.

A reproduction point is a (single) breakpoint after bug symptom. This begins runtime control. Probably some user value.

6. Re-execute event turn.

From the reproduction point, re-run just the event loop.

7. Modified Code Generation

Here the Traceur step causes new log events.