Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

Is it possible to support server side rendering as an option for initial page? #39

Closed
rukor opened this issue Oct 26, 2014 · 10 comments
Closed

Comments

@rukor
Copy link

rukor commented Oct 26, 2014

Asking this here as not sure where else to ask it.

@plexus
Copy link
Owner

plexus commented Oct 27, 2014

Hi @rukor,

Chestnut is opinionated about using Om on the frontend, so you typically don't generate much HTML on the server side. However Compojure and Enlive are already included so you should have everything you need.

If you're going to do a more traditional server side app you might want to use the --site-middleware option so you get support for stuff like cookies, sessions. By default chestnut assumed the server side is only used to serve up an API.

Do you have a concrete example of what you think is missing?

@rukor
Copy link
Author

rukor commented Oct 27, 2014

Hi, I was talking about rending the om component tree server side initially and let react/om pickup on the client side after the first render.

@plexus
Copy link
Owner

plexus commented Oct 27, 2014

I see, I'm not familiar enough with how that works. @swannodette you have an opinion on this?

In general refer to the discussion in #29 regarding feature requests. This seems like the kind of thing where a tutorial would be better than another command line flag.

@martinklepsch
Copy link

I believe the server-side rendering story hasn't been completely worked out
for Om yet.
Therefore the effort to implement this would be high right now.

@rukor
Copy link
Author

rukor commented Oct 27, 2014

That is fine, I suppose I should have phrased it as is this something worth looking into? I do have plans to take some time out to look into it. If I am able to get it working in some sensible way, perhaps I'd come back to ask if it would be useful for others, as I think its mostly going to be composed of boilerplate stuff that might benefit from templating.

@plexus
Copy link
Owner

plexus commented Oct 27, 2014

@rukor I have plans to set up a site for Chestnut in the near future, and add tutorials there. I feel Chestnut is a great first step to get people started quickly, but after that they also need to learn what they're actually doing, what all this code is for, and how to take the next steps.

If you manage to figure this stuff out it would be awesome if you could summarize what you did and why in a markdown file, which could become part of the tutorial collection. In the short term we could just add it to the repo and link from the README.

what do you think?

@rukor
Copy link
Author

rukor commented Oct 27, 2014

Hi, that sounds good to me. Thanks a lot for this effort.

@martinklepsch
Copy link

@plexus let me know if I can help you with the site in any way.

@teur
Copy link
Contributor

teur commented Oct 29, 2014

There is one example with this feature https://github.com/pleasetrythisathome/om-server-rendering

@plexus
Copy link
Owner

plexus commented Dec 7, 2014

There is a documentation site now at http://plexus.github.io/chestnut/. Contributions are very welcome, just drop a markdown file in the doc directory in this repo.

Another place where it could be added is Om-cookbook

@plexus plexus closed this as completed Dec 7, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants