9 ms·
Fulcro Developers Guide: Single-page full-stack web applications in clj/cljs
- serpi 8y agoSomehow I got the feeling of there being a lot of boilerplate necessary to create just about anything. Still this is years ahead of the competition (excluding re-frame).
- myguidingstar 8y agoYeah, long require forms, long namespace keywords, protocol methods... but they are all necessary so Fulcro can figure out a lot of things itself. It pays off really well because things that are often hard in other frameworks such as forms and server-client communication suddenly become easy as a result.
- azeirah 8y ago> All of the full stack examples use a mock server embedded in the browser to simulate the interaction, but the source that you’ll read for the application is identical to what you’d write for a real server. God, I'm loving this already. The only other framework I know that could do this for a book is Meteor.
- chrisweekly 8y agoYeah, the Meteor book was incredibly well-done. Also agreed, this looks similarly excellent.
- cortexio 8y agoThere's alot of stuff in there. Personally i think that's not good. It's amazing for creating many simple apps in a short amount of time, but not for long term complex websites.
- adamfeldman 8y agoIn addition to the book, Fulcro has excellent docs and resources available: * Full-stack example [0], implementing the RealWorld spec using the Walkable SQL library and the Duct server-side framework * Fulcro's implementation [1] of UI state machines (recent HN discussion on the topic [2]) * Fulcro training video series, from the creator Tony Kay [3] * An answer to why Fulcro [4] * How Fulcro differs from Om [5] * Fulcro's integration with the Semantic UI React toolkit [6] * Where Fulcro is headed next, in v3 [7] To me Fulcro is Clojure's missing framework. With Fulcro (and thanks to Clojure/Script), applications are composed and painted onto the screen -- this is thanks to the REPL and hot-reloading that preserves state. For a demonstration, see the Fulcro training playlist on YouTube [3]. Some personal favorite Fulcro features: (A) the built-in support viewer [8], which can take state history serialized on the client and play it back on a developer's machine (like a basic, self-hosted https://logrocket.com https://logrocket.com). (B) Workspaces [9], which is similar to https://storybook.js.org https://storybook.js.org. #fulcro is very active on the Clojurians Slack http://clojurians.net http://clojurians.net (or Zulip! https://clojureverse.org/t/introducing-clojurians-zulip/3173 https://clojureverse.org/t/introducing-clojurians-zulip/3173) [0]: https://github.com/walkable-server/realworld-fulcro https://github.com/walkable-server/realworld-fulcro [1]: https://github.com/fulcrologic/fulcro-incubator/blob/develop/state-machine-docs.adoc https://github.com/fulcrologic/fulcro-incubator/blob/develop... [2]: https://news.ycombinator.com/item?id=19268734 https://news.ycombinator.com/item?id=19268734 [3]: https://www.youtube.com/playlist?list=PLVi9lDx-4C_Rwb8LUwW4AdjAu-39PHgEE https://www.youtube.com/playlist?list=PLVi9lDx-4C_Rwb8LUwW4A... [4]: http://fulcro.fulcrologic.com/benefits.html http://fulcro.fulcrologic.com/benefits.html [5]: http://fulcro.fulcrologic.com/vsom-next.html http://fulcro.fulcrologic.com/vsom-next.html [6]: https://github.com/fulcrologic/semantic-ui-wrapper https://github.com/fulcrologic/semantic-ui-wrapper [7]: https://www.patreon.com/posts/fulcro-3-25683469 https://www.patreon.com/posts/fulcro-3-25683469, https://www.patreon.com/posts/incubator-23082756 https://www.patreon.com/posts/incubator-23082756 [8]: http://book.fulcrologic.com/#_support_viewer http://book.fulcrologic.com/#_support_viewer [9]: http://book.fulcrologic.com/#_workspaces http://book.fulcrologic.com/#_workspaces
- askosh 8y agoAs an alternative, modern web framework for Clojure, I recommend Coast https://coastonclojure.com/ https://coastonclojure.com/ (I have no other affiliation to this project other than using it myself).
- myguidingstar 8y agoCoast is a framework that focus on traditional server app and rapid development similar to Rails or Django. I don't find it "modern" tbh.
- victor106 8y agoCan someone here elaborate what are some advantages of using fulcro vs using another stack?
- souenzzo 8y agoFulcro do everything that "relay" do, but: 1- you can (and it's easy) to manage the state when you need 2- operate with multiple remotes 3- talk with graphql remotes (using pathom on client) 4- easily talk with many rest remotes (using pathom on client, or create a pathom server) 5- use the components on server(JVM or Node) to SSR 6- easily use any npm deps (shadow-cljs should help), including any react component lib 7- share client and server mutations on the same file (via clojure reader macros) ...
- slifin 8y agoTime travelling immutable universal databases are their own reward, lol http://www.hyperfiddle.net/ http://www.hyperfiddle.net/ is probably the closest proof of concept I know of right now, some interesting properties are solved N query problem with smart and pinpoint caching, infinite TTL caches, SQL injection impossible, client exposable query language Aggregate shapes defined at query time, not at insert time, it's mostly about moving immutable Datoms around not trees that are hard to reconfigure & reuse like nested JSON I'd suggest looking into the feature set of Datomic, and then ask yourself what would happen if you ran with those concepts in the front end? - Fulcro
- G4BB3R 8y agoClojure is awesome. But refactoring a big project without a type system is very hard and error-prone, and clojure error messages are very difficult to understand.
- harperlee 8y agoIn my experience the new spec system (a sort of gradual typing) greatly helps in both refactoring and both surfacing and explaining errors, if you havent worked with clojure 1.10 I’d recommend to give it another go. Also spec is still in alpha so it will keep getting better.
- dkersten 8y agoHonest question (as I've been out of the Clojure world for a little bit): which refactoring tools integrate with or use spec?
- yogthos 8y agoThere are also nice linters now like clj-kondo that integrate with Emacs. https://github.com/borkdude/clj-kondo https://github.com/borkdude/clj-kondo
- adamfeldman 8y agoRecently Clojure error messages have vastly improved: http://insideclojure.org/2018/12/17/errors http://insideclojure.org/2018/12/17/errors. As well, Clojure has an opt-in solution to type issues: https://clojure.org/about/spec https://clojure.org/about/spec
- mark_l_watson 8y agoReally good work. I spent 15 minutes reading through this book over my first cup of coffee this morning. I stopped using Clojure about 5 years ago, after two long consulting jobs using Clojure. I decided Clojure was not a perfect fit for me (and, really, neither is Common Lisp, Racket, and Haskell - more favorite languages) but I am very happy to see the Clojure ecosystem still creating such great tools around the language and functional composition.
- jdhorwitz 8y agoWhat have you found is the perfect fit for you?
- mark_l_watson 8y agoNothing. I use Python for deep learning but don’t care for the language. I prefer Lisp languages, most comfortable with Common Lisp but love the ecosystem around Racket. Love Haskell but I am in a many year learning curve.
- rlander 8y agoNo love for Pharo? ;)
- mark_l_watson 8y agoI play with Pharo about once a month. Love but no real amount of time spent with it anymore. Good language and platform, very energetic community but it is a small community.
- rlander 8y agoSame here. It's been on my "someday I´ll use it on a real project" list for 10-ish years. From time to time I boot an image, play around, cry a little, get back to Python.
- 8y ago
- manishsharan 8y agoShould 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...
- lauritzsh 8y agoDoes anyone have experience using Fulcro just for frontend (no backend)? I have been considering it versus Reagent and Rum for building a heavy client-side app that doesn't need a server (nothing to store in a database, local storage is fine). At some point I might add users for data sync between client and server but I don't plan to do SSR for SEO purposes at least. What I am curious about is if I use Fulcro, will I write a lot more code to do the same as in Reagent/Rum because it's supposed to play well with a backend that's (for now) non-existent? Does it provide better tools for client-side state management compared to Rum/Reagent (+ re-frame)? Right now I am using just Rum with its built-in cursors and derived atoms and the experience is okay. I did try DataScript but ended up just with a simple atom for now.
- adamfeldman 8y agoI think Fulcro would shine for your client-side state management use-case: http://book.fulcrologic.com/#_the_secret_sauce_normalizing_the_database http://book.fulcrologic.com/#_the_secret_sauce_normalizing_t... Please also see the links from my reply elsewhere in this thread: https://news.ycombinator.com/item?id=19522998 https://news.ycombinator.com/item?id=19522998 I am exploring using Fulcro remotes to persist data locally using https://github.com/replikativ/datahike https://github.com/replikativ/datahike (and sync via https://github.com/replikativ/replikativ https://github.com/replikativ/replikativ)
- chartpath 8y agoWould anyone recommend Clojure if you run an engineering org and get to make decisions about languages? I've been running node shops for the last several years, and love Clojure since having hosted a couple meetups a while back. That and being most influenced by lispy/ai culture from SICP, CTM, PAIP, AIMA books. Node is getting tiresome due to not being able to trust the ecosystem quality (which takes away some of the common justification of huge ecosystem). Not worried about hiring since not open to fresh grads from universities or bootcamps without lots of training anyway (which can include a new lang). Are there crappy/charlatan Clojure devs out there or is it more of an elite/experienced culture? With stuff like Fulcro, could we replace our basic REST APIs and business logic without having to re-invent too much?
- aperiodic 8y agoIn my experience -- I was a professional Clojure developer for 6 years (until 2018), and hung out in the #clojure IRC channel on freenode a lot between 2011 and 2014 -- the Clojure community tends to be very experienced. Clojure is not many people's first language, but tends to be a language you find your way to after dissatisfaction with other languages, or exposure to other lisps. I'm sure you can find crappy or charlatan Clojure devs, but I was generally impressed with the Clojure devs I met in #clojure or at the cons. Overall I found the community to have high levels of both knowledge/experience and patience in explaining things thoroughly and precisely to people who were asking questions.
- uxcolumbo 8y agoYou said 'was a professional Clojure developer'. Are you not doing Clojure development anymore? If so, why?
- aperiodic 8y agoYes. I was at Puppet (nee Puppet Labs) for four years, one of the larger Clojure shops to my knowledge (not that I've been keeping close tabs on who's picked it up recently). I switched jobs and language choice was not my #1 criterion. A very interesting opportunity that aligned well with my values (and paid better to boot), but was in a completely different tech stack (Python DS ecosystem, with some Scala). I love the language, think it's wonderfully concise yet expressive way to think about code, runs on a great platform for the web, and is a great fit for when team size exceeds codebase size (though not so much the other way around). All my fun software projects are still in Clojure or Clojurescript; I just wrote some today to scrape doggy listings.
- myguidingstar 8y agoFulcro can be too sizable to consume in one bite, most importantly the three core concepts (ident, query, state). Personally I find it useful to start with just EQL which is an Clojure native alternate to Graphql. In fact, Fulcro's predecessor, the famous Om.next was inspired by Graphql. Introduction by Wilker Lucio https://www.youtube.com/watch?v=yyVKf2U8YVg https://www.youtube.com/watch?v=yyVKf2U8YVg
- mrcristisanjoe 8y agoIf anyone is interested in working on a Fulcro application full-time we are building tools for the insurance industry and are a remote-first team. http://bindhq.com/company/ http://bindhq.com/company/