A Clojurist Together Funding story.
TLDR; Please help with testing that Calva can connect and enable the REPL in your projects.
- Install this prerelease VSIX package in VS Code.
- See this issue for some of the documentation of the feature:
Clean up those Project Files
One of the major things cooking in the Calva distillery right now is that we want to contribute to the community such that fewer Clojure and ClojureScript projects out there need to specify their editor tooling dependencies and setup. It has many benefits, which I won’t elaborate on here.
Connecting the REPL
Some terminology: Calva distinguishes between connecting to a running REPL – which we call Connect, and starting the REPL and connecting – which we call Jack in. These are terms and approaches inherited from the CIDER that Calva is distilled from.
Jack in is the mechanism which can make most of the difference in moving editor specific configuration out of the project and in to the editor settings. It is not as clear cut as either Jack in or Connect, however. Consider the ClojureScript REPL (other than the self hosted kind, that Calva yet can’t offer a REPL for). It needs to be started off of the Clojure REPL. A sort of Jack in, I would say, and it will need to happen even in the Connect to a running REPL case.
The Connect Sequence
As @kstehn and I discussed the need for improving Calva’s support for different kinds of Clojure and ClojureScripts projects, and I tried to describe it in different ways, Kevin suggested the concept of Jack in and Connect Sequences. Which is what we decided to model this feature around.
The prerelease linked above, and the issue to go with it is about:
- Adding Customizable Connect Sequences, via user configuration/settings.
- Defining Calva’s built in sequences using the customizable configuration mechanism. (This has moved a lot of code to just a little data, making this important part of Calva a lot more maintainable.)
Here’s a summary of what the linked prerelease adds to Calva:
- Support for configuring Custom Connect Seqences. These can be:
- Clojure only, supporting Leiningen, Clojure CLI, and shadow-cljs.
- Clojure + ClojureScript, supporting Figwheel Main, shadow-cljs, Nashorn, lein-figwheel, and fully customized cljs repl types.
- Much improved custom ClojureScript REPL configuration.
- Improved dependency injection at Jack in.
- Improved help for the user to get the ClojureScript REPL connected.
- Improved ClojureScript Build switching. (Since Calva only allows for two REPL connections (yet), one for Clojure and one for ClojureScript. It instead makes it easy to attach the ClojureScript repl connection to different ClojureScript builds in your project.)
- A feature to add custom Clojure code to be evaluated when the Clojure repl has been attached. Maybe your project needs to start a web server before attempting to start a web client and connect a ClojureScript repl?
- All built in ClojureScript REPLs are made using the Custom REPL Type configuration.
- Nashorn added as a built in ClojureScript repl type.
- Support for launching with user alieses/profiles
As the list reveals, in the process of adding this new feature, we have improved both Jack in and Connect, rounding off many of the rougher edges. This is, from that perspective, ready for realease. But I’d like to get some field testing done, in case there are projects out there that still can’t use Calva Jack in, but are in reach (for some definition of ”in reach”). And feeedback on the configuration and its documentation is very welcome as well.
How to help testing:
- Install VS Code, if you haven’t.
- Download the Calva v2.0.35-wip-custom-repl-connect-sequence prerelease (a VSIX package).
- From the VS Code Extensions pane, use the little meatballs menu to Install from VSIX… and install the downloaded VSIX package.
- Use the README, the Calva wiki, the comment section below, and the #calva-dev channel at the Clojurian’s Slack, to get going.
Happy helping!