From 61cfcfcc97ed031d45d50f27bb6d81eb7ed0b134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 18 Jun 2021 19:56:19 +0200 Subject: [PATCH] Disable JavaScript debugging in development While debugging JavaScript is certainly useful, enabling it generates about 100 extra HTTP requests because we include about 100 JavaScript files (including external dependencies and files written by us). Depending on the browser configuration, this might make the browser take a very long time processing these requests. On my machine, with these changes, refreshing a page on Firefox takes about 1 second, while previously it took about 6-8 seconds. With Chromium, there doesn't seem to be much difference. Developers are encouraged to temporarily turn debugging while debugging JavaScript (which is a task I personally do about once a month) if that makes debugging easier for them. This change doesn't affect our CSS files, since for CSS we use Sass instead of the asset pipeline. Sass already compiles all CSS files into one in the development environment. --- config/environments/development.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 646ee316d..3b37e1e85 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -48,7 +48,7 @@ Rails.application.configure do # Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. - config.assets.debug = true + config.assets.debug = false # Adds additional error checking when serving assets at runtime. # Checks for improperly declared sprockets dependencies.