Skip to content

Commit e34300a

Browse files
author
David Heinemeier Hansson
authored
Stop trying to configure listen by default on compatible platforms (rails#42985)
* Stop trying to configure listen by default on compatible platforms Modern computers with SSDs don't see much/any benefit from having an evented file update watcher. Remove complexity by taking this spinning-drive concession out. * Actually need listen for testing the opt-in * Test no longer relevant
1 parent ea2c5ec commit e34300a

File tree

14 files changed

+3
-101
lines changed

14 files changed

+3
-101
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ GEM
294294
mustache
295295
nokogiri
296296
libxml-ruby (3.2.1)
297-
listen (3.5.1)
297+
listen (3.6.0)
298298
rb-fsevent (~> 0.10, >= 0.10.3)
299299
rb-inotify (~> 0.9, >= 0.9.10)
300300
loofah (2.10.0)

actionmailbox/test/dummy/config/environments/development.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,4 @@
6363

6464
# Annotate rendered view with file names
6565
# config.action_view.annotate_rendered_view_with_filenames = true
66-
67-
# Use an evented file watcher to asynchronously detect changes in source code,
68-
# routes, locales, etc. This feature depends on the listen gem.
69-
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
7066
end

actiontext/test/dummy/config/environments/development.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,4 @@
6363

6464
# Annotate rendered view with file names
6565
# config.action_view.annotate_rendered_view_with_filenames = true
66-
67-
# Use an evented file watcher to asynchronously detect changes in source code,
68-
# routes, locales, etc. This feature depends on the listen gem.
69-
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
7066
end

activestorage/test/dummy/config/environments/development.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,4 @@
4848

4949
# Annotate rendered view with file names
5050
# config.action_view.annotate_rendered_view_with_filenames = true
51-
52-
# Use an evented file watcher to asynchronously detect changes in source code,
53-
# routes, locales, etc. This feature depends on the listen gem.
54-
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
5551
end

guides/source/command_line.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ If you wish to skip some files or components from being generated, you can appen
105105
| `--skip-action-cable` | Skip Action Cable files |
106106
| `--skip-sprockets` | Skip Sprockets files |
107107
| `--skip-spring` | Don't install Spring application preloader |
108-
| `--skip-listen` | Don't generate configuration that depends on the listen gem |
109108
| `--skip-javascript` | Skip JavaScript files |
110109
| `--skip-turbolinks` | Skip turbolinks gem |
111110
| `--skip-test` | Skip test files |

guides/source/getting_started.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ install the gem dependencies that are already mentioned in `Gemfile` using
184184

185185
NOTE: If you're using Windows Subsystem for Linux then there are currently some
186186
limitations on file system notifications that mean you should disable the `spring`
187-
and `listen` gems which you can do by running `rails new blog --skip-spring --skip-listen`
188-
instead.
187+
gem which you can do by running `rails new blog --skip-spring` instead.
189188

190189
TIP: You can see all of the command line options that the Rails application
191190
generator accepts by running `rails new --help`.

railties/lib/rails/generators/app_base.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ def self.add_shared_options_for(name)
7070
class_option :skip_spring, type: :boolean, default: false,
7171
desc: "Don't install Spring application preloader"
7272

73-
class_option :skip_listen, type: :boolean, default: false,
74-
desc: "Don't generate configuration that depends on the listen gem"
75-
7673
class_option :skip_javascript, type: :boolean, aliases: "-J", default: name == "plugin",
7774
desc: "Skip JavaScript files"
7875

@@ -417,18 +414,10 @@ def depends_on_system_test?
417414
!(options[:skip_system_test] || options[:skip_test] || options[:api])
418415
end
419416

420-
def depend_on_listen?
421-
!options[:skip_listen] && os_supports_listen_out_of_the_box?
422-
end
423-
424417
def depend_on_bootsnap?
425418
!options[:skip_bootsnap] && !options[:dev] && !defined?(JRUBY_VERSION)
426419
end
427420

428-
def os_supports_listen_out_of_the_box?
429-
/darwin|linux/.match?(RbConfig::CONFIG["host_os"])
430-
end
431-
432421
def run_bundle
433422
bundle_command("install", "BUNDLE_IGNORE_MESSAGES" => "1") if bundle_install?
434423
end

railties/lib/rails/generators/rails/app/templates/Gemfile.tt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ group :development do
5555
# Note: Interferes with etag cache testing. Can be configured to work on production: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
5656
# gem "rack-mini-profiler", "~> 2.0"
5757
<%- end -%>
58-
<% if depend_on_listen? -%>
59-
gem "listen", "~> 3.3"
60-
<% end -%>
6158
<% if spring_install? -%>
6259
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
6360
gem "spring"

railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ Rails.application.configure do
7272
# Annotate rendered view with file names.
7373
# config.action_view.annotate_rendered_view_with_filenames = true
7474

75-
# Use an evented file watcher to asynchronously detect changes in source code,
76-
# routes, locales, etc. This feature depends on the listen gem.
77-
<%= "# " unless depend_on_listen? %>config.file_watcher = ActiveSupport::EventedFileUpdateChecker
78-
7975
# Uncomment if you wish to allow Action Cable access from any origin.
8076
# config.action_cable.disable_request_forgery_protection = true
8177
end

railties/lib/rails/generators/rails/plugin/plugin_generator.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ def generate_test_dummy(force = false)
121121
opts[:force] = force
122122
opts[:skip_bundle] = true
123123
opts[:skip_spring] = true
124-
opts[:skip_listen] = true
125124
opts[:skip_git] = true
126125
opts[:skip_turbolinks] = true
127126
opts[:skip_webpack_install] = true

0 commit comments

Comments
 (0)