Skip to content

Commit cb4a936

Browse files
committed
Add loading hierarchy/annotations to README
1 parent 7f8442a commit cb4a936

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,25 @@ This metadata can be recalled with `integrant.core/describe`:
653653
;; => {:doc "A Ring adapter for the Jetty webserver."}
654654
```
655655

656+
### Loading hierarchies and annotations
657+
658+
Loading a Clojure namespace can be slow and potentially side-effectful,
659+
and it's not possible to know ahead of time whether a namespace adds
660+
keyword annotations or hierarchy information.
661+
662+
To solve this issue, Integrant provides ways of loading keyword
663+
hierarchies and annotations from edn files on the classpath:
664+
665+
```clojure
666+
(ig/load-hierarchy)
667+
(ig/load-annotations)
668+
```
669+
670+
These functions will search the classpath for files named
671+
`integrant/hierarchy.edn` and `integrant/annotations.edn` respectively.
672+
Including these files in a library will allow Integrant to quickly
673+
discover information about the keywords used in the library.
674+
656675
## Reloaded workflow
657676

658677
See [Integrant-REPL](https://github.com/weavejester/integrant-repl) to

0 commit comments

Comments
 (0)