Skip to content

Commit

Permalink
Delete app/assets/javascripts
Browse files Browse the repository at this point in the history
Also remove unused dependencies.
  • Loading branch information
calleluks committed Feb 3, 2019
1 parent 1a4e049 commit 7712622
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 41 deletions.
6 changes: 0 additions & 6 deletions Gemfile
Expand Up @@ -11,13 +11,9 @@ gem 'sqlite3'
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'

This comment has been minimized.

Copy link
@robinboening

robinboening May 5, 2019

Hey @calleerlandsson

Thank you very much for the blog post about replacing sprockets with webpack. One question though: Why do you leave the turbolinks gem in the Gemfile? Any reason for that since its loaded through webpack now?

This comment has been minimized.

Copy link
@calleluks

calleluks May 6, 2019

Author Owner

Hi @robinboening, I'm glad you like it!

In addition to the JS assets, The Turbolinks gem also provides a Rails engine that augments the redirect_to controller method to work with Turbolinks.

Since the JS assets aren't required from within a JS-file handled by Sprockets, there's no risk of including the Turbolinks JS twice.

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
Expand All @@ -36,8 +32,6 @@ gem 'jbuilder', '~> 2.5'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false

gem 'jquery-rails'

gem 'webpacker', '~> 3.5'

group :development, :test do
Expand Down
17 changes: 0 additions & 17 deletions Gemfile.lock
Expand Up @@ -65,17 +65,9 @@ GEM
chromedriver-helper (2.1.0)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.4)
crass (1.0.4)
erubi (1.8.0)
execjs (2.7.0)
ffi (1.10.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
Expand All @@ -85,10 +77,6 @@ GEM
jbuilder (2.8.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
jquery-rails (4.3.3)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand Down Expand Up @@ -183,8 +171,6 @@ GEM
turbolinks-source (5.2.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.1.20)
execjs (>= 0.3.0, < 3)
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
Expand All @@ -208,9 +194,7 @@ DEPENDENCIES
byebug
capybara (>= 2.15)
chromedriver-helper
coffee-rails (~> 4.2)
jbuilder (~> 2.5)
jquery-rails
listen (>= 3.0.5, < 3.2)
puma (~> 3.11)
rails (~> 5.2.2)
Expand All @@ -221,7 +205,6 @@ DEPENDENCIES
sqlite3
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
webpacker (~> 3.5)

Expand Down
1 change: 0 additions & 1 deletion app/assets/config/manifest.js
@@ -1,3 +1,2 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
14 changes: 0 additions & 14 deletions app/assets/javascripts/application.js

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion app/views/layouts/application.html.erb
Expand Up @@ -6,7 +6,6 @@
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>

Expand Down
3 changes: 1 addition & 2 deletions config/environments/production.rb
Expand Up @@ -24,8 +24,7 @@
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# Compress CSS.
# config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
Expand Down

0 comments on commit 7712622

Please sign in to comment.