Open lilactown opened 4 years ago
Is there something missing in the latest version of Helix? I know that defnc
exposes ^:memo
and ^:callback
as metadata optimizations. I'm not sure about defhook
.
Right now, defnc
implements this behind a feature flag you may enable. defhook
does not yet support it.
I haven't fully tested it yet in production, which is why it's still behind a feature flag. In general I'm still a little unsure about using metadata to manage these type of semantics. I also want to ensure that it will emit compile warnings when breaking the rules of hooks.
We should be able to signal that an expression should be wrapped in a
use-memo
oruse-callback
by annotating it with metadata in the body of adefnc
or adefhook
.^:memo
and^:callback
metadata should telldefnc
anddefhook
to emit ause-memo
oruse-callback
hook that will automatically fill dependencies using the same algorithm as:auto-deps
.A dependency seq can also be provided to override this behavior:
^:memo
and^:callback
metadata should be usable inlet
bindings:^:memo
and^:callback
should allow enforcement of the Rules of Hooks checks that are currently behind an experimental feature flag.