Fork me on GitHub
#reitit
<
2018-07-05
>
orestis13:07:19

Thanks for publishing Reitit — I’m using Pedestal and like it so far, but having to define a route-name for every route (even if I know I won’t ever want to construct the URL for this route) combined by separate routes per HTTP method, makes it slightly ikky.

orestis13:07:22

I’m a newcomer in Clojure and this is my first serious project done on work time — I’d be happy to test drive a Pedestal example if you have one. IIUC, I’d need to replace the default Pedestal routing interceptor in the service map with a custom one that modifies the interceptor stack based on whatever route matched, right?

orestis13:07:45

I’m extremely interested to see how route data will play out, too.

ikitommi13:07:48

I'll ping when there is something to test. The reitit-http (e.g. interceptor-version of ring-router) is mostly done. It needs some glue to work with pedestal, will push that to an example app.

ikitommi13:07:02

I would like to see an interceptor spec to emerge, like the ring spec, to make interceptors more portable. There are at least 4 bit different versions out there, the Pedestal model being most popular.

roklenarcic10:07:55

How are interceptors different from Ring middleware or Java's Servlet filters?

ikitommi11:07:41

@roklenarcic middleware and filters are higher-order functions, they know and call the next step explicitly. Interceptors have separate pipelines for request & response, both of type X => X, e.g. request in, request out. Middleware-chain composes itself into a application that can run itself, Interceptor-chain is just a list of steps that an external Interceptor Runner will run. Middleware-chain runs faster, Interceptors are better for async. Reitit (data-driven) middleware takes most of the good features from interceptors and applies them to Middleware. In Reitit, both Middleware and upcoming Interceptor module will have all the same features, only difference should be imports and the route data key :middleware vs :interceptors.

ikitommi11:07:41

@roklenarcic middleware and filters are higher-order functions, they know and call the next step explicitly. Interceptors have separate pipelines for request & response, both of type X => X, e.g. request in, request out. Middleware-chain composes itself into a application that can run itself, Interceptor-chain is just a list of steps that an external Interceptor Runner will run. Middleware-chain runs faster, Interceptors are better for async. Reitit (data-driven) middleware takes most of the good features from interceptors and applies them to Middleware. In Reitit, both Middleware and upcoming Interceptor module will have all the same features, only difference should be imports and the route data key :middleware vs :interceptors.