15 ms·
Rails 7 Released
- Mikeb85 5y agoRails 7 feels like Rails 1 again. So easy to get up and running, no Webpacker nonsense, back to plain CSS and JS (no SCSS, Babel, other pre-processors), plus lots of nice new features on the backend.
- noaheverett 5y agoYes! I have two Rails apps (5.x and 6.x) to upgrade to 7. I'm curious which one will be easier. My hunch is the 5.x app since it didn't rely on Webpacker/Node either. We will see...
- d3nj4l 5y agoI've played around with the new default frontend (no js build step at all!) and it's been an absolute joy. I was able to write basically babby's first Rails app and have it look, feel and behave like an SPA, and that's a wonderful thing for apps that need just a little bit of interactivity. While I've mostly moved on to Phoenix for my personal "weekend project" web needs, Rails is still a wonderful framework for getting an app off the ground fast.
- KarlKemp 5y agoI use Rails as a portable, light, zero-conf frontend for data exploration. Just create the minimum viable rails app (--api), fill in the database connection, and you get a powerful REPL for exploring + rake to run transformations.
- stephenhuey 5y agoI have certainly turned to Rails many times to write a bunch of ActiveRecord models to play around with data in the console without ever running the web server.
- ignurant 5y agoThere’s even a book about that! https://datavisualizationtoolkit.com/ https://datavisualizationtoolkit.com/ Who would have thought that the “Data Visualization Toolkit” would be about Rails? Turns out, it’s pretty sweet actually! rails new, g migration, baddaboom. I’ve done this a few times, but usually use chartkick rather than d3 as the book suggests.
- nauticacom 5y agoWhile I think the new site certainly looks appealing and includes a lot more helpful information than before, there's something about the old playful, hand-drawn design that felt more like it embodied the ethos of Rails.
- firemelt 5y agodid they have full rails 7 upgrade/migration guide? like how to remove ujs and turbolinks, how to remove the webpack and setup the js and css bundler for rails pre 7?
- KarlKemp 5y agoJust set up two identical projects, one with the last version and one with the current, then run diff? That being said, rails does have an upgrade task now. I have a lot of faith in it, but absolutely zero trust.
- JamesBrooks 5y agohttps://railsdiff.org/6.1.4.4/7.0.0 https://railsdiff.org/6.1.4.4/7.0.0
- donapieppo 5y agoA lot of noise from changing single-quoted strings to double-quoted strings
- dvergeylen 5y agoYou can read about the migration process here: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-6-1-to-rails-7-0 https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#...
- ralmidani 5y agoThe home page redesign is a framework website done right. If you want to draw people to a tech stack you need to show, not tell. A video showing DHH building an app, then examples of household names that were built on Rails, then concise code samples outlining how you put an app together. Brilliant! Contrast this with frameworks that gush about how awesome they are on the home page, but make you dig through pages of documentation just to understand basic concepts and what supposedly makes their approach unique.
- CoachRufus87 5y agoThank you DHH + all the contributors who’ve brought Rails this far. Many careers and companies have been built on your collective shoulders.
- aaronbrethorst 5y agoThat was quick! RC1 only came out 9 days ago. https://news.ycombinator.com/item?id=29466996 https://news.ycombinator.com/item?id=29466996
- wilg 5y agoI've used Rails for pretty much everything over the years, since like Rails 1, and still intend to. It's very good! But I will say I hope to switch soon to something Rails-inspired, like Vapor, in a more modern language, like Swift.
- aphistic 5y agoWhat are your thoughts on Elixir and Phoenix?
- zapfo 5y agoElixir, or rather Phoenix - more specifically, is not good for traditional web apps, in my opinion. You will basically reinvent everything like in the JavaScript world. The functional way of programming looks great at first but there is a reason why it isn't used everywhere, if it is so good :). Feel free to explore though. And make your own opinion.
- wilg 5y agoI've tried it a bit (via https://phoenixforrailsdevelopers.com/ https://phoenixforrailsdevelopers.com/), and it seems very cool especially with the realtime features, but I greatly prefer Swift as a language.
- baash05 5y agoIt fills about the same shoes as ruby/rails. But IMHO it does a rather bad job of it. The docs are bad, and when you google for answers you almost always find "here's how to do it rails" first. All the things that Elixir sells as good fall under the YANGNI. Code swapping sounds great, until you add in docker and red green deploy. Immutable data seems great, but threaded code isn't all that common in most web apps. (not near business logic threads that is) I don't see it as mature enough (despite its history) And it's hard to hire for.
- todd3834 5y agoI recently tried to build a relatively simple blog app with Vapor just to learn it. Once I got to trying to find third party libraries for things I needed it got very frustrating. I just needed to interact and generate a key using the AWS sdk. My hacky solution was to use the golang lib and compile it to C then import it. It was more hassle than it was worth for me. I like swift but it doesn’t feel like the ecosystem is interested enough in server for me. Hope to see that change but I’m not holding my breath.
- RileyJames 5y agoJust today I was helping a junior (php) developer get setup & started with ruby. RVM, gems, bundler. Then onto rails. Upon first attempt to launch rails it choked on yarn requiring to install packages. And then I had to go through node, npm/yarn, webpacker, rails is primarily the backend, webpacker manages the front end. And it all seemed needlessly complicated. I love that rails have doubled down on the low-js direction. Progressive enhancement, the whole js ecosystem is there if/when you need. But until then KISS.
- svacko 5y agoAs you can read in the Rails 7 announcement, the webpacker is history already. Also, you don't even need to have the node present with ESM. So all this complex stuff you mention won't be soon required.
- RileyJames 5y agoYea I’m excited for it. What I’ve seen and used of stimulus & turbo is exactly the future I want to continue working with.
- desertcroc 5y agoI first learned rails almost 15 years ago and at the time, there was already a proliferation of getting started blog posts targeting different major versions of Rails. It was a hot mess with older tutorials referencing modules that were deprecated, unmaintained, etc. A good example is authentication. There was one widely used community module that made it easy to add authentication to an app... Until it was no longer the popular way to do things and all the tutorials had moved on to something else. I believe that module was eventually deprecated entirely with the next major version of rails. I haven't touched rails in maybe 10 years now and I'm scared to try to find the right way to catch up. Anyone have a good recommendation for how to learn modern Rails? Fwiw, I'm not looking to start and flamewar but having been a (mostly backend) Python guy for the last 8 years, things seem to still move quickly but have fewer breaking changes in the Python world.
- firecall 5y agoThe fundamental MVC pattern is unchanged! It would all be very familiar! Just fire up a new project and off you go! As for authentication, if you want a ready to go solution, then Devise is still current and pretty much the default! Development of Gems like Attachinary are now deprecated in favour of Rails' Active Storage. I'm not an expert, but I still dip in and out, and find I can still get by with the basics I learnt back on v3! YMMV :-)
- Mikeb85 5y ago> fewer breaking changes in the Python world ??? Python 3 fiasco? Rails moves fast but Ruby has kept backwards compatibility since 1.9...
- BryanBeshore 5y agogorails.com
- Ecco 5y agoI don’t like how they use Rails to advertise Hey.
- nauticacom 5y agoI understand that, but it's not as if they've really changed. They always used Rails to advertise Basecamp and vice-versa.
- ksec 5y agoSorry where did they do that? I searched Hey and there were only two mentions.
- todd3834 5y agoHey and Basecamp pay the bills so that Rails can be what it is. I don’t mind a name drop. It couldn’t have been more subtle and it was actually very relevant. Didn’t seem like an ad to me.
- donapieppo 5y agoI really like they use Hey to show how a real application can be done using rails. DHH shows the internals of Hey in some tutorial and I found it very interesting.
- johnklos 5y agoFool me once, shame on me. Fool me twice, shame on... well, you know what I mean. Let us know when Rails can safely be updated from one tiny version to the next. I'm tired of Rails developers telling me that nobody can touch any of the myriad packages that're part of Rails, even when there are significant security updates, due to fear of breaking things.
- rubyist5eva 5y agoRelation.load_async seems like a BFD - too bad I probably won't get to use it at my current job - we're only now starting to talk about the move to rails 5 - still stuck with Rails 4.2 and Ruby 2.5 (eehh). Congrats to the team on this release, been using Rails for over a decade and it makes my day job so, so, so pleasant.
- mrtweetyhack 5y agowait. if you moving to rails 5, why not just jump to 7?
- nasmorn 5y agoWhat holds you back so far? You are not even getting security updates are you?
- rubyist5eva 5y ago> You are not even getting security updates are you? NOPE The business "doesn't see the value".
- heartbreak 5y agoDrop your email address or some other contact info in your profile if you’re interested in working somewhere that does.
- BoysenberryPi 5y agoGoing to somewhat hijack this to ask a question. Are there any popular non-Rails uses for Ruby? I'd like to learn Ruby but it seems that Python and Ruby occupy the same space and use cases so you really only need to know one of them.
- nikodunk 5y agoJekyll and Sinatra are two reasonably popular other web frameworks. But agree with the other sibling comments otherwise.
- Mikeb85 5y agoPuppet, chef, sys-admin-y type things. Jekyll, Sinatra. Mruby (embeddable Ruby). Homebrew and YAST (Suse Linux) are written in Ruby. Stripe uses Ruby but not Rails. Basically anything you'd use Perl for, + a bunch more uses, and of course Rails and web stuff.
- nunez 5y agoi believe homebrew is transitioning to golang. all of the tools you’ve mentioned above that are seeing less usage, unfortunately :(
- poisonta 5y agoStripe (and Shopify) too? Check how many top YC companies use Ruby.
- berkes 5y agoThe question was how many use Ruby, but not Rails.
- Mikeb85 5y agoHomebrew's repo is still almost all Ruby with no signs of Go anywhere. A bit of Swift... And fair enough, tools come and go. Ruby is still the best write-once language I've used though, and Rails is still a top web framework.
- nikodunk 5y agoI'm pretty experienced in Node and React, and discovering Rails recently has been an absolute joy. I feel like I've made the opposite journey from everyone else on HN, because I joined the programming community _after_ the big RoR hype and during the Node/React hype. Trying out rails, I understand how much magic is involved here. Because I've had to build all this crap myself - many, many times over. Complicated things become simple, and tasks that usually make me sigh (add a new data point and add it right through Knex, Hapi models, routes, redux actions, redux store, dispatch/selector and template) turns into a SINGLE COMMAND. Sold :) Very excited about this new release! Edit: I wrote a blog about this a while ago btw, but there are many others pieces out there like it: https://nikodunk.com/a-node-js-developer-discovers-rails/ https://nikodunk.com/a-node-js-developer-discovers-rails/ - using it to create https://electrade.app https://electrade.app currently.
- nunez 5y agoI’m with you. Writing and testing Ruby is a blast, and it’s so easy to write clean, readable code with it. Performance isn’t great, but it’s just so nice. Rails adds a lot of nice magic on top that makes it even better. JavaScript (even with TypeScript) and frontend frameworks are…quite a journey by comparison.
- baash05 5y agoI love the lang.. TBH though performance has never been something I see as a fault in the language. I've almost always found (for my apps) that it's data access that's the hold up. Like if I map the issues, n+1 or bad indexing have almost always taken the lions share of slower code bits. It irks me when people sight the lang or ruby as having bad memory or being slow. I've seen a tweak of the indexing cut response time to 25%. I even managed a 10x gain off of one index adjustment.
- CraigJPerry 5y ago>> Performance isn’t great I see so much focus on this on web frameworks generally and it strikes me as almost always the wrong thing to optimise for. I don’t know rails, the last time i tried it was circa 2007 and yet I’d confidently adopt it given the right situation. If i had a choice between shipping features 2% sooner or saving $10k / year on server costs, I’d almost always choose sooner. Let’s be honest, a rails dev team is moving more than 2% faster than a java/c# web dev team. If i have 5 devs and they’re all 2% more productive, that could be around $10k of free developer output but it’s more than that, developer productivity compounds. 75% off my server costs doesn’t.
- janglezz 5y agoI am so excited to upgrade and get rid of webpacker. Thank you Rails team! <3
- deleted 5y ago[deleted]
- BilalBudhani 5y agoAside from Rails 7 release, what I'm more excited about is the new homepage which also got updated with this release. For the longest time, I felt the Rails homepage did not do proper justice in explaining the true potential of the framework, especially to the folks who are not aware of Rails and visiting the site to gather some ideas. This new homepage does a phenomenal job of providing good idea about the framework like who uses it, code snippets, mission statement, helpful links and the good old DHH video on how to build a blog. > Ruby on Rails scales from HELLO WORLD to IPO Also, this statement hits home for me. Exciting time to be a Rails developer.
- strzibny 5y agoI agree, felt the same and happy now!
- bbu 5y agoVery excited about this! Rails has enabled me, a non-developer, to build great webapps.
- gremlinsinc 5y agoDoes rails have authentication, authorization, queues, and redis caching built in yet? Is there also a way to do coroutines like w/ Swoole? I haven't used Ruby in a while, how far have they moved to stricter typing? I feel they were great in 2012, but right now PHP/Laravel still looks easier to build/prototype w/ and the community is just huge.
- gherkinnn 5y agoThere's a lot of praise for Rails. Reading the docs and watching the demo I understand why. But what are its problems? Where will I hit a barrier?
- berkes 5y agoThere are many tradeoffs. The good news is that hardly any projects and startups will hit those. Or, when they do, they have the resources and funds to transition. Anyway: Ruby is slow. Terribly so. Rails even more. The optimisation is on speed of development and that comes (a.o.) at the cost of runtime speed. Memory usage is terrible too. Easily solvable by bigger or more VMS though. Ruby, with its runtime, is complex and hard to build and deploy and host. Heroku et al take that away from you, but "getting it running on your laptop" alone is a sysyphian task. I've worked at and managed teams where this remained a timesink: where devs spend significant time "Debugging their environments". Rails is simple MVC with loads and loads of magic. Opinionated patterns such as their own take on ActiveRecord, MVC make this worse. If you dislike these patterns or architectural choices: you'll have a bad time. If you want, or need to implement other patterns (such as, but not limited to, hexagonal architecture, event-sourcing, adapters, dependency injection etc) you'll have a hard time and Rails will work against you. Very hard. Related to this: It is hard (but not impossible!) to keep an ever growing Rails app clean, agile, and stable. Rails works against you in this: it's often easier and quicker to Do The Bad Thing that it is to Implement The Proper Abstraction Or Pattern. It optimizes for speed of development - perfect for MVPs or PoCs, at the cost of maintainability. Ruby is weakly typed. If you want, or need the protection or guidance of a compiler in typing, this, Ruby won't help you. Additional tools like (complex) linters, static code analysis help and are required to keep a long running project workable. Extensive testing of everything is The Solution Of Ruby to all this: need to ensure your method works when it gets a null (nil) passed: write tests: no compiler will help you. Ruby is dynamic to the extreme. Many people will feel very uncomfortable with this (only part rightly so, IMO). But a practical downside is that no IDE or vim-setup can help you like you may be used from Java, .Net, Rust or C(++). Refactoring is basically "rerunning the tests over and over. And over. And again". Edit: and some smaller, but, depending on case, important too: Rails' fetish with ActiveRecord makes nearly all Rails apps extremely tightly coupled to the database and the data-model. To inverse this: you're data-model is bounded by what Rails needs and wants (in practice: in theory this can be worked around). If you consider that all long-lived projects carry "data" along the journey, but that codebase is iterated constantly, having such tight coupling and rigid requirements on your data-model is a big risk. Rails' is ever-growing. It's "batteries included" idea is great for starting. But that makes it ever growing in size and complexity. Rails' architectural style or modules and includes make the common way of writing things hard to test, hard to maintain and hard to debug. For example ActiveRecord::Base is a terrible violator of the Single Responsibility Principle: your models connect to the database, manage storage, manage state-machines, can render themselves, can serialize themselves, manage their validations, manage and coordinate listeners and callbacks, manage identification, have a giant API for fetching and querying in the database, manage their dependencies on other models, manage other models, and so on, and so on. And that when "testing" is the most important tool to keep a Rails app solid and stable.
- vr46 5y agoDespite me writing off Ruby as a career path for the last five or six years (and I stand by that), out of nowhere a client has dropped a simple Rails API in my lap as part of a consultancy role and so I've updated it, deployed it and am about to rewrite it to add tests and move the logic to more sensible places. And - as before, it's a joy to use and work with and be productive again. Looks like I'm updating to Rails 7 then...
- montblanc 5y ago> Despite me writing off Ruby as a career path for the last five or six years (and I stand by that) I don't think you need to write it off, especially if you're a consultant. That's just bad business thinking, knowing Ruby is a hot asset.