Live data from Hacker News

Modern Front-end in Rails

evilmartians.com

41–50 of 150 posts

Re: Modern Front-end in Rails

#41
Curious : is there an up to date analysis on the reasons you would still want to render to html on the server today ? Which search engines work fine with client js rendering the page ? Are there other issue you may still experience ( facebook links, mobile browsers bugs, etc) ?

Re: Modern Front-end in Rails

#42
Not trying to start a flame war here, buy what is the argument for using Rails over Express or Django/Flask for a new project ? Genuinely curious to know the benefits / downsides of each option

Re: Modern Front-end in Rails

#43

I think Vanilla Rails sprinkled with a bit of React can go a long way. Not every part of an app needs the duplicity of state, or need to look dynamic.

> sprinkled with react I can sprinkle in javascript for a normal rails app to add behavior - but i thought react required moving all rendering into it? are you able to "sprinkle" with react within otherwise normal html/css/js?

Yes you can. Not like jQuery where you use it to manipulate the DOM (as rendered from HTML generated on the server).

With React you basically let it manage one or more subtrees of the DOM; you let React do the rendering for that subtree at all times (possibly using React on the server to do pre-rendering).

Re: Modern Front-end in Rails

#44

Honestly, as a Rails dev, this just seems more complicated than creating a Rails app in API mode and using #{React||Vue||Ember}} for the front-end. It's extremely easy to get started with a front-end app using vue-cli. This article spends a lot of time changing Rails' default functionality to achieve behavior similar to what vue-cli gives you by typing `vue init webpack` and answering a few questions. I understand th…

[deleted]

Re: Modern Front-end in Rails

#45
post #42

Not trying to start a flame war here, buy what is the argument for using Rails over Express or Django/Flask for a new project ? Genuinely curious to know the benefits / downsides of each option

Well, in this case it looks like they have decent built in webpack support.

Re: Modern Front-end in Rails

#46
post #42

Not trying to start a flame war here, buy what is the argument for using Rails over Express or Django/Flask for a new project ? Genuinely curious to know the benefits / downsides of each option

I can only comment regarding Django and it mostly boils down to python vs Ruby and what is idiomatic to them

Re: Modern Front-end in Rails

#47
post #42

Not trying to start a flame war here, buy what is the argument for using Rails over Express or Django/Flask for a new project ? Genuinely curious to know the benefits / downsides of each option

You can't compare Rails to Express. It's a much, much more full-featured web framework. JS doesn't really have an equivalent to Rails (that I know of).

Django is comparable in scope but Rails is many times more popular and a lot more work has gone into it. IMO you would need a very good, specific reason to choose Django over the far more popular Rails.

Re: Modern Front-end in Rails

#48
post #42

Not trying to start a flame war here, buy what is the argument for using Rails over Express or Django/Flask for a new project ? Genuinely curious to know the benefits / downsides of each option

Genuinely to answer, Rails offer much richer environment, Express is pretty much bare bones server, Flask is comparable to Sinatra, the only comparable thing is Django and, especially in new version it got much better, I still think Rails is much more flexible solution, which offers you a lot already premade stuff, with your ability to control how things will be used, still quite significant.

Most of all, I believe a set of good practices enforced or encouraged with Rails is what distinguish it over all other frameworks.

Most difficutlty with Rails is after few years when you need to upgrade, I feel a lot of busy work has to happen then.

Re: Modern Front-end in Rails

#49
post #42

Not trying to start a flame war here, buy what is the argument for using Rails over Express or Django/Flask for a new project ? Genuinely curious to know the benefits / downsides of each option

[deleted]

Re: Modern Front-end in Rails

#50
I see a lot of people respond negative to this post, I got a lot from it.

First it shows you how to override rails defaults to create very similar environment that you would get if you would go api/react or vue. Advantage with this setup is that you still Rails foundation and this comes with a lot of goodies.

I love that it explain rather simple way to have hot reloading, I feel this makes me significantly more productive.

Overall really enjoyed article and will adopt many of ideas in it. It is good way to modernize your Rails projects.

Post reply on HN