• Stars
    star
    135
  • Rank 269,297 (Top 6 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Make ImmutableJS objects more readable when viewed in Chrome DevTools

Immutable.js Object Formatter (Chrome Extension)

Transforms Immutable JS objects to a more readable format when they are logged to the console.

Install the Chrome Extension

Based on immutable-devtools.

The Chrome extension will only work if you enable Custom Formatters in the DevTools settings.

Step 1: Open DevTools settings

Step 2: Enable custom formatters

How it works

The code in "/immutable-devtools" is essentially just a copy of immutable-devtools.

The two main differences are:

  1. We can't use instanceof Immutable.Record to detect if an object is a record, since we don't have access to the Immutable module that's loaded on the page. (We only have access to the one loaded in the extension.)
    We can still identify Records correctly, but the way we do it means there's a chance that an internal change in how Immutable.JS works could break that.
  2. The code can be loaded and unloaded several times on the same page, so we can't rely on variables inside the modules to detect if the formatters have already been injected into the page. Instead I'm setting a window.__ImmutableJSDevToolsFormattersInstalled property.

Then all that's left to do is to load the code in "devtools.js".

Running the code locally

  1. npm install
  2. npm run dev
  3. Load the "/extension" directory as an unpacked Chrome extension
  4. Open "/test-page/index.html" to check everything looks as expected

Make sure to reload the extension after any changes.

More Repositories

1

FromJS

See where each character on the screen came from in code.
JavaScript
540
star
2

javascript-breakpoint-collection

Find what code is causing a browser behavior.
JavaScript
136
star
3

CSS-Todo-App

Basic todo app functionality without using JavaScript
HTML
136
star
4

OctoTern

Jump to variable definition on Github
JavaScript
101
star
5

ElementHistory

See what code created or updated a DOM element
JavaScript
29
star
6

Hacker-News-For-X

News aggregators and communities similar to Hacker News
18
star
7

javascript-clock-speedup

Simulate a faster Date object for debugging purposes.
JavaScript
12
star
8

Minimal-React-Redux-Example

Compact example of setting up Redux.
JavaScript
10
star
9

minmal-Backbone.localStorage-example

Adds notes to a collection and stores them in local storage using https://github.com/jeromegn/Backbone.localStorage.
JavaScript
9
star
10

Object-History-Debugger

See where an object's property values were assigned, plus a history of past values.
JavaScript
9
star
11

JavaScript-Dynamic-Analysis

Dynamic Analysis Tools and Resources
8
star
12

react-with-context

Pass context into React components in your unit test.
JavaScript
8
star
13

super-simple-neural-network

JavaScript
6
star
14

babel-plugin-demo

JavaScript
6
star
15

stacktrace-js-example

An example showing how to resolve a production stack trace using source maps and StackTrace.JS
JavaScript
5
star
16

react-immutable-example

Demo of shouldComponentUpdate and Immutable.js with React.
JavaScript
4
star
17

mattzeunert.github.io

JavaScript
3
star
18

reagic

JavaScript
3
star
19

uk-employment-map

JavaScript
3
star
20

babel-workshop

A workshop about Babel and ASTs
JavaScript
3
star
21

lh-for-fromjs

2
star
22

grunt-svg-cleaner

JavaScript
2
star
23

glasswing

Read source code annotated with runtime variable values.
JavaScript
2
star
24

o-fetch

JavaScript
2
star
25

namespace-logger

Log addition or removal of fields to javascript namespaces - for example global variables in window.*
JavaScript
2
star
26

rexamples-static

HTML
2
star
27

vAnnotate

Visualize program state during execution.
JavaScript
2
star
28

grunt-mutation-testing-example

JavaScript
1
star
29

preact-netlify

JavaScript
1
star
30

code-readability

HTML
1
star
31

obj-prop-bug-demo

JavaScript
1
star
32

javascript-array-memory-consumption

HTML
1
star
33

puppeteer-issue-demo

1
star
34

js-code-browser

1
star
35

CodePathDiff

JavaScript
1
star
36

service-worker-test

JavaScript
1
star
37

content-script-injected-code-executed-late

JavaScript
1
star
38

fromjs-test-cases

JavaScript
1
star
39

nextjs111

JavaScript
1
star
40

react-netlify

JavaScript
1
star
41

neat-starter

HTML
1
star
42

devtools-never-pause-here-demo

An app to demonstrate a use case for Chrome's "Never Pause Here" feature.
JavaScript
1
star
43

source-maps-support-playground

JavaScript
1
star