lambder / cljs-devtools

Chrome DevTools extensions for ClojureScript developers

Home Page:https://github.com/binaryage/cljs-devtools-sample

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cljs-devtools GitHub license Clojars Project Travis

  • Better presentation of ClojureScript values in Chrome DevTools (custom formatters)
  • More informative exceptions (sanity hints)
  • Support for Dirac DevTools (dirac)

An example of formatting various ClojureScript data structures:

Scope view / drawer Console (toggle with ESC)

An example of a sanity hint:

An example of a sanity hint

Read more in v0.4.0 release notes.

Integration in your own project

Add devtools dependency into your Leiningen's project.clj

Clojars Project

To install it. You have to call install! from devtools.core namespace. Ideally run this as early as possible during launch time of your app.

(ns your-project.core
  (:require [devtools.core :as devtools]))

; this enables additional features, :custom-formatters is enabled by default
(devtools/enable-feature! :sanity-hints :dirac)
(devtools/install!)

(.log js/console (range 200))

Check out the sample project.

Enable Custom formatters in Chrome

Available in Chrome 47 and higher.

  • Open DevTools
  • Go to Settings ("three dots" icon in the upper right corner of DevTools > Menu > Settings F1 > General > Console)
  • Check-in "Enable custom formatters"
  • Close DevTools
  • Open DevTools

Note: You might need to refresh the page first time you open Console panel with existing logs - custom formatters are applied only on newly printed console messages.

What next?

About

Chrome DevTools extensions for ClojureScript developers

https://github.com/binaryage/cljs-devtools-sample

License:Other


Languages

Language:Clojure 52.6%Language:JavaScript 47.2%Language:HTML 0.2%