Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Doesn't work with Rails 4.1 #21

Open
jscheid opened this issue Nov 2, 2014 · 11 comments
Open

Doesn't work with Rails 4.1 #21

jscheid opened this issue Nov 2, 2014 · 11 comments

Comments

@jscheid
Copy link

jscheid commented Nov 2, 2014

Hi,

This Gem worked very well for me on Rails 4.0. Thanks for making it! Unfortunately it doesn't on 4.1:

irb(main):001:0> Rails.application.class.method_defined?(:reload_dependencies?)
=> false

This means that RailsDevTweaks::GranularAutoload::Middleware.reload_dependencies? always returns true, which makes this gem pretty much unusable with 4.1 because any savings gained from not reloading assets are negated by the overhead of always reloading classes even when nothing has changed.

Can I suggest to declare incompatibility with Rails 4.1 in the gemspec?

@jscheid
Copy link
Author

jscheid commented Nov 2, 2014

Also, it appears that the problem this gem solves can be fixed on vanilla Rails 4.1 just with config.assets.raise_runtime_errors = false.

@rstacruz
Copy link

rstacruz commented Nov 5, 2014

👍 would love to have this working in 4.1.

Here's how reload_dependencies? looks like in 4.0: src

# File railties/lib/rails/application.rb, line 304
def reload_dependencies? #:nodoc:
  config.reload_classes_only_on_change != true || reloaders.map(&:updated?).any?
end

It's now absent in 4.1. However, reloaders is still available (src), but i'm not sure how it's used internally.

@rstacruz
Copy link

rstacruz commented Nov 5, 2014

...but then again, will there be any speed savings in 4.1? I kinda doubt it.

@mahemoff
Copy link

I don't think this project is active anymore. Better to remove it from Gemfile.

https://stackoverflow.com/questions/27992494/rails-4-2-after-upgrade-pages-never-load-in-browser-or-take-really-long-des
"The problem was being caused by a gem called "rails-dev-tweaks" that is no longer needed in Rails 4. Removing that gem fixed the problem."

@Deradon
Copy link

Deradon commented Dec 17, 2015

Can confirm. Do not use this gem in rails >= 4.1.
Removing this gem improved response time by 200% for our app.

@arturopie
Copy link
Contributor

We still find benefits from this gem after fixing RailsDevTweaks::GranularAutoload::Middleware#reload_dependencies?.

The reason we sill get better performance when using this gem is because the check Rails does to find if it needs to reload code is way more expensive than what this gem does.

Rails will check the timestamp of all files in the projects for every asset request whereas this gem just check if the request is for an asset. You will notice the difference when your project has a lot of source code files.

I'll create a pull request to make this gem work for Rails 4.1

@nevir
Copy link
Contributor

nevir commented Apr 7, 2016

Unfortunately, I'm not sure there are any active owners for this repo any more - you may want to fork it & register a new gem

Alternatively, it might also be fruitful to hit up [email protected] to see whether they have someone willing to review & publish the patch

@arturopie
Copy link
Contributor

I created a pull request just in case someone still needs this gem: #24

@mahemoff
Copy link

mahemoff commented Apr 7, 2016

I'd agree with @nevir about forking this - it seems the official repo is dead, will never change, and no issues or PRs will go anywhere.

If you're able to maintain it and plan to support Rails 5, it would make sense to start a new Github project + gem with a different name, include an attribution to this project. Rails dev remains slower than ideal and there should still be demand for a lib that speeds it up.

@nevir Why would Google review this? AFAIK they don't have anything to do with this project and don't use much Ruby.

@nevir
Copy link
Contributor

nevir commented Apr 7, 2016

@mahemoff Google acquired Wavii a few years back; they're the ones that have ownership of this repo now (and I no longer work there, so I can't merge/publish it :(

@arturopie
Copy link
Contributor

Ok. We decided to remove the gem from our project and inline just what we need.

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants