Wednesday, February 26, 2014

Chrome DevTools REPL for ClojureScript source code is out.

After major refactoring and clean-up source code for the REPL extension is pushed to GitHub repository.

For UI rendering it uses reagent - a very simple ClojureScript interface to Facebook's react framework. Also, it heavily relies on core.async - it plays very well with asynchronous nature of Chrome DevTools API.

If you want to do some hacking with the code - simply run 'lein cljsbuild auto'  to get everything compiled. After that open extension/repl.html file in your browser - it should work as a usual web page as well, and evaluation will target the page itself.

Alternatively, you can add extension/ directory as "unpacked extension" from the chrome://extensions/ page. Don't forget to enable developer mode, with the check box in the upper right part.

If you want extension to work with local files (URLs starting with file://) - you should also enable "Allow access to file URLs option".

If you make any changes - don't forget to reload the extension (under chrome://extensions/) page and close and re-open Chrome DevTools.

Server side code will follow very soon.

Monday, February 24, 2014

Chrome DevTools REPL for ClojureScript

Initial version for Chrome DevTools (CDT) REPL for ClojureScript is now available at the Chrome Web Store. You can now freely install it into your Chrome browser.

Right now it uses ClojureScript to JavaScript compiler, hosted at Heroku. In the upcoming versions it will be possible to change it, and, of course, run compiler locally.

Out of obvious reasons REPL will only work on pages which contain un-optimized JavaScript code.

Extension source code and it's server counterpart will be placed on GitHub in the next days, once they will become more mature.

Future plans and ideas:
  • improved error reporting
  • completion and syntax highlighting
  • possibility to inject cljs.core into inspected page, which does not contain it
  • deeper integration with Chrome DevTools code editor

All  feedback and comments are welcome and highly appreciated.