All threads / Vue JS server side rendering with rails webpacker

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Vue JS server side rendering with rails webpacker

Ed Tewiah asked in General

I'm trying to figure out a solution for server side rendering of a vue js app using rails and webpacker. This article comes out top in a google search but is pretty much useless:

https://medium.com/tekton-labs/getting-started-with-rails-vue-server-side-rendering-33af435ac763

Except it mentions that there is a go rails episode about it. Anyone know which episode this is?

Would also be happy with a solution to pre-render with rails and webpacker.

Thanks

I've been looking for a SSR solution too.

Seems like React on Rails is doing SSR somehow. https://github.com/shakacode/react_on_rails/blob/master/docs/additional-reading/server-rendering-tips.md

Another resource I found is the Official Documentation for SSR in a Non-Node JS environment, however Webpacker runs on Node so, I'm a little bit confused.
https://ssr.vuejs.org/guide/non-node.html

As third option, I found InertiaJS: https://github.com/inertiajs/inertia-vue inspired from Turbolinks but with VueJS. Right now, there is no Rails version, only Laravel, but the fonder sustain that it can work on Rails, Django and other frameworks...

The last solution I found is Quence Vue https://github.com/stowball/quench-vue
Where you can add Client Side Hydration but the structure is pretty weird.

Best,

Thanks for the reply Andrew. I decided in the end that pre-rendering might be best so I'm going to investigate using this:

https://github.com/chrisvfritz/prerender-spa-plugin

Not entirely sure if I can get it to work with Rails and webpacker but I'll give it a go anyway.

I'm interested in Vue SSR with Rails, too. Did you guys have any luck with your approaches?

Yaaay, there is a rails adapter for inertia.js now:

https://github.com/inertiajs/inertia-rails

Will give that a go.

Inertia.js does not support SSR: https://inertiajs.com/server-side-rendering. I'm curious as to what you end up using Ed.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 37,629+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.