This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-04
Channels
- # announcements (7)
- # babashka (26)
- # babashka-sci-dev (19)
- # beginners (66)
- # calva (4)
- # clj-kondo (55)
- # cljs-dev (173)
- # cljsrn (17)
- # clojure (86)
- # clojure-art (3)
- # clojure-australia (1)
- # clojure-europe (24)
- # clojure-india (1)
- # clojure-nl (3)
- # clojure-uk (6)
- # clojured (5)
- # clojurescript (39)
- # cursive (8)
- # data-oriented-programming (20)
- # datomic (9)
- # emacs (10)
- # events (1)
- # figwheel-main (16)
- # fulcro (33)
- # gratitude (1)
- # helix (2)
- # hugsql (2)
- # jobs (2)
- # kaocha (4)
- # leiningen (5)
- # lsp (110)
- # malli (1)
- # missionary (17)
- # observability (3)
- # re-frame (10)
- # reagent (1)
- # reitit (7)
- # rewrite-clj (3)
- # shadow-cljs (63)
- # sql (19)
- # tools-build (74)
- # tools-deps (32)
- # transit (1)
- # xtdb (5)
Is there a way in (or with) reitit to compose middleware so that it is executed in the right order and not multiple times? I’m thinking of creating modules that would declare their middleware dependencies and then combine those modules ( potentially leading to duplicates and wrong ordering).
I didn’t find something, but rethinking this, maybe better to define middleware per endpoint and use the https://cljdoc.org/d/metosin/reitit/0.5.15/doc/ring/middleware-registry to reuse common middleware
Note to self: I just ran into https://github.com/metosin/reitit/blob/master/doc/ring/data_driven_middleware.md#ideas-for-the-future and https://github.com/metosin/reitit/blob/1ab075bd353966636f154ac36ae9b7990efeb008/test/cljc/reitit/dependency_test.cljc that works with dependencies between middlewares
I’ve worked out an example of composing middleware in a smarter way. Not sure if this is a new idea or not. I have used the idea of an (half-)interceptor plus the dependency code in reitit. Feels like an improvement to me. What do you think? https://gist.github.com/jeroenvandijk/85f57c168ef9a39cc9af7dfa360cee61
I found https://quanttype.net/posts/2018-08-03-why-interceptors.htmland it mentioned something https://github.com/oliyh/angel-interceptor/blob/master/src/angel/interceptor.clj, but this is mostly in the context of interceptors whereas I think it could also be applied to (adapted) ring middleware
Hi, I didn't find a channel for testit
so here it goes because maintained by same people.
https://github.com/metosin/testit/pull/31
I’ve worked out an example of composing middleware in a smarter way. Not sure if this is a new idea or not. I have used the idea of an (half-)interceptor plus the dependency code in reitit. Feels like an improvement to me. What do you think? https://gist.github.com/jeroenvandijk/85f57c168ef9a39cc9af7dfa360cee61