(ns foo.bar
(:require-macros [foo.baz :refer [macro-that-expands-to-require]]))
(macro-that-expands-to-require)
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.
and
/ or
Optimization as Compiler PassClojureScript 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
.
require
StatementsNOTE: 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)
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.
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.
For a complete list of updates in ClojureScript 1.10.866 see Changes.