Works! But it is stuck at a proof of concept stage.
Somehow we've never seemed to adopt it in our daily practice as developers. Somehow println/cljs-devtools/figwheel seemed to win. So we're not pushing on with it. Waiting instead for tech like cljs-devtools and dirac to mature. And for Colin to do something better in Cursive - hurry up Colin, we're paying customers now :-)
Abra is a proof of concept ClojureScript debugger.
It works!! It does the stuff you can't do via a normal repl.
You can set breakpoints and, when they are hit, you can:
- inspect the value of ClojureScript variables in the call stack
- evaluate arbitrary cljs code, referencing locals on the stack.
In the future, Abra may evolve towards being a [Time Traveling Debugger] and perhaps include some effortless, optional tracing facilities.
We think designing a good debugger is a data visualization problem. Not that we really know what that means, just yet ,except to say that ClojureScript, being a lisp, has a set of properties which should allow for a really nice debugging story.
This is clunky and ugly.
It is especially fruitless to tell people to "never judge a book by its cover". Everyone does and there is absolutely nothing you can say to make them not do it.
But really, you shouldn't judge Abra by its current poor cover.
That worked, right?
Our goal until now has been to simply prove the concept, not to create something lovely to use. As a result, you will be confronted with a user interface which is basic and clunky.
Oh, and along the same lines, and please don't judge Abra badly for its lack of documentation and poor performance. Did we mention how it is currently a proof of concept?
Chrome's DevTools already do so much. You can set breakpoints, inspect code and page elements, profile, etc. So powerful. You want access to that.
But it lives in a dystopian world wholly without ClojureScript. It can't show you the stack or its locals in ClojureScript terms. A dark place indeed.
Abra solves the problem by putting a ClojusreScrit specific UI side by side with DevTools. You get all the power of DevTools, combined with the a custom ClojureScript capability. They work together.
Magic! Didn't you notice the name?
Should you look behind the curtain, we can neither confirm nor deny that you'd find pieces like:
- Reagent
- re-com (our component library)
- re-frame (our framework)
- atom-shell
- Chrome Remote debugging protocol
- crmux
Crmux is a true secret source. That's the way you can run two debuggers (repls) off the one VM:
- a traditional dev-tools and
- something extra that Abra provides.
To install Abra:
-
Install [Leiningen] and [Node.js].
-
Checkout this repo:
git clone https://github.com/Day8/Abra.git
-
cd into root folder:
cd Abra
-
download dependencies (you might see a fair bit of downloading):
lein deps
-
compile the application (is actually two compiles):
lein build
XXX trouble shooting -- how to run the tests??
-
To run Abra we must start atom-shell the right way:
lein run
-
When Abra starts ... XXXXXX
- fix the - and _ issue (doesn't handle mixed case)
- after you press "Debug" the debug window comes up exactly over the Session window.
- In the Session Details, remember the values put in last time. In fact save the last few values.
- add a spinner after translate
- if Abra is already running, produce an error for the user (chrome remote debugging port is already locked)
- What can we do about the first translate taking so long?
- Pressing "Stop" doesn't really stop
- Verify that the project directory contains a "project.clj" or a ".boot".
- Tried to
lein run
got this D:\Day8-git\Abra2>lein run Your project already has a package.json file. Please remove it. -attempt to delete - fix the - and _ issue for the mixed case
- change code to use https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/repl.clj#L397 to load namespaces look at can't set cljs-ns variable error in analyzer/parse
- look at the ability to run macros in the nrepl