5 ms·
Should I be using a Modern do-it-all frameworks for Clojure and Clojurescript? My opinion is of course colored by my years spent in JAVA/J2EE's world of web fra
by manishsharan 8y ago
Should I be using a Modern do-it-all frameworks for Clojure and Clojurescript? My opinion is of course colored by my years spent in JAVA/J2EE's world of web frameworks ( Wicket, Tapestry, JSF + Hibernate EJBs etc.). In this world, I found most of my time was spent in learning the deep intricacies of the framework and fitting it to my use case. I began to hate every minute I spent on these frameworks.
And then I discovered Clojure and Ring and later Liberator. What I like about my current setup is that I have full control over my framework and my team knows its ins and outs and the corresponding Clojure code is succinct enough to allow developers to come upto speed quickly. Our set up is not sexy but it works and we know how exactly it works.
I am not sure what I would miss if I did not use a framework like this. Is Liberator no longer good enough ?
- NightMKoder 8y agoI’m a fan of using tools that fit your problem. I think Fulcro is probably better if you have a frontend that uses Fulcro/React. It can bring order to the sometimes Wild West of data fetching that happens in the browser world. That said - if your problem isn’t a full stack web app, don’t use Fulcro. Like you said, there is already very good tech for doing REST APIs or static html pages or the like. I don’t think Clojure has any frameworks like Ruby on Rails where you use it for all use cases. For example - I’d probably switch to httpkit over ring if I needed to solve a problem with async websockets.
- smnplk 8y ago>> I’d probably switch to httpkit over ring if I needed to solve a problem with async websockets. You probably meant going from jetty to httpkit, ring is just a middleware lib
- adamfeldman 8y agoMy understanding is that Fulcro is a frontend framework that also helps you build the communication between the browser and backend server: http://book.fulcrologic.com/#FullStack http://book.fulcrologic.com/#FullStack, http://book.fulcrologic.com/#_going_remote http://book.fulcrologic.com/#_going_remote. Of course, you can also use Fulcro to communicate with any sort of backend server, and still take advantage of Fulcro's normalized client-side database: http://book.fulcrologic.com/#Networking http://book.fulcrologic.com/#Networking, http://book.fulcrologic.com/#_the_secret_sauce_normalizing_the_database http://book.fulcrologic.com/#_the_secret_sauce_normalizing_t...
- filoeleven 8y agoJust a note for anyone affiliated with Fulcro who reads this: I opened the links as new tabs on iOS Chrome to check them out, and it turns out they don’t go to the anchors unless I switch to the tab in a short enough time. Not sure if Chrome or the page itself (presumably using Fulcro?) is to blame here, but it was disappointing to find 3 tabs all open to the top of the page when I switched over to read them instead of the relevant sections.
- adamfeldman 8y agoJust tested in the latest Chrome -- the page does take awhile to load, and doesn't jump to the linked section until right when the page finishes loading
- filoeleven 8y agoOn Chrome iOS, a delay of around 10s before switching to the tab results in it staying at the top of the page, even after waiting around 20s. But switching quickly to the new tab loads the anchor in 1-3s. Thanks for the links though, they gave me something intriguing to explore!
- dancek 8y agoI feel the same way. I hadn't heard of Liberator, though. We're using Reitit for routing both in backend and frontend and middleware for content negotiation and such. It's an awesome setup (though there were some rough edges starting out), almost everything is easy to understand just by reading the source. Just today I was thinking how nice it is to have the backend route tree available in both backend and frontend code, so e.g. it's easy to tell in advance in cljs whether the user has permission to use a specific endpoint. The route tree includes authorized roles and I wrote a simple auth middleware to enforce them.
- myguidingstar 8y agoFulcro is suitable for medium to large projects with rich data. Fulcro in the wild includes Nubank and Atlas CRM.
- jwr 8y agoMy take is that frameworks are great when you are building new projects, but become somewhat limiting over time. Also, with a complex application you often find that not everything can be nicely abstracted and there are features which cut across the stack, requiring changes everywhere. In my fairly large Clojure+ClojureScript app I do not use a framework, mostly because nothing existed when I started. I pick libraries and make them work together. This has advantages, but also brings endless frustration when I have to deal with stuff like web authentication, file uploads, or Oauth2. I really wish there were good solutions for these kinds of generic problems. Also, not all choices made by the framework are necessarily a good fit for every application size. I used to like Reagent, and I still think it's great for learning. But then it became limiting, I switched to Rum and never looked back. But in general, why not take the Clojure approach and use the right tool for the right thing? You don't have to chain yourself for life to a framework, you can use a framework for one app and use a bunch of separate libraries in another. I think in the Java world there is so much incidental complexity, that you have to choose a single framework and stick with it, as it's likely the only thing you will be able to learn. Not so in the Clojure world.
- blunte 8y agoThe huge reason I'm not using Clojure for webdev is because there is rarely an accurate, current guide that demonstrates how to plug things together to get a typical CRUD+user auth website going. I know that everything I need already exists, but I have yet to find a complete tutorial (Rails Depot, for example) that actually works. There's always some gap that isn't explained or some step that fails because the guide is 2+ years old. So while I do agree that choosing your own libraries (and essentially building your own custom framework, because that's what they all end up as) is preferable long term, it is incredibly frustrating trying to build that first webapp.
- pjmlp 8y agoI prefer a box full of ready made components, even if I don't use all of them, than hunting for Lego pieces.