Skip to content

0.7.2

Compare
Choose a tag to compare
@darwin darwin released this 21 Jun 18:55
· 519 commits to master since this release

Easier installation via preloads

ClojureScript newly supports :preloads compiler option which allows you to require namespaces prior your :main namespace. Now you can use this feature to add cljs-devtools support to your project without modification of your code. You simply add devtools.preload into the :preloads list.

Here is an example how cljs-devtools-sample was modified to use this new feature:
binaryage/cljs-devtools-sample@4cb1f56

Configuration

The whole point of preloads is to allow adding tools without a need to modify your project source code.

Ok, but how to specify a custom tool configuration if needed?

It is easy. You may specify additional configuration options under your compiler options.
For example cljs-devtools expects its custom config under :tooling-config > :devtools/config.

For example:

:tooling-config {
  :devtools/config {
    :features-to-install    [:sanity-hints]
    :fn-symbol              "F"
    :print-config-overrides true}}

This overrides default :features-to-install, sets custom :fn-symbol and instructs cljs-devtools to print overridden config values during installation.

Here is a full example in a working project, here is the list of available configuration keys.

Notable commits:

16d52cf introduce new prefs
bd16392 instruct install! to use :features-to-install pref as defaults
e0fcb9b print-config-overrides-if-requested! during install
26736b0 introduce devtools.preload namespace

All new work: v0.7.1...v0.7.2