-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Q] Server side rendering #119
Comments
Does this article answer your question ?https://medium.com/technically-speaking/isomorphic-reactjs-app-with-ruby-on-rails-part-1-server-side-rendering-8438bbb1ea1c#.cjlmxjknf |
@ytbryan Unfortunately no 😢 . I tried |
We are working on https://github.com/renchap/webpacker-react to provide Webpacker+React integration. Server-side rendering is not done yet, but should be soon. |
@renchap would that be a part of this gem as well? |
Yes. I outlined how it would work here : renchap/webpacker-react#3 |
@renchap oh! So webpacker-react will be merged to rails/webpacker, and rails/webpacker will be merged to rails? |
Great work by the way 😄 |
I meant that server-rendering would be a part of webpacker-react, which will stay as a separate gem form Webpacker. |
@woniesong92 @ytbryan Take a look at https://github.com/shakacode/react_on_rails I'm going to take a look today at having it support webpacker. We've got many live projects using server rendering with React and Wepback. Let me know if you want a Slack invite a [email protected]. I'm happy to help. We've got a vibrant community working on this topic and over 2700 stars, and, according to nmpjs.com, over 112K downloads in the last month. |
@woniesong92 Does it work out? Please consider closing this issue. Thank you everyone for your answers. |
@gauravtiwari thanks for the answers! |
@renchap Hey, thanks for the help before. |
@woniesong92 Please take a look a React on Rails. Many companies use it, including server-side rendering. Projects and Kudos. |
I can concur with @justin808. Awesome project. Looking forward to his presentation at NYC.rb ;-) <3 |
@deesx I don't understand your comment in regards to procfiles. You don't need any procfiles. Procfiles are simply a way to easily start up multiple processes. |
Hey guys, any progress towards server side rendering feature? or is there an alternative to use (which won't require too much time to migrate to? |
@justin808 meant by that; it is confusing to see it systematically promoted when the 'server side rendering' topic pops up |
am also having issue with my web packer
…On Thu, Jun 28, 2018 at 12:42 PM, Ben ***@***.***> wrote:
@justin808 <https://github.com/justin808> meant by that; react_on_rails
look like another framework rather than a project that would merge into
rails with a minimal interface (which I think would be a great
improvement). It is sometimes confusing to see it systematically promoted
when the 'server side rendering' topic pops up
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ah9VyDhPRlTcbJ1woMZ8TwtlsvBkDEvSks5uBMFDgaJpZM4MMNDU>
.
|
For the record React on Rails thoroughly supports React Serve-Side Rendering, along with react-rails, which is, AFAIK, the only other library that supports this. Both of these libraries leverage rails/webpacker for the view helpers and can use the default Webpack configuration IF you want the same configuration for both server and client side. However, that would be unusual as it's common to use techniques like code-splitting on the client, which makes no sense for server rendering. |
I just wrote an article on using the pre-release of v4 with React on Rails, including server-side-rendering and concurrent use of the webpack-dev-server. Easy React Server Rendering with rails/webpacker v4 and React on Rails I included a few github repo examples. |
Hi, can I use |
@dachinat you need to use either https://github.com/shakacode/react_on_rails or https://github.com/reactjs/react-rails/. Both can get the job done. Besides the docs, check out the CHANGELOGs to get a sense of activity in the projects. |
@justin808 very nice, thank you |
This is a question, not an issue with the project -- feel free to close it if it shouldn't be here.
In one of my recent projects, I gave up using Rails views completely and used React components instead. The Rails router takes care of the API endpoints and the react router takes care of the views. The controllers would serve the resources in JSON to the react views. One problem I couldn't solve with this setup was server-side rendering.
I think a lot of people will try what I did when webpacker becomes more mature. Do you have an idea about how to solve server-side-rendering problem when people use Rails as an API backend and use JS to render the views?
The text was updated successfully, but these errors were encountered: