This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-14
Channels
- # adventofcode (62)
- # beginners (78)
- # boot (26)
- # boot-dev (9)
- # cider (73)
- # cljs-dev (33)
- # cljsrn (36)
- # clojure (159)
- # clojure-android (1)
- # clojure-austin (1)
- # clojure-greece (79)
- # clojure-italy (10)
- # clojure-nl (3)
- # clojure-russia (11)
- # clojure-spec (33)
- # clojure-uk (26)
- # clojurescript (107)
- # core-async (22)
- # core-logic (12)
- # cursive (16)
- # datomic (13)
- # devcards (5)
- # duct (36)
- # emacs (4)
- # figwheel (3)
- # fulcro (107)
- # graphql (171)
- # hoplon (27)
- # instaparse (24)
- # jobs-discuss (34)
- # juxt (3)
- # lein-figwheel (1)
- # leiningen (8)
- # lumo (11)
- # off-topic (9)
- # onyx (79)
- # parinfer (1)
- # pedestal (75)
- # re-frame (27)
- # rum (1)
- # shadow-cljs (11)
- # spacemacs (20)
- # specter (17)
- # unrepl (96)
the architecture is really nice, and there is many libraries available to enrich pedestal already
but as I checked on http://pedestal.io, the documentation is really poor compared to the quality of framework
moreover, it's difficult to assess the momentum of pedestal. Ring seems more popular, but companies seems to prefer pedestal
I know there’s ongoing work in the docs; how much, I don’t know (other than contributing a few small fixes/clarifications)
I plan to create a small template for my web project. I started with Ring, but the architecture of pedestal seems more compelling to me
but it really bothers me. Pedestal seems to be a nice framework, but the ecosystem is lacking (template, documentation, guides ...)
I dont think so: https://github.com/pedestal/pedestal/blob/master/jetty/src/io/pedestal/http/jetty/websockets.clj#L75
Hey all. I’ve been fighting with route matching for a bit and I’m sure I’m missing something pretty simple. I have the following two routes;
["/v1/org/self" :get (conj common (xpa-org/get-organizations-self))]
["/v1/org/:org-id" :get (conj common (xpa-org/get-organization)) :constraints {:org-id uuid-constraint}]
When I make a request to /v1/org/self
it always appears to only want to match the second route (`/v1/org/:org-id`). I believe I could turn /v1/org/self
into /v1/org/self/orgs
and it would work, but I’m trying to figure out if the above is possible without changing the structure of my routes. The expanded routes do include both.@oconn wildcards always override others, by design, but not with linear-router. Agree that it's not right.
I think it woudn't with either /v1/orgs/self/orgs
either. Wildcards are REALLY greedy.
There is the :constraints
metadata
yeah I think I’m going to go with /v1/orgs/self/orgs
but it would be nice to weight them somehow
What’re your constraints?
oh, hah, sorry, too early 😛
FWIW that’s not specified as metadata, no idea if it will actually work in that form
I believe the constraint is being applied. When I remove it and make a request to /v1/org/self
the request is routed through the /org/:org-id
handler. Then when I add it I end up receiving a 404
@donaldball I think that is a legitimate “constraint clause” as mentioned in the docs somewhere (just read it): http://pedestal.io/reference/routing-quick-reference#_table_syntax
It would mask the static routes unless you use {:io.pedestal.http/router :linear-search}
I think
Ha ha wow. I guess you could put the switch in your route handler for the “self” case
if you added it to your regex
Is anyone aware of any existing projects to get pedestal interceptors into ring?
@mpenet: Are you using it with a bunch of existing ring middleware, or is everything custom interceptors?
how would interceptors work with ring? I think middleware is the equivalent to interceptor, but fundamentally different. But it's relatively easy to write code that could be used as either one.
Pedestal is data oriented. Fundamentally, interceptors are hash map with an :enter and :leave keys that point to functions. It's up to pedestal to combine and execute these interceptors. One nice thing is thar pedestal works with core.async. And if tomorrow, we find a better way that core async, we could replace the execution engine without changing interceptor descriptions.
On ring, middleware are simple functions. They take the next handler as a parameter, and execute it when they want. They can perform task before our after the next function execution.
@ikitommi: The main issue I have with ring middleware is how understandable/visible it is - every time I have tried to set add new middleware to a ring project I end up spending a bunch of time moving things around so that things are applied in the right order, or enabling/disabling middleware until things work. It's difficult to know what is actually happening without diving into the code, and I've found it painful to figure out where and how I want to log things related to them.
But by doing so, you cannot control the execution. Ring start the first handler through a simple functions call. You can't plug something like core.async easily
I want to be able to inspect the stack of earlier interceptors to see how my data has changed, and see what is still remaining to be run.
i agree, but If you take Interceptors instead If mw, is it Ring anymore? (your original question)
and you can inspect & reorder mw-chains too, but only before the chain is created. Once it's chained, it's just a fn.
I want to develop an API oriented web stack, and I think Pedestal is a good start for that purpose
but then, there is many librairies like liberator, vase and lacinia. I don't know which one to integrate, and I can't find pros and cons on the internet
is vase compatible with lacinia ? is there a way to switch to another DB than datomic ?
and on the client side, what is the quickest way to integrate with Clojurescript ? om.next ? fulcro ?
@fmind I sympathize. There are a plethora of options and not a lot of "stacks" that offer pre-integrated components.
I'm one of the maintainers of Vase & Pedestal, so I have a personal preference toward those. Vase is quite tied to Datomic in its current state, though.
yes ... the Clojure community takes modularity to hearth, but it's not the most productive option for quick development
and there is a lot of back-up from experienced programmers who met the problem these technologies try to address
Nothing prevents you from
- creating your own data-readers so you can have #fmind/jdbc
action literals (or the like)
- adding an interceptor that hangs a pooled Connection
on the context and takes it back on the way out
- don’t know about quickest way: I was hoping to use Vase, but find that my client’s standard server framework (Java) is heavy and burdensome, but perhaps must be used
I like the design of vase, but I'm afraid that the dependence to REST and Datomic will bite me on the long term
@fmind I understand. What are your technology constraints? (E.g., are you restricted to certain DB?)
I work in a research environment and I have few tech constraints. I'm quite found of Datomic, but we can't pay the price for Datomic pro
Liberator maintainer here, just keep in mind that liberator (and anything that runs on the ring model) works perfectly fine with pedestal. You’ll lose some of the async / non-blocking properties of pedestal, though.
I've been working on an evolution of Vase that makes it easier to add new actions that go beyond Datomic. That's at https://github.com/mtnygard/vase/tree/fern-input
@mtnygard @ordnungswidrig thanks for your feedbacks
I want to start small with a small web app that provides both REST and GraphQL end points.
my plan was to start with Pedestal + Lacinia and see which of vase liberator would be the best fit
@mtnygard vase-fern looks very promising. I will dig into that very likely.
@fmind I’m thinking for a while now how to bring the niceness of liberator to the pedestal world but I’ve yet to hit a sweet spot. Maybe I’ll have a bright moment over the holidays 😛
@ordnungswidrig If you want to chat about it, hit me up. I like what Liberator brings!