This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-18
Channels
- # admin-announcements (59)
- # beginners (5)
- # boot (99)
- # cider (9)
- # clojure (207)
- # clojure-czech (1)
- # clojure-dev (28)
- # clojure-france (3)
- # clojure-italy (1)
- # clojure-japan (22)
- # clojurescript (234)
- # core-async (12)
- # datascript (1)
- # datomic (60)
- # funcool (137)
- # hoplon (18)
- # instaparse (2)
- # jobs (2)
- # ldnclj (42)
- # ldnproclodo (3)
- # liberator (13)
- # off-topic (21)
- # onyx (2)
- # re-frame (5)
- # reagent (12)
- # ring-swagger (5)
- # testing (17)
Is this the best way to pre-render reagent on the server: https://github.com/savaki/reagent-nodejs ?
Yeah, I think so. (I believe Matt Ho also has an updated version too, but hasnt pushed it to github yet.)
Why not using PhatomJS directly, like for testing?
express? What is express?
henryzhu: nope. I don’t understand why nodejs is used in these cases, or how actually.
Essentially we need a JavaScript runtime on our server (in this case we use nodeJS) to run the JS that Reagent/CLJS generates. After the JS it’s fully rendered to HTML in Node, we serve the HTML to our browser via Express routing.
And basically you get an app like this: http://reagent-nodejs.herokuapp.com/ fully SEO crawlable web app with a fast initial page load.