Hey,
We've written an interceptor that looks at the interceptor queue for interceptors that have metadata indicating they should have cljs brepl code injected into the returned HTML. Like so:
(defaround browser-repl
([context]
(if-let [brepl (->> context
:io.pedestal.impl.interceptor/queue
(map meta)
(some :browser-repl))]
(assoc context ::browser-repl (add-repl-fn brepl))
context))
([context]
(if-let [add-brepl (::browser-repl context)]
(update-in context [:response] add-brepl)
context)))
I've defined a route where the handler is a list. For this handler, the :browser-repl metadata is dropped. Here's the route definition:
[[["/" {:get [:root
(with-meta (constantly (resp/resource-response "public/html/index.html"))
{:browser-repl {:js-file "/js/main.js"
:goog-base-file "/js/dev/goog/base.js"
:init-namespace "lease_pulse.main"}})]}]]]
Would pedestal benefit from a patch that promotes the metadata to the interceptor created
here? Or is there a reason why it's not added to the interceptor that I'm unaware of?
Thanks!