7 ms·
What's new in Rails 5?
- happywolf 11y agoMinor clarification: what i meant below is I plan to build a portal with major feature being CMS, not planning to rewrite an CMS from scratch, instead I will source in Github for the module that can be ported/plugged in right away with some modification. ----- Right now, the web frameworks that are on my radar are: Laravel(PHP), Phoenix(Elixir), React+Meteor(JS), and RoR(Ruby). This list is by no means exhaustive, just that recently they caught my attention and I am contemplating to choose one for an upcoming CMS project. Would like to know if these frameworks each has its own segment or/and sweetspots, or they kind of compete against each other and the choice is mostly personal preference? The goal is to hear what people like/dislike on a particular framework. Inputs from those who have worked with multiple frameworks will be awesome. Thanks in advance.
- porker 11y ago> choose one for an upcoming CMS project. Thing is, none are CMS's. If that's what you need, why would you start with a framework? Sure it's fun to build and I always think I can do better than the existing CMS's do, but it's never a good use of my time - or good for the client. Please, if you need a CMS, use a CMS. If you need a Content Management Framework (CMF) one of the above could save time. If it's an application surrounded by managed content, your choices are different again. But please don't reinvent the wheel if you can avoid it.
- ryantownsend 11y agoI agree with the above. That said, even if you are doing something new, you don't need to reinvent the wheel – it may be worthwhile taking a look at https://www.contentful.com/ https://www.contentful.com/ (not affiliated, just an interesting service) and utilising their API to build an application which purely delivers the added value.
- pavlov 11y agoPrismic.io is another excellent "CMS as a service": https://prismic.io https://prismic.io I've used it on a project and was quite pleased. Using their API, separating content publishing from the presentation becomes much more robust than with a traditional integrated CMS that you customize using themes or whatever.
- Jgrubb 11y agoI actually disagree. There's a big difference between reinventing the wheel - which happens because you didn't know that somebody else had thought of this before and already solved the problem - and building your own wheel because none of the off-the-shelf wheels work that great for your needs. If this is a small business website and will never be built on ever again, then absolutely ignore the hate and go Wordpress. If it's something that might be extended over the years into use cases beyond just a webform to post an article with a title and a body then it's worth evaluating if you might be able to custom tailor a better fit for your business.
- mrmondo 11y agoAs someone who's hosted and fixed a lot of CMS in recent years I'll say this: choose a solution that's fit for the individual purpose. All CMS' suck, a bit like all OS' suck. As soon as you do anything non-standard their inherit flexibility becomes a burden. If you have skills in rails and need an off the shelf CMS find a popular one and use it you like but if you need to create a web 'application' look at Sinatra, rails or whatever but don't use a CMS as the foundation for an application. Most of all, if my team and I have one take away: Stay far away from Drupal and people that preach its relevance. It is a world of hurt with an 'expert beginner' community. That has cost so many organisations more time and money than they ever anticipated. Treat ever 'off he shelf' product with a degree of disposability - don't get locked in and never get into the trap that you've chosen 'the best'.
- egeozcan 11y agoI've worked with Drupal 6 years ago. I think it was awesome if all you need is a web site with custom workflows in the content creation. It made you suffer, however, if you started to turn the web site into an app for the public (anything more than custom filters for your lists and I think you are in this territory). The problem is a typical web site (even in those days) almost always turned into an app.
- mattmanser 11y agoIt's CMSes and OSes. You're looking for the plurals, so you definitely don't need to use a possessive apostrophe there because there's no ownership in the sentence. Also, because they're acronyms you pronounce by enunciating the words, my instinct would be to use OS's (as you would pronounce the 's, O-S-es). But that's up for debate. For example: The OS's kernel blew up (possessive apostrophe, the OS owns the kernel) He had a wide range of OSes to choose from (pluralization, there are many OSes)
- mrmondo 11y agoThank you for clarifying / pointing that out to me. I've never spent time to understand that an apostrophe used in this way made it possessive. I've taken that on board and will (hopefully) not make this mistake again.
- bigbento 11y agoI haven't used Laravel, but PHP tends to be relatively easy to get a development environment running as well as deploying on shared host type environments. On the flip side, the application becomes ever intertwined with the host environment, and beyond that, PHP libraries and frameworks tend to lack a lot of discipline that you find in other languages (that is, you find yourself pondering things like, "what if I were running this across many boxes, oh it'd just break..."), so 12-factor readiness (which helps when you want to run your app on more than one machine) tends to be an afterthought. I haven't worked with Phoenix or even Erlang/Beam that much (though I've used Rabbit quite a bit). I think the overall model of the runtime is brilliant, but I'm not sure you need to buy in to the whole ecosystem to benefit from the learnings of it. There are actor systems for a lot of languages (Celluloid and Akka come to mind). Celluloid works nicely for weird long running things. I'm not totally sure how much it matters for your typical web app that would work fine enough with a CGI model (though I guess it's not totally different). I've only played with Meteor, but I've used Node and React pretty extensively. React in particular is brilliant. It provides a nice way of thinking about the UI of your app in a more functional way. Of course, the devil's in the details, but it works pretty well. I'm less keen on Node as a backend language. A lot of backend code is between the lines, waiting on the DB or dealing with crazy errors. Node and JavaScript aren't very good at those things today. ES7 Async functions have some promise (hah!), but interoperating between libraries can be a little confusing at first. Rails is an old friend of mine. You can do a lot with Rails, and it's almost sacrilege to say these days, but a well written monolithic, non-javascript heavy Rails app can be a joy to work in. It's pretty good for CMS type content; I've used it a bit to build various web stores to good effect. Things can get hairy when you try and step outside of "the Rails way", but that's less of an issue these days. It can also be a little funky using the asset pipeline with newer frontend libs, but there's that nifty source that packages frontend libraries as gems (the name eludes me at the moment).
- nithinbekal 11y ago> there's that nifty source that packages frontend libraries as gems (the name eludes me at the moment). Are you thinking of Rails Assets? https://rails-assets.org https://rails-assets.org
- 11y ago
- grey-area 11y agoIf you need something complex and bespoke, build it yourself with something like Rails/Elixir/Whatever - your choice will depend mostly on your preference of tools/language/community as they are all quite flexible if you know them well. Rails is suitable if you're greenfielding a complex new site (as would be Go or Elixir), Laravel probably if you like PHP (haven't used it), definitely not Drupal, Typo3, Wordpress etc if you are thinking of extending them in any significant way. Meteor doesn't strike me as particularly suitable for a CMS. Django might be worth looking at as it has built-in admin which is more CMS-like than others? Since you mention building a CMS, my 2 cents on that: If you need something very simple which is a good fit for a particular CMS and/or are on a very limited budget, just use a prebuilt CMS product and adjust some templates, otherwise you're reinventing a lot for not much gain. Doesn't sound like you want this option. If you are producing a bespoke site consider writing most of what you need from scratch rather than trying to use modules/plugins etc. because the capability to use modules/plugins tends to invert authority in an app, and require you to do the things the framework way or not at all. Every bit of code you import from elsewhere comes with a significant cost in maintenance, security and complexity. So don't choose a framework in the hope you can just plug things other people have written together and make it all work. Avoid CMS products which try to allow the end user to customise records (custom fields, nodes etc), install hundreds of badly written modules, and do a limited form of programming by manipulating records or templates in the database (I'm thinking of things like Drupal and to a lesser extent Wordpress). If you try to use them for something complex it will usually lead to an unmaintainable morass of poorly understood code.
- girvo 11y agoI despise Wordpress, and have definitely shaved off too many years of my life struggling with its utter insanity that is its core/plugin ecosystem... However, check out Themosis. It's basically dragged Wordpress kicking and screaming into 2015, and considering clients will still sometimes demand the familiar Wordpress admin if you live in agency land, it's a worthy framework to have in your toolkit.
- porker 11y ago> Themosis Now that looks interesting. Thanks for sharing. /me goes back to trying to apply visual design changes to a site 'built' via Visual Composer... kill me now.
- aikah 11y ago> Laravel(PHP), Phoenix(Elixir), React+Meteor(JS), and RoR(Ruby). All solutions have trade-off. Obviously rails isn't adapted if an app is focused on websockets, Elixir gives you good primitives for distributed programming and PHP runs on cheap hosting. Rails is really like "ok , I have like 2 weeks I need to develop a complex CRM for a client" , something in my opinion that cannot be pulled off that quickly with other solutions. But yeah , there is no silver-bullet. When I read articles like these I wonder if the author really believes it or if he is trolling : https://www.linkedin.com/pulse/go-dominate-next-decade-ian-eyberg https://www.linkedin.com/pulse/go-dominate-next-decade-ian-e... Every solution has its share of problems,even Go.
- happywolf 11y agoThanks. Very insightful and informative. Great input.
- Jgrubb 11y agoCurrently working for a company that has all of it's websites in Drupal, so my team is versed in PHP. I've been working with Drupal for 7 straight years. I have this dream of not having to work with Drupal ever again, so I often daydream about what I'd build if I were given the chance. In a sense I'm in the same position as you, except that it's probably never going to happen and that I've been thinking about this for years. I'd go Rails, and here's why. Rails is easy to learn - even if your team has never written Ruby it's an easy language to pick up with way fewer gotchas than either PHP or JS. I've evaluated Laravel, and it's probably the best PHP option out there right now, but knowing Rails, I often find myself hating how much code you have to write to accomplish the same thing in Laravel just by virtue of it being PHP. The resulting code feels clunky (though, that's surely just because I also suck at programming). Rails is extremely mature - it's been around for over a decade. The upgrade from 2 to 3 was painful, the upgrade from 3 to 4 was much less so. I imagine the upgrade from 4 to 5 will be as well, and so on. The ecosystem is very filled out, the package mgmt story is there, the testing story is there. These are new developments on the wider PHP scene that will probably takes several more years to reach the level of adoption and familiarity that Ruby enjoys. I love writing JS, but the whole ecosystem over there is in this constant state of tectonic upheaval right down to the language (ES6), and unlearning the old gotchas so I can learn the new ones doesn't appeal to me right now. Rails is exceptionally well documented in terms of blog posts, the Rails Guides, and the API docs. None of these other technologies even come close. This is especially true of Laravel, and I've only ever read 1 blog post about Phoenix, so good luck with that. This was supposed to be short, sorry.
- berkes 11y ago> so I often daydream about what I'd build if I were given the chance. In a sense I'm in the same position as you, except that it's probably never going to happen and that I've been thinking about this for years. This was me, until three years ago. I am freelancer, all my gigs, clients and my whole network was about Drupal. Hell, I still receive requests for Drupal work on a weekly basis: my name was established, so almost impossible to move out of Drupal. So I wrote some op-eds on why Drupal was not always a good choice for projects (most notably: government projects) citing from my experience as rescue-consultant-for-failing-drupal-projects. And then I wrote http://berk.es/2012/10/01/farewell-drupal/ http://berk.es/2012/10/01/farewell-drupal/ and declined all work Drupal related. It does not have to be Rails. It could be Opal, Django, Spring, Symphony, Yii, anything. But if you are really unhappy with Drupal, as you seem to be, cut the ties. There's more then enough work out there. And working in an environment that is built for developers (instead of building a webapp by clicking checkboxes and clumsy html interfaces in the Drupal backend). Move to a community that encourages clean code, "craftmanship", designs, patterns and so on, you will become a better programmer. If that is what you want. I'm now a happy Rails developer. Who learns new things every day. I like my job a lot; so much, that I can't imagine not coding for work (And already I am almost always that Old Guy on the job). In ten years it'll probably not be Rails anymore, but WhateverFancyFramework is the default then. And because within Rails I really learned coding, picking up new languages, frameworks and whatnots is not that hard at all, anymore.
- bshimmin 11y agoThis is a great summary, and there look to be some really interesting things coming in Rails 5. Two thoughts: 1) I hope ActionCable is as seamless to integrate and works as well as Rails features ought to; you can, of course, achieve web sockets right now using Faye or various other implementations, but it's quite complex to get right (though the faye-rails gem is pretty handy) - and realtime functionality is becoming more and more important. 2) I wish they'd just give up on Turbolinks. Maybe some people are using it and love it, but it's always the first thing I turn off when I start a new Rails project, and I know quite a few people who feel the same. For those of us who never thought it was a good idea in the first place, I'm not sure any number of improvements are going to change our minds.
- giuseppeciuni 11y agoI totally agree with your 2 point. I always turn off turbolink too when I start a new rails project!
- skrebbel 11y agoI didn't use rails since turbolinks appeared, but I really like the idea on paper. Why do you turn it off?
- jkxyz 11y agoBy default it's a global always-on feature. I think it's the sort of feature that might be great in certain parts of the application (like tabbed pages) but having globally enabled by default isn't ideal. For me the built-in browser feedback of loading a new page works pretty well, and having to rebuild this feedback in an application so that it works everywhere is simply unnecessary work.
- bshimmin 11y agoYeah, exactly. I think the very existence of this site also kind of sums up the problem: http://reed.github.io/turbolinks-compatibility/ http://reed.github.io/turbolinks-compatibility/
- ksec 11y agoI thought DHH recently announce on Twitter there will be Basecamp 3, which is based on Rails 5. And there will be Turobolink 5 too. I was guessing they have some more things to announce soon.
- rcaught 11y agoTurbolinks 3
- littlewing 11y agoI'm a long-time Rails developer and unfortunately this release doesn't excite me, though I appreciate all the hard work by the core team/continued support from 37signals. The reason is this: The intent of Rails is to make writing web applications easier, but that writing web applications actually got much more difficult for me as a Rails developer when Angular and Ember and then later React got popular. I love Ruby, but I respect the fact that the Javascript-client-side-heavy/"single-page" part of the app is where the magic is for at least a few years now- really several years. Other than Rails helpers in the 2006-2008 timeframe being a big deal, Rails' has not ever really helped out a whole lot on the JS side, and you wouldn't expect it to. The asset pipeline is wonderful, and coffeescript support with in it is ok I guess, even though I don't use it. But, writing JS client-side is not any easier. To be a full-stack developer in today's world I have to accept the fact that Ruby, as much as I love it and would rather develop in it all day and night, is just not taking over in every facet of development. There is no Rubyscript on the client side taking over the world. There is ES6/Typescript- that is the future. A substantial number of Ruby masters are jumping over to the Phoenix/Elixir bandwagon. I look at it, and want to like it, but I just haven't gotten into it yet. I know it is fast, but it just isn't as readable yet for me. And it won't solve the problem that the client still needs to be written primarily in Javascript. And the answer is not Node either, because every serious Javascript developer I've talked to says, "Node is still not ready." I just feel let down. I want to get excited about Rails again, but give me a path. I don't really like Ember a whole lot, because the community is just not where it is with Angular and React. Someone please take your favorite frameworks and show me how my life is supposed to get better by using them. Show me how it is fun. Bring back the magic, because right now it all just seems like more and more of a PITA as attention deficit has fully set in within the web application development community and there is no clear way ahead for the next few years.
- kailuowang 11y agoI think you can try solve the "rails no longer excites me" problem by finding a more exciting language than Ruby. There are more than plenty of them out there.
- 11y ago
- LunaSea 11y agoIs it more security vulnerabilities ?
- issaria 11y ago> Without a doubt, it is time to prepare our applications for the upgrade; just because of the performance improvements are worth it. If you are on Rails 4.x, the upgrade is almost painless. Shouldn't it be called Rails 4.3? That been said, you could get the performance improvement by just upgrading to ruby 2.2.2
- issaria 11y ago> Without a doubt, it is time to prepare our applications for the upgrade; just because of the performance improvements are worth it. If you are on Rails 4.x, the upgrade is almost painless. Shouldn't it be Rails 4.3? That been said, you could get the performance improvement by just upgrading to ruby 2.2.2
- ownedthx 11y agoI'm not sure if this is baked into Rails 5, but you can get es6 support (via Babel) with the sprockets-es6 gem: https://github.com/TannerRogalsky/sprockets-es6 https://github.com/TannerRogalsky/sprockets-es6 Rails is still a second-class JS citizen due to the asset pipeline being opinionated and controlling compared to the node way of doing things, but it gets you closer to 'the new hotness'.
- atwrkrmrm 11y agoWhat do you mean JS is still a second class citizen? I'm unfamiliar with Rails asset pipeline. Do you just mean that the asset pipeline doesn't really have as much features as other build tools like Grunt and Gulp? Or is there something about asset pipeline that prevents you from using JavaScript to its full potential? (Genuinely curious. Not familiar with the JS side of Rails)