ClojureScript

1.10.866 Release

24 May 2021
ClojureScript Team

We’re happy to announce a new release of ClojureScript. If you’re an existing user of ClojureScript please read over the following release notes carefully.

Noteworthy Changes

  • Closure Compiler has been updated to v20210505

New Core Features

and / or Optimization as Compiler Pass

ClojureScript generates efficient JavaScript for and / or, employing && / || when applied to Boolean values. Previously these optimizations were implemented directly by the and / or macros. With this release they are instead implemented during a compiler pass.

A consequence of moving these optimizations to the code generation phase is that the resulting simplified and / or macros are compatibile with code walking libraries like core.async.

Support Macros that Expand to require Statements

NOTE: this change been reverted in following releases as it was discovered later (after many tests, including ClojureScript Canary) that there are many scenarios which cannot work. It will not be reintroduced.

This release allows macros that expand to require statements to be present in the code as is illustrated in the following example:

(ns foo.bar
  (:require-macros [foo.baz :refer [macro-that-expands-to-require]]))
(macro-that-expands-to-require)

Notable Fixes

Support IAssociative -contains-key? Protocol Check in contains?

The IAssociative protocol defines -contains-key?, which facilitates directly testing whether a key is in an associative collection. The core contains? function has been revised with this release to make such a call for collections that implement the IAssociative protocol.

Higher-Order Checked Arrays

With this release, the checked array access feature is extended for higher-order uses of aget and aset. For example,

(apply aget [(into-array [0]) 100])

will now trigger a warning or error at runtime if this feature is enabled via compiler configuration.

Change List

For a complete list of updates in ClojureScript 1.10.866 see Changes.

Contributors

Thanks to all of the community members who contributed to ClojureScript 1.10.866:

  • Arne Brasseur

  • Dieter Komendera

  • Dominic Monroe

  • Erik Assum

  • Wilker Lúcio