Lambda Island Open Source Update July 2021

By Alys Brooks

It’s been a while since our last update! Community contributors and Lambda Island team members have been busy working on new projects and improving existing ones. We’re trying to strike a balance between venturing into new territory while ensuring existing projects continue to improve.

If you want to join in, check out our blog postcalling for contributions, or jump right in to our first issueslist.

A New Project: Fetch

Fetch is a lightweight ClojureScript library over the JavaScript fetch API.  Besides saving you the trouble of JavaScript interop, it returns a Ring-style response back from the Promise and is already integrated into Transit for you.  It’s still new, but we’re excited. We’ve already started using it for our work with clients.

In Beta: Deja-Fu

We’ve created a new library, deja-fu, for managing local date times in JavaScript, intended as an alternative to js-joda, juxt/tick, and other large libraries for apps where time management isn’t a central concern. Besides being lightweight, it boasts an ergonomic API, allowing you to manipulate datetimes as though they were maps.

Friendlier and More Advanced: Kaocha

Kaocha, the most advanced Clojure test runner, continues to get not only more advanced but also friendlier. Here are some of the recent changes:

  • Adds .gitignore support to --watch, allowing you to skip extra test runs.
  • Option to disable  deep-diff in cases where you want to copy the output into a source file or REPL.

Many of the improvements have been adding error messages. A clear error message that tells you exactly what you need to do can save as much time as a nifty new feature or performance improvement.

We’ve also shored up the docs, including new docs for the Orchestra and Preload plugins in September by Arne.

Consistent cross-platform logging with glögi

From the start, Glögi has allowed you to do pedestal.log-style logging in ClojureScript. However, this still meant using a different library in Clojure and ClojureScript files. Now, the new namespace lambdaisland.glogc is usable across .clj, .cljs, and cljcfiles.

We also made fixes to maintain compatibility with newer versions of the Google Closure library. I’m calling this out in part as a reminder to keep up with changes to the library.

Smaller changes

We’ve made smaller changes across our other projects:

  • Garden-watcher now has support for *.cljc files.
  • Regal now supports forms with a fixed number of repeats, written as [:repeat form num].
  • We’ve expanded the areas we test, including Java 16 to our test matrices and ensuring tests run correctly on Windows.

Community Projects

Kaocha has extensive support for plugins, so we’re excited when people take advantage of it and scratch their own itch.

Try, Try Again: AndreaCrotti’s Retry plugin

Flaky tests are ones that do not pass or fail consistently, meaning that rerunning the test can be enough for it to go from red to green or from green to red. Usually you want to fix these so they are consistent, but some tests might be necessarily flaky or you may want to save fixing them for a later date. In the meantime, you can use AndreaCrotti’s Retry plugin for Kaocha.

It reruns failed tests a configurable number of times, letting you know which tests failed even with the retries and which ones succeed only after retrying them.

Kaocha in Vim: Liquidz’s Plugins

While the --watch feature and REPL support make it pretty convenient to test as you code, it can always be faster. If you code in Vim and use the Iced plugin, Liquidz’s handy vim-iced-kaocha plugin lets you run tests right from Vim, adding to Vim-Iced’s useful toolbox of shortcuts.

Don’t Be A Stranger

We’d love to have your help on these projects. To reiterate, if you want to join in, check out our blog postcalling for contributions, or jump right in to our first issueslist.

Even if you can’t or don’t want to help out, we’d love for you to join the new Lambda Island Discord. We hope that it will be an enjoyable and inclusive community for Clojurians of all experience levels. (If the link expires, you can message Arne (Arne#3086), Mitesh (ox#1485), or myself (alysbrooks#2195) for an invite.)