Goldencobra icon indicating copy to clipboard operation
Goldencobra copied to clipboard

Reduce dependencies

Open 5minpause opened this issue 9 years ago • 3 comments

Right now we require 54 runtime dependencies for Goldencobra. I am positive that this could be reduced by a lot.

  s.add_dependency 'rails', '~> 4.2.5'
  s.add_dependency 'jquery-rails'
  s.add_dependency 'devise'
  s.add_dependency 'devise-token_authenticatable'
  s.add_dependency 'cancancan'
  s.add_dependency 'activeadmin', '~> 1.0.0.pre1'
  s.add_dependency 'remove_accents'
  s.add_dependency 'sprockets'#, "2.12.4"
  s.add_dependency "sprockets-rails"#, "2.3.3"
  s.add_dependency "tilt"#, "1.4.1"
  s.add_dependency 'compass-rails'#, "2.0.5"
  s.add_dependency 'sass'
  s.add_dependency 'sass-rails'
  s.add_dependency 'compass'
  s.add_dependency 'sidekiq'
  s.add_dependency 'sinatra'
  s.add_dependency 'omniauth'
  s.add_dependency 'omniauth-openid'
  s.add_dependency 'oa-oauth'
  s.add_dependency 'oa-openid'
  s.add_dependency 'cancan'
  s.add_dependency 'ancestry'
  s.add_dependency 'acts-as-taggable-on'
  s.add_dependency 'meta-tags'
  s.add_dependency 'paperclip'
  s.add_dependency 'uglifier'
  s.add_dependency 'exception_notification'
  s.add_dependency 'liquid'
  s.add_dependency 'rubyzip'
  s.add_dependency 'geocoder'
  s.add_dependency 'paper_trail'
  s.add_dependency 'whenever'
  s.add_dependency 'inherited_resources'
  s.add_dependency 'geokit'
  s.add_dependency 'json'
  s.add_dependency 'i18n'
  s.add_dependency 'i18n-active_record'
  s.add_dependency 'pdfkit'
  s.add_dependency 'wkhtmltopdf-binary'
  s.add_dependency 'wicked_pdf'
  s.add_dependency 'rmagick'
  s.add_dependency 'iconv'
  s.add_dependency 'rack-utf8_sanitizer' # handles invalid url encodings
  s.add_dependency 'simple_enum'
  s.add_dependency 'addressable'
  s.add_dependency 'protected_attributes'
  s.add_dependency 'active_model_serializers'
  s.add_dependency 'actionpack-action_caching'
  s.add_dependency 'react-rails', '~> 1.0'
  s.add_dependency 'oj' # faster json rendering
  s.add_dependency 'bootstrap-sass', '~> 3.3' # frontend template framework
  s.add_dependency 'font-awesome-sass'
  s.add_dependency 'autoprefixer-rails' # to provide easy automatic css prefixing
  s.add_dependency 'responders', '~> 2.0'

Hat tip to Mike Perham for inspiration: http://www.mikeperham.com/2016/02/09/kill-your-dependencies/

5minpause avatar Feb 11 '16 17:02 5minpause

I think we should remove

s.add_dependency 'jquery-rails'
s.add_dependency 'devise-token_authenticatable'
s.add_dependency 'compass-rails'
s.add_dependency 'compass'
s.add_dependency 'sidekiq'
s.add_dependency 'sinatra'
s.add_dependency 'cancan' # we have `cancancan` now
s.add_dependency 'uglifier' # is this possible?
s.add_dependency 'exception_notification' # what is this needed for?
s.add_dependency 'rubyzip'
s.add_dependency 'geocoder'
s.add_dependency 'paper_trail' # could be opt-in. functionality is not per-se required for all apps
s.add_dependency 'whenever'
s.add_dependency 'geokit'
s.add_dependency 'pdfkit'
s.add_dependency 'wkhtmltopdf-binary'
s.add_dependency 'wicked_pdf'
s.add_dependency 'autoprefixer-rails' # autoprefixes are not needed
s.add_dependency 'responders', # would be useful for an api extraction. not needed by default

This would reduce the dependencies to 35.

5minpause avatar Feb 11 '16 17:02 5minpause

What is your main aim by reducing the dependencies?

At first sight I recognize needed dependencies like jquery for Golden Cobra JS you think about to remove. The 'geocoder' is used for some location based stuff. Maybe this could be removed from Golden Cobra core and extracted to an individual gem. After that, this dependency would be unnecessary here. Same with pdf stuff and so on.

donni106 avatar Feb 12 '16 10:02 donni106

Maybe this could be removed from Golden Cobra core and extracted to an individual gem. After that, this dependency would be unnecessary here.

This is my goal and the idea behind this issue. Golden Cobra has some functionality which could (and should imho) be extracted.

What is your main aim by reducing the dependencies?

  1. To make it easier to maintain Golden Cobra.
  2. To not scare away potential users because of so many dependencies they have to install/use.

These dependencies lead to a lot of debt. We have to make sure to keep everything up to date and make sure that every gem works. As a lot of these gems have dependencies on their own, it is not uncommon to end up with over 100 gems just for the "basic" Golden Cobra installation. This makes maintenance way to hard. For further ideas why this is a good idea please see the link to Mike's post above.

Regarding individual objections, re: jquery

I think especially this one could be included as a file. There are quite some jquery plugins inside /app/assets/javascripts/goldencobra/ why not bundle jquery.1.xy.min.js as well?

5minpause avatar Feb 12 '16 10:02 5minpause