Releases: binaryage/cljs-devtools
0.5.3
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
asfalse
,(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:
- properly configure
goog.DEBUG
to be "statically" false via :closure-defines - put
(devtools/install!)
behindgoog.DEBUG
conditional (or any other conditional which is statically false) - there is no other mention of devtools functionality in your code
- THEN it should completely elide the library from your advanced builds.
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:
0.5.2
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:
0.5.1
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
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:
0.4.1
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:
0.4.0
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:
0.3.0
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
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
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
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.