Re: [ClojureScript] reagent-nodejs feedback request

2015-05-21 Thread Matthew Phillips
Isomorphic means that the code works the same on the browser and the server. So you write your code as a single SPA. On the browser that will be rendered to a string and returned. In the browser you'll get the fully rendered page and then your ClojureScript code will take over and it will act as a

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-21 Thread Matt Ho
Double plus plus what @matthew said M -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups ClojureScript group. To unsubscribe from this group and stop receiving emails from

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-21 Thread Matt Ho
Unfortunately, Google's not the only search engine out there. And while they are dominant, 2/3 of web searches go through them, why should I leave out the remaining 1/3 because it's more technical challenging? Also, as vertical search engines become more prominent, why would I want to make

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-21 Thread Matt Ho
I think maybe the easiest solution is to write simple luggable wrapper to bring their own router. I would hate to have to bring in an entire framework like rendr or not be able to use a library just because of my router choice. M -- Note that posts from new members are moderated - please be

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-21 Thread Marc Fawzi
Airbnb'd Render has ClientRouter and BaseRouter both of which extend from BaseRouter (link below) https://github.com/rendrjs/rendr/blob/master/shared/base/router.js I just looked it up and have not used this. I did use their battle tested infinite scroll widget once and it was one of the least

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-21 Thread Marc Fawzi
Simple Generic Solution! vs complicated solution with special cases. Obviously the former wins! Thanks for the education Matt! ;) Sent from my iPhone On May 21, 2015, at 8:14 AM, Matt Ho matt...@gmail.com wrote: Double plus plus what @matthew said M -- Note that posts from new

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-21 Thread Khalid Jebbari
To eliminate the need to use 2 different routers, the only possibility I see is to use a js library that works both on client and server-side. Backbone.js has a minimal router like this, you may also want to check crossroads.js or finch.js. But something tells me that you'll need to write some

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-20 Thread Marc Fawzi
Matt, I forgot to mention, if SEO is the priority and you enjoy building SPAs in Reagent, Google has had a way (for many years now) to crawl client-side JS generated pages where you use #! in your urls (or use the fragment meta tag) to tell google that to ask the server for the server-rendered

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-20 Thread Marc Fawzi
So if SEO is the overriding priority then u could have a proxy in front that looks for the _escaped_fragment thing in the get request and route all those to a bot-dedicated nodejs/express app that serves pre-rendered page content. This is based on the Google scheme. Sent from my iPhone On

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-20 Thread Matthew Phillips
For me SEO isn't the priority, user experience is. SSR eliminates the flash of no-content you traditionally get from SPAs. On Wed, May 20, 2015, at 11:55 AM, Marc Fawzi wrote: So if SEO is the overriding priority then u could have a proxy in front that looks for the _escaped_fragment thing in

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-20 Thread Marc Fawzi
So Matt's idea of what he'd like to do has finally sunk in. Isomorphism (or maybe we should call it automorphism?) together with Google's bot ability to explicitly request server-rendered pages from SPA URLs (during crawling) means that you can serve pre-rendered pages to the bot from one

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-19 Thread Marc Fawzi
Wow yeah i see your bulleted list of concerns and was thinking about #3 too... I haven't given it much thought and it now seems like a hairy scheme but i was thinking that it's possible to have the first page as an SPA container app that is rendered server side by Express/Jade like any NodeJS

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-19 Thread Marc Fawzi
yup that was a terrible idea from the era before isomorphism was discovered ... I'm just getting into the whole isomorphic thing... the issues you stated should all be solvable or if not then reduced to a set of core obstacles so we can understand the actual limitations of this approach On Tue,

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-19 Thread Matt Ho
Like I said in the other post, I'm not really keen on using something besides reagent render pages. Having two ways to render the home page seems like unhappiness waiting to happen. Also, having only the home page renderable doesn't give me the SEO benefits I want. I need the detail pages

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-19 Thread Matt Ho
Like I said in the other post, I'm not really keen on using something besides reagent to render pages. Having two ways to render a page seems like misery waiting to happen. Also, having only the home page renderable doesn't give me the SEO benefits I want. I need the detail pages to be

Re: [ClojureScript] reagent-nodejs feedback request

2015-05-18 Thread Marc Fawzi
Hey Matt, Why not render the first page using just Express rather than Express + React + Reagent and then let the compiled CLJS for the Reagent app which would be served as part of that first page take over from there? You may also include inline images and concatenate all the css files, in order