Liking cljdoc? Tell your friends :D

During development

io.dominic.wedge.user

The main purpose of the user namespace in Wedge-based applications is to provide a namespace to jump off into the dev namespace. The majority of the time, you will type (dev) and automatically move into the dev namespace where you can type (go) to start the system. However, occasionally there will be a code error and you will need to fix your code. If the user namespace was instead dev, then your REPL wouldn’t even start and you’d need to pay the startup cost again. Once you’ve located the source of the problem and fixed the file, you can run (fixed!) at the REPL, which will reload your namespaces and try again to enter dev. Repeat until you make it to dev.

io.dominic.wedge.dev

What’s available in dev varies from system to system. Generally they will just expose an underlying library for use.

Here’s a table from system to the dev library exposed:

io.dominic.wedge.clip-aero

https://github.com/juxt/clip#reloaded

io.dominic.wedge.integrant-aero

https://github.com/weavejester/integrant-repl

If your chosen system takes startup opts, those can be set using the :dev key in the system-config.edn. Aero systems take opts which are passed through into the config reader, so it’s common to see {:profile :dev} for their :dev:

Example system-config.edn configuring the profile of Aero
{:system io.dominic.wedge.clip-aero
 :dev {:profile :dev}}

Most systems will provide a (go) function which you can run to start the system. Following that, you’ll usually run (reset) to stop the system, reload the code from disk, and start it again. Your IDE may have a refresh command built-in, and if it’s supported by the editor configuration it’ll be automatically configured to run the reset.

Mise

If you’re new to Clojure, you may wish to use the "Mise". This is a set of libraries which are bundled during development with Wedge. You can load them and their dependencies by using (load "mise").

Editor files

Wedge can generate editor files for various editors. Usually the template you use will generate them for you. If it didn’t, or you’d like to update them, then you can run (io.dominic.wedge.dev/generate-tooling) to generate them again fresh. You can also pass a list of aliases to run by editors with (io.dominic.wedge.dev/generate-tooling ["dev" "build"]).

Wedge supports Cider and also Calva. Both of their jack-in functionalities will be configured automatically.

JVM-wide tasks

io.dominic.wedge.user performs a few JVM-wide tasks.

If the SLF4J JUL Bridge is found on the classpath, it will load it. This ensures that any java.util.Logging logs (used by some Java libraries) will show up in SLF4J (if you use that).

Also on start, user will run clj-kondo in the background against all of your dependencies. This will keep your cache up to date against your dependencies, so that arity errors etc. are available.

In order to prevent tools namespace reloading your ClojureScript build output, when using clj Wedge will automatically remove any paths from aliases beginning in :build. For example, if you have :aliases {:build-paths ["target"]} or :aliases {:build/prod {:extra-paths ["target/prod"]}} in deps.edn, then "target" and "target/prod" would be removed from the list of paths to refresh. If you find yourself wanting to override this yourself, you can use set-refresh-dirs from tools.namespace to do so.

Hooks

Hooks allow you to hook into the start/stop semantics of the system. They’re particularly useful for stopping or starting Figwheel.

Can you improve this documentation?Edit on sourcehut

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close