Live data from Hacker News

Rails 6.1

weblog.rubyonrails.org

11–20 of 87 posts

Re: Rails 6.1

#11
post #4

Lots of good stuff in here, including much more support for using UUIDs as PKs. My favorite new feature is "delegated type" in ActiveRecord to offer a new way to map class hierarchies onto database tables. I wrote a blog post about it[0], but the actual PR is very readable as well[1]. [0] https://www.stevenbuccini.com/how-to-use-delegate-types-in-r... [1] https://github.com/rails/rails/pull/39341

Seems really nice. It's just a Rails abstraction for Multi-table inheritance (MTI) but to me that was sorely needed. MTI always felt much more manageable to me than Single-table inheritance but the latter was the only one with built-in support in Rails, until now.

Re: Rails 6.1

#12
I did a bunch of work in rails prior to the 3.0 days ( probably around 2013 or so), but then switched domains to work more in data engineering.

When I came back to it to scratch an itch for some pet projects, I barely recognized it. I felt completely lost.

Life moved pretty fast, I guess. Are there any good resources out there for someone from the 2.x days to get back to speed?

Re: Rails 6.1

#13
post #6

It's a really nice time to be a Ruby / Rails developer. Rails itself has made some really nice improvements with this release and there is also the "NEW MAGIC" should be following in the next couple of days which is currently being sold as what Rails was to the back end, this will be to the front end. Ruby 3 is also just a few days away which brings optional type checking to helps add some additional structure to lar…

Man I'm hoping NEW MAGIC is like Phoenix LiveView. As a Rails dev I started looking into the Elixir/Phoenix world just for LiveView but I don't really want to switch languages... I just want that new magic that LiveView offers. I know there are gems for Rails but I'd prefer if it was baked-in and officially supported.

Re: Rails 6.1

#14

I did a bunch of work in rails prior to the 3.0 days ( probably around 2013 or so), but then switched domains to work more in data engineering. When I came back to it to scratch an itch for some pet projects, I barely recognized it. I felt completely lost. Life moved pretty fast, I guess. Are there any good resources out there for someone from the 2.x days to get back to speed?

I fall in this same bucket. I still refer to the old railscasts now and then. I use rails for my hobby projects.

Currently, I depend on Rails Guides, and I think they do a pretty good job. Would be good to know other resources.

https://guides.rubyonrails.org/

Re: Rails 6.1

#15
post #6

It's a really nice time to be a Ruby / Rails developer. Rails itself has made some really nice improvements with this release and there is also the "NEW MAGIC" should be following in the next couple of days which is currently being sold as what Rails was to the back end, this will be to the front end. Ruby 3 is also just a few days away which brings optional type checking to helps add some additional structure to lar…

>Ruby 3

Oh shit, I didn't realize that that's the scheduled Christmas release. Finally, all strings frozen by default!

Re: Rails 6.1

#16
post #6

It's a really nice time to be a Ruby / Rails developer. Rails itself has made some really nice improvements with this release and there is also the "NEW MAGIC" should be following in the next couple of days which is currently being sold as what Rails was to the back end, this will be to the front end. Ruby 3 is also just a few days away which brings optional type checking to helps add some additional structure to lar…

Man I'm hoping NEW MAGIC is like Phoenix LiveView. As a Rails dev I started looking into the Elixir/Phoenix world just for LiveView but I don't really want to switch languages... I just want that new magic that LiveView offers. I know there are gems for Rails but I'd prefer if it was baked-in and officially supported.

Depending on your patience you can go and take a look at a real life implementation of it at https://app.hey.com since they enable source maps.

What the actual developer facing API is going to look like however is another question. I do kind of worry that given how much is has been talked up by DHH in particular that it is going to struggle to live up to the hype.

Either way, I am excited to see something new in the Rails front end space, that has felt like it was lacking a LOT of structure.

Re: Rails 6.1

#17
post #4

Lots of good stuff in here, including much more support for using UUIDs as PKs. My favorite new feature is "delegated type" in ActiveRecord to offer a new way to map class hierarchies onto database tables. I wrote a blog post about it[0], but the actual PR is very readable as well[1]. [0] https://www.stevenbuccini.com/how-to-use-delegate-types-in-r... [1] https://github.com/rails/rails/pull/39341

Does a "delegated type" work with preloading associations, ala "includes"? This remains a pain point with many polymorphic associations in Rails, but not sure how the new functionality handles if, if it does at all.

Based on this GitHub comment[0], it appears the answer is yes although it requires a little additional customization out of the box to prevent N+1 queries..

[0] https://github.com/rails/rails/pull/39341#issuecomment-72725...

Re: Rails 6.1

#18
post #16

Earlier quoted context omitted.

Man I'm hoping NEW MAGIC is like Phoenix LiveView. As a Rails dev I started looking into the Elixir/Phoenix world just for LiveView but I don't really want to switch languages... I just want that new magic that LiveView offers. I know there are gems for Rails but I'd prefer if it was baked-in and officially supported.

Depending on your patience you can go and take a look at a real life implementation of it at https://app.hey.com since they enable source maps. What the actual developer facing API is going to look like however is another question. I do kind of worry that given how much is has been talked up by DHH in particular that it is going to struggle to live up to the hype. Either way, I am excited to see something new in the…

I was sold on hey.com's UI design already because it's using for dropdown menus.

The really fun part, though: the summary content isn't just a menu icon, it's a trigger for some (currently unpublished) Turbolinks variant. The menu content is loaded (and subsequently 304'd) dynamically as a server-rendered partial (sans layout).

Most tellingly, if you visit the menu content's XHR URL with regular browsing then hey.com renders that menu as the sole content in a page layout.

We can't see the server-side parts yet, but if that becomes an out-of-the-box end-to-end behaviour within Rails, then in conjunction with Stimulus 2 and Action Cable I'm stoked about the possibilities. Especially so since I have a mission to replace all my dropdown & modal boilerplate with and elements, and I like to build services that still work if JS is disabled. But it's also good for mundane stuff like progressive form validation in line-of-business apps.

Re: Rails 6.1

#19
post #10

>Error Objects Active Model’s errors are now objects with an interface that allows your application to more easily handle and interact with errors thrown by models. The feature was implemented by lulalala and includes a query interface, enables more precise testing, and access to error details. This has been in the work since Rails 5.x and I believe Lulalala extracted it from his work on Gitlab. And it was lot of har…

I'm out of the loop. what is New Magic?

Re: Rails 6.1

#20
post #10

>Error Objects Active Model’s errors are now objects with an interface that allows your application to more easily handle and interact with errors thrown by models. The feature was implemented by lulalala and includes a query interface, enables more precise testing, and access to error details. This has been in the work since Rails 5.x and I believe Lulalala extracted it from his work on Gitlab. And it was lot of har…

I'm out of the loop. what is New Magic?

DHH has been teasing something called "New Magic" on Twitter but beyond that we don't know much.
Post reply on HN