Files
firefox/devtools/client/debugger/packages/devtools-reps/README.md
T
Nicolas Chevobbe 6f3161847b Bug 1590633 - Remove Reps launchpad. r=Honza.
This means we can also cleanup the package.json,
and remove file that were only needed for the
launchpad.

Differential Revision: https://phabricator.services.mozilla.com/D50174
2019-10-25 12:08:17 +00:00

1.8 KiB

DevTools Reps

Reps is Firefox DevTools' remote object formatter. It stands for representation.

Example

const React = require("react");
let {
  Rep,
  Grip,
  MODE,
  ObjectInspector,
  ObjectInspectorUtils
} = require("devtools-reps");

function renderRep({ object, mode }) {
  return Rep({ object, defaultRep: Grip, mode });
}

ReactDOM.render(
  Rep({ object, defaultRep: Grip, mode }),
  document.createElement("div")
);

What is what?

Rep

Rep is the top-level component that is capable of formatting any type.

Supported types:

RegExp, StyleSheet, Event, DateTime, TextNode, Attribute, Func, ArrayRep, Document, Window, ObjectWithText, ObjectWithURL, GripArray, GripMap, Grip, Undefined, Null, StringRep, Number, SymbolRep,

Grip

Grip is a client representation of a remote JS object and is used as an input object for this rep component.

Running the tests

Reps tests are written with jest, and you can run them locally by executing yarn test.

History

The Reps project was ported to Github January 18th, 2017. You can view the history of a file after that date on github or by running this query:

git log --before "2017-1-17" devtools/client/shared/components/reps

They were first moved to the devtools-reps repository, then to the devtools-core one, before being migrated to this repository.

License

MPL 2