Liking cljdoc? Tell your friends :D

Systems

Bundled Systems

io.dominic.wedge.clip

Clip system

io.dominic.wedge.integrant

Integrant system

Creating your own

You might want to create your own system because you’d like to use a custom component library. Alternatively, you might want to tweak an existing system to add a bit of custom functionality.

This is an advanced level feature, and pretty undocumented. Expect dragons here. If you do this, please email the mailing list (lit:[~severeoverfl0w/wedge@lists.sr.ht]).

To provide a system, you need a namespace with these functions defined within:

  • start

  • stop

  • load-dev

  • load-system (optional)

These functions will be called by io.dominic.wedge.system 's, and mirrors of those functions when yours is the system configured for use. io.dominic.wedge.system has documentation for what each of these functions should do, additionally you should have a look at the included systems in Wedge to see how they are implemented.

load-dev is particularly unorthodox for Clojure code. It uses the load functionality in Clojure to inline functions into an existing namespace. This allows an "open world" set of functionality to be provided. The file that you load should not have an ns declaration, and will instead use require for any libs it requires. You’ll need to make sure it isn’t in a path that tools.namespace will reload if you add it into your project, as it will fail to load the file.

Integrating with Hooks

You may wish to integrate your dev system into Wedge’s hook system. This is an optional step, but may provide value to individual developers not just the whole project.

To integrate with hooks, require the io.dominic.wedge.impl.dev-system-hooks namespace. It contains a function raise-evt, which you can send the relevant lifecycles to. You should aim to use the built-in lifecycles (:start-once, :stop-once, :start-always, :stop-always), but there’s no harm in adding additional ones.

Can you improve this documentation?Edit on sourcehut

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

× close