Live data from Hacker News

Ruby on Rails 4.0.0.beta1 released

weblog.rubyonrails.org

41–50 of 91 posts

Re: Ruby on Rails 4.0.0.beta1 released

#41

I'm not a rubyist but I'm really excited for the russian-doll caching and really hope it catches on in other frameworks. Data dependency tracking makes everything from straight-up caching to real-time updates effortless and I think is one of the few places where an ORM can be really helpful (queue the two hard problems quote about cache-invalidation and naming things). Quora has been doing this since the beginning an…

If I remember correctly, Adrian Holovaty said something about exploring pjax solutions for Django when he returned to help manage the project. It would be neat to hear more about his ideas if I missed them posted somewhere...

Re: Ruby on Rails 4.0.0.beta1 released

#42

What's the recommended alternative to ActiveRecord Observers? I know they aren't perfect, but I wasn't a fan of cluttering my models with lots of after_commit - is there a better way?

They are still maintained, they've just moved to a separate repo/plugin: https://github.com/rails/rails-observers

Re: Ruby on Rails 4.0.0.beta1 released

#43
post #11

Earlier quoted context omitted.

Proud to be on the contributor list for this one - any of you considering contributing, it's not hard at all, the team makes it really easy.

Any pointers for getting started?

Definitely check out Rails Dev Box(https://github.com/rails/rails-dev-box) too. It helps to create a virtual environment for testing and running the Rails test suite.

Once you have that installed, you basically don't have to worry about dependencies that you need to bootstrap the Rails test suite.

Re: Ruby on Rails 4.0.0.beta1 released

#44

Hello everyone! I am MEGA EXCITED for this release, as it's the first version in which I'm a committer. Wooo! In addition, 954 other intrepid Rubyists in total contributed to this release: http://contributors.rubyonrails.org/edge/contributors Please note that this is a beta, not an rc, so some things may be a bit wonky. Please file an issue on GitHub and I will do everything I can to help you help us iron out all the…

Proud to be on the contributor list for this one - any of you considering contributing, it's not hard at all, the team makes it really easy.

I submitted my first contribution, but I never got a response: https://github.com/rails/rails/pull/8903 :(

I suppose it's a lot less of an issue now anyways, but in 3.2, using fetch with memcache with raw objects is super gross since you get totally incompatible responses depending on whether an item existed in cache or not.

Re: Ruby on Rails 4.0.0.beta1 released

#45
post #11

Earlier quoted context omitted.

Proud to be on the contributor list for this one - any of you considering contributing, it's not hard at all, the team makes it really easy.

Any pointers for getting started?

Upgrade an existing Rails app to 4.0.0.beta1, and fix the issues you come across.

Re: Ruby on Rails 4.0.0.beta1 released

#46
post #20

Earlier quoted context omitted.

Turbo links is more suited to traditional web pages. Backbone for single page mini-apps.

For traditional web pages does it ever make sense to use Backbone/Ember/etc? I've used Backbone on one project and I kind of like the MVC aspect for some things but the thing I'm working on right now is more of a traditional web app. There are some interactive forms where it kind of makes sense to have a model and a view that reacts to changes in the model, but in the end the form is POSTing to a standard rails contr…

I can't comment on Ember or others, but I think Backbone fits into traditional apps just fine. Where I work we're generally a traditional app with many server-rendered pages, but we have a few parts of the site that needed more complex client-side code and we opted to use Backbone for those.

Backbone is a pretty slender library, you can pretty much use it however makes sense to you. You could go really hardcore and do a site that's client-side-everything, or you could do hybrid approach like we did.

Re: Ruby on Rails 4.0.0.beta1 released

#47
post #28

Earlier quoted context omitted.

Funny that ASP.NET had the same thing, called Smart Navigation, back in 2003.

smart navigation is very different. Besides not being supported across browsers, it was more like automatic anchoring.

Nope, it's not automatic anchoring. It uses JS (iframe AJAX) to retrieve a new page from the server and display it without flicker.

Re: Ruby on Rails 4.0.0.beta1 released

#48

What's the recommended alternative to ActiveRecord Observers? I know they aren't perfect, but I wasn't a fan of cluttering my models with lots of after_commit - is there a better way?

One option would be to use a service object (e.g. UserCreator) which would encapsulate the action (saving a user) along with the action to be taken (delivering a signup email).

With external observers, it's not always obvious whether they are enabled or not. Service objects make this more explicit and are easier to test as well.

Re: Ruby on Rails 4.0.0.beta1 released

#49
post #24

Earlier quoted context omitted.

Any reason ruby still has the GIL and not moved to a thread implementation?

Matz likes the fact that it Just Works and you can't accidentally have weirdness based on how your code runs. There aren't any plans to remove it at this time.

I can imagine a whole bunch of gems suddenly breaking if this changes...

Re: Ruby on Rails 4.0.0.beta1 released

#50
post #19

Earlier quoted context omitted.

Rails 4 uses turbolinks. It is a mechanism that instead of loading a new page loads up the HTML via AJAX and replaces the entire content of the page without reloading all the resources(css, js, etc...) So instead of having to deal with plenty of small ajax calls you just build an app as it would work in plain HTML and just use turbolinks to leverage AJAX.

Funny that ASP.NET had the same thing, called Smart Navigation, back in 2003.

2003 or 2013, ASP or Rails both are terrible ideas IHMO. At least as a default.

Sure it can be very efficient, but it's a terrible default.

When DHH state: > except, maybe, compatibility issues with some existing JavaScript packages

Some ? Don't you mean most ? Even Twitter Bootstrap will leak memory if used in a turbolink app.

When coffeescript is pushed as default, I'm ok, at worst you don't use it and you have a useless gem. But turbolink is harmful if you don't know what you are doing.

Post reply on HN