This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Cool: With the new
:commonjs feature for
:foreign-libs, you don't need to specify a
:requires vector—the dependencies are derived during CommonJS processing!
I'm looking for a guide which tells me how to do prerendering with a clojure/clojurescript/reagent application + how to combine the server side + client side routing story
I guess the term for this would be isomorphic, so I'm looking for a ready to go example of an isomorphic cljs+react project
@borkdude: I’ve kinda done this with clojure/hiccup, om/sablono and a couple of macros. The code lives at my previous employer, so unfortunately can’t share it.
@andrewmcveigh: do you end up duplicating routes on the client and the server, or do you only define one compojure route "/" and pre-render from there?
@borkdude: I used bidi for routing, using a EDN-only route specification, for both client/server
This might be a bit more of a question for the #C053AK3F9 channel but what are pros & cons for Reagent vs Om?
@agile_geek: Reagent is easy to understand for already experienced Clojure(script) developers, since it re-uses the concept of atoms. Om forces you more or less to use one atom for the whole application that you can access by using cursors + API built around that.
I've tried out the demo app in this isomorphic clojurescript blog post: https://www.paren.com/posts/isomorphic-clojure-part-1
@borkdude: Thanks for that. So are there use cases that favour the use of one over the other?
@agile_geek: I think it's largely personal preference. I favor Reagent because I like the simple approach.
@agile_geek: Maybe if you want to be able to recover your entire app from one state value, that is where Om really shines, because it (almost) forces you to work that way
@borkdude: Isn’t much Clojure syntax but it’s taken me 19 months so far and I’m still not there 😉
@agile_geek: things take longer when it's not your day job, I feel with you on that one
i don't think it's accurate to characterize reagent as "the simple approach". om and reagent make a different set of tradeoffs. om's documentation is not substantially less approachable in comparison, and i don't consider it to be complex overall, nor complex in any specific area where it could possibly achieve the same with a simpler approach.
@jackjames: Yeah, simple is not the right word for it. My personal experience has been that Reagent has a less steep learning curve than Om. There are also less concepts to understand.
Maybe other people have different experiences. There's no absolute way of saying which approach is better, easier, etc. It is about tradeoffs, correct. Both are excellent libraries. Rum is also worth checking out, but I don't have any experience in it.
In all approaches it may be best to first do the React tutorial so you know what happens inside, sort of.
@borkdude: Given I’m using this on hobby projects I think I’ll stick to React based libraries for now as both Reagent and Om seem to have some traction in the community and I can ask nice people like you and @dnolen for help
@agile_geek: Both Om and Reagent also have cookbooks (just google) and mailing lists
about pre-rendering: actually it would be enough if I could just fool google with some pages that contain relevant content, without any css
Would it be sane for SEO if I would render a page using certain keywords at /item/1 with a meta refresh to #/item/1 ?
@dnolen: should there be a public API for cljs.repl, like everything else in the quick start? i.e.