Skip to content

0.4.0

Compare
Choose a tag to compare
@darwin darwin released this 21 Oct 20:37
· 712 commits to master since this release

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