Clojure REPL for Atom written in ClojureScript with full Teletype support for pair programming. Let's party! 😄
Open or add your project folder inside Atom, and follow one of the methods below:
Start a local nREPL server with Leiningen:
Open a file in the project folder, and focus on the file so it has a blinking cursor.
Go to Atom's menu bar and select Packages -> Clojure Party Repl -> Start Local REPL
Make sure lein
command is available and there's project.clj
in the root directory.
Connect to a remote nREPL server:
Have a running nREPL ready to be connected.
Go to Atom's menu bar and select Packages -> Clojure Party Repl -> Connect to Remote REPL server
Fill out the pop out panel and hit an Enter key to connect.
Connect to a remote Unrepl server:
Have a running Clojure Socket REPL ready to be connected. Socket REPL can be launched in a few different ways:
:jvm-opts ["-Dclojure.server.repl={:port 9999 :accept clojure.core.server/repl}"]
to your project.clj
and start your repl normally.java -Dclojure.server.myrepl="{:port 9999,:accept,clojure.core.server/repl}" -jar ~/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
.Go to Atom's menu bar and select Packages -> Clojure Party Repl -> Connect to Remote REPL server
Fill out the pop out panel and connect. It will upgrade your Socket REPL to unrepl!
Once it's connected to the REPL, there should be two new tabs called Clojure Party REPL History
and Clojure Party REPL Entry
. The History tab shows all the output from the REPL, and the Entry tab is where you can type in code to send over to the REPL.
When you're done with the REPL, simply close the tab and the REPL will be disconnected.
Execute code in REPL using the following methods:
Clojure Party REPL Entry
tab and hit Command-Enter keys.If Command-Enter keys aren't working, other packages' keybindings could be conflicting with Party Repl's. Check if your keybindings for Atom is working right. Go to Atom -> Keymap... to open keymap.cson
and follow the instructions.
Install teletype and share both Clojure Party REPL History
and Clojure Party REPL Entry
tabs. That's it, and now everybody shares the state of the running project!
TODO
Wanna help polish this turd? Sweet! This package is built using shadow-cljs to make development easier supporting both:
First, install the Shadow CLJS node package somewhere on your $PATH:
npm install shadow-cljs
Compile using one of the methods below:
To compile with an auto code-reloading loop with REPL, use:
shadow-cljs watch app
To compile without a code-reloading loop, use:
shadow-cljs compile app
To compile for release with :simple
optimizations, use:
shadow-cljs release app
The first time you run shadow-cljs it will ask you to install stuff into the
project directory. This is ok, it's all blocked by .gitignore
.
After running this you should see compiled JS dropped into the standard lib
folder.
When using the shadow-cljs' watch
mode, most changes will be automatically
reloaded such as changes to ClojureScript functions and vars, however changes to menus and
things on Atom's side will still require a refresh with View -> Developer -> Reload Window.
After you compiled the plugin, run:
apm install
apm link
Next, restart Atom so it will notice the newly linked package. We just created a symlink
from ~/.atom/packages/clojure-party-repl
to your project path.
After restarting Atom, you should see the clojure-party-repl plugin installed and be able to use it.
Now that the package is installed, check the shadow-cljs watch app
output and look for a message saying
"JS runtime connected"
. This means it made contact with our package running in Atom. Now we can
REPL in. This can be finicky, if you don't see the message, try reloading Atom again.
Next, while shadow-cljs is running, in another terminal run:
$ shadow-cljs cljs-repl app
This will connect you directly into the plugin so you can live develop it. You can exit the REPL by typing :repl/quit
Once we add CLJS support, you'll be able to REPL into the package using itself. 🐵
Now that we've got dynamic code-reloading and a ClojureScript REPL into Atom, let's take this thing for a spin.
The easiest way to work on the plugin is to open a new Clojure project
in Atom in Dev Mode. If you don't have a dummy project around lein new app test-project
will make one. Open the new project by going to View -> Developer -> Open In Dev Mode,
and then open the development console View -> Developer -> Toggle Developer Tools to
show any possible errors preventing the plugin from starting.
The best place to start hacking is core.clj
. This is where all
the public functions that do interesting stuff are defined and exported.
If you want to add something cool, follow the pattern in core.clj
and
add your function to shadow-cljs.edn
too.
Exported functions can be linked to keybindings and menu items, checkout the standard
keymaps
and menus
directories.
Copyright 2018 Tomomi Livingstone.
Distributed under the Eclipse Public License, the same as Clojure.
Balloon icon made by Freepik from Flaticon, licensed under CC 3.0 BY.
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.