While this is deployment specific, I thought it would be worth noting.
Including rails_admin radically increases the size of the slug on cloud services like Heorku (which have a hard limit at 100mb)
Since the rest of Diaspora in it's entirety is about 57mg (with WAAAAAy more dependencies), I am thinking there might be some runaway thing that is getting bundled in that is huge.
Worth noting, I did try a simple hack, which was to purge the git history, (https://github.com/diaspora/rails_admin_smaller) which according to my contributor @stevenh512 brought the slug size down 10mb, and means that there is about 17mg of stuff still in rails_admin which would be there if you packaged a gem tomorrow.
see here for more info: diaspora/diaspora@ecc1a84#commitcomment-1211283
Hey Max. You're not the first person to ask for this. I'll take care of it soon.
It would be nice if bundler gave you a way to make a shallow clone: bundler/bundler#228
Thanks for responding. I look forward to a packaged gem, and hopefully getting to the bottom of what is causing the bloat.
I will give a me too on that bundler issue as well.
@maxwell I think part of the size issue (even using your rails_admin_smaller repo) is the fact that there's always some git history, even if it's only one commit. There are also screenshots in the repo that I hope wouldn't be included in a packaged gem, but that's probably only a small part of the problem.
I think it's interesting that when I clone your rails_admin_smaller repo, git tells me I've downloaded less than 2mb (I think it was 1.7 or 1.8), but it still adds 17mb to my slug size.. makes me wonder if there might also be something wrong on Heroku's end. I don't see anything in the rails_admin gemspec that would account for an extra 15mb+ slug size (especially since we're already depending on many of those same gems).
After looking at bundler/bundler#228 I'm not sure if it would be possible to do a shallow clone and still satisfy Bundler's Gemfile.lock, but I'm wondering if it might be possible to do something (either in Bundler or in Heroku's slug compiler) to get rid of the git history for a production deploy. I have recent copies of Bundler and Heroku's Ruby buildpack here so I might try experimenting with that and see what I can come up with.
Prepare for initial gem release
Your wish is my command.
Nice.. thanks @sferik this should reduce my Heroku slug size quite a bit (without the buildpack hack I'm currently using)