Skip to content

Releases: binaryage/cljs-devtools

0.5.3

25 Mar 16:11
Compare
Choose a tag to compare

Dead code elimination

Originally I didn't anticipate including cljs-devtools into advanced builds because currently custom formatters do not work under advanced optimizations. Until now, my approach in projects including cljs-devtools was to require cljs-devtools only into development builds and completely skip it in advanced builds using modified :source-paths set.

Recently @domkm raised a valid expectation that cljs-devtools should play well with advanced builds:

Advanced compilation is not eliding dead code as I would expect it to. With goog.DEBUG as false, (when ^boolean goog/DEBUG (devtools/install!)) causes cljs-devtools to be included in the advanced build even though that is the only use of cljs-devtools in the project. Any ideas why it's not being elided?

When you:

It could look something like this. Please note that ^boolean hint is important for closure advanced optimizer to clearly understand that the conditional will always evaluate to false:

(if ^boolean goog/DEBUG (devtools/install!))

Alternative method could be to write a simple macro which would emit (devtools/install!) call only if under advanced build (for example there is an environmental property set signalling that).

I'm happy to announce that the above techniques work as expected since v0.5.3. Also I have added tests to ensure this won't break in the future and advanced builds will do full elide in those cases.

Notable commits:

  • e5fad13 fix CLJS-1545
  • 4a93a95 include dead code elimination check as part of standard testing
  • 27503b4 sanity-hints: play well with dead code elimination in :advanced builds
  • 8fd78f9 defonce prevents dead code elimination in :advanced builds
  • cb212d6 dirac: remove exported api

0.5.2

24 Jan 21:44
Compare
Choose a tag to compare

Mostly visual improvements

I did some random work on improving styles. Also fixed a regression when native javascript objects were not expandable (since ClojureScript r1.7.28).

Dirac API bumped to v2 for compatibility with upcoming Dirac v0.1.1.
I have exposed more configurable options for Dirac on client side. Also bumped dependencies.

Notable commits:

  • 2f1c0f4 fix regression introduced in clojurescript r1.7.28
  • a82e520 remove dashed border around body boxes
  • 00fbac1 tweak presentation of expanded strings
  • 7a973f2 prevent content wrapping
  • c21a898 rename & expose more client-side dirac config options

0.5.1

21 Jan 22:17
Compare
Choose a tag to compare

Detection of circular data structures

Renderer newly checks for expansion of cycles in data structures. It displays a small marker when you are following a cycle in printed data.

You can newly check for availability of individual cljs-devtools features prior installing (issue #10).

Also I have improved the way how to detect whether values are cljs values or plain js values. It does not depend on try-catch anymore and the benefit is that it won't interfere with your debugging experience when using "Pause On Caught Exception".

Notable commits:

  • 1359810 cljs-value? check does not depend on catching exceptions
  • 7e11bcc fix infinite recursive expansion in an edge case (close #8)
  • 856c542 detect and visually mark circular data structures
  • 01ffd2e tweak the style of body lines
  • 0efb20f use negative margin trick to render body with top border
  • cff6224 check if features are available (close #10)

0.5.0

13 Jan 01:30
Compare
Choose a tag to compare

Support for Dirac DevTools

Dirac is a fork of Chrome DevTools which adds some new features for ClojureScript developers. We don't have to wait anymore for Chrome developers to implement tools requested by ClojureScript community. We can potentially do that ourselves in this fork.

https://github.com/binaryage/dirac

Notable commits:

  • a660bce make parsing stack traces in sanity hints more roubust
  • 33363d8 display startup banner indicating enabled features
  • 57b8a90 mark core/enable! and core/disable! as deprecated

0.4.1

02 Nov 00:37
Compare
Choose a tag to compare

Improved markup and styles

We newly render expandable boxes using opacity and with borders. This gives user better visual clues in case of more complex data structures.

Notable changes:

  • [0c5ca0c] Templates are less "busy". Seqs with less than 3 elements are not expandable.
  • [b72b483] Expanded items are rendered with opacity as nested boxes with borders.

0.4.0

21 Oct 20:37
Compare
Choose a tag to compare

Meta data support and sanity hints

Meta data support

If cljs value has some meta data attached. It gets printed as expandable "meta" item after the value itself:

Sanity hints

Sometimes your DevTools shouts at you Cannot read property 'call' of null!

And now what? you ask.

It is possible to enable "sanity hints". An attempt to augment uncaught exceptions and error object to include a bit of additional knowledge related to incoming error. It tries to fetch the original source file, extract relevant part to show you more context and mark javascript error there. This is expected to work only with :optimizations none compiler mode and it is disabled by default because it relies on monkey patching. But it is worth it:

Note <<< ☢ RETURNED NULL ☢ <<< part which points to error location. The uncaught error was raised by calling sanity-test-handler in the following code:

(defn fn-returns-nil [])

(defn sanity-test-handler []
  ((fn-returns-nil) "param"))

You can enable the feature by setting this pref prior calling install!:

(devtools/set-pref! :install-sanity-hints true) ; this is optional
(devtools/install!)

Technical details are described in the source file.

Other changes:

  • [93c2c88] it is possible to set pre- and post- processing handlers to wrap cljs-devtools functionality
  • [f1474ef] added support for :legacy-formatter
  • [2caf851] sequables are always expandable by default

0.3.0

06 Jun 06:50
Compare
Choose a tag to compare

Customisable preferences

It is now possible to override default formatting styles and other preferences:
https://github.com/binaryage/cljs-devtools/blob/master/src/devtools/prefs.cljs

Debug code was moved into a separate folder and is not included in released jar.
Also the code should work under :advanced mode compilation.

Changes:
#3 - Allow to customize default formatters style
9d50dce - Decreased max-print-level to 2 again
13d9e1b - Moved debug.cljs under a separate directory tree
230b299 - CLJSDevtoolsFormatter should survive :advanced compilation

0.2.2

02 May 17:25
Compare
Choose a tag to compare

Prevent infinite expansion in headers

I did some internal reorganisation to decouple devtools debugging code from main sources. Normally you should require devtools.core namespace only and optionally devtools.format if you want to write your custom formatting functions. Unless you require devtools.debug the dependecy system should not bring all the debugging machinery into your project.

Changes:
#2 - Prevent infinite expansion in headers

0.2.1

24 Apr 11:59
Compare
Choose a tag to compare

Header object references are back

This release is compatible with latest Blink changes introduced here:
https://codereview.chromium.org/1096283003

DevTools developers allowed object references in headers again. Also we can now use references to native objects directly and it does not break console layout.

Changes:
#1 - Handle namespaced keywords properly
31a3b7a - Raised maximal print level to 3 (from 2)

0.2.0

12 Apr 16:36
Compare
Choose a tag to compare

Catch up with Blink

Blink introduced some breaking changes in https://codereview.chromium.org/1072523002. Make sure you are using the latest Chrome Canary: chrome://version should have Blink version >= r193475.

This release also resolved problem of recursive expansion of native javascript objects.