Skip to content

Commit 21c9732

Browse files
author
David Heinemeier Hansson
authored
Remove spring as a default installation option (rails#42997)
* Remove spring as a default installation option Faster computers have meant that most apps won't see a big benefit from Spring on small to moderate size apps. Thus the pain of dealing with the occasional spring issue is no longer warranted by default. * Errant end * No longer an option * Additional spring removals * Pointer to docs is enough
1 parent da911da commit 21c9732

File tree

19 files changed

+8
-131
lines changed

19 files changed

+8
-131
lines changed

activejob/test/support/integration/helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
dummy_app_path = Dir.mktmpdir + "/dummy"
1010
dummy_app_template = File.expand_path("dummy_app_template.rb", __dir__)
1111
args = Rails::Generators::ARGVScrubber.new(["new", dummy_app_path, "--skip-gemfile", "--skip-bundle",
12-
"--skip-git", "--skip-spring", "-d", "sqlite3", "--skip-javascript", "--force", "--quiet",
12+
"--skip-git", "-d", "sqlite3", "--skip-javascript", "--force", "--quiet",
1313
"--template", dummy_app_template]).prepare!
1414
Rails::Generators::AppGenerator.start args
1515

guides/source/command_line.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ If you wish to skip some files or components from being generated, you can appen
102102
| `--skip-active-storage` | Skip Active Storage files |
103103
| `--skip-action-cable` | Skip Action Cable files |
104104
| `--skip-sprockets` | Skip Sprockets files |
105-
| `--skip-spring` | Don't install Spring application preloader |
106105
| `--skip-javascript` | Skip JavaScript files |
107106
| `--skip-turbolinks` | Skip turbolinks gem |
108107
| `--skip-test` | Skip test files |

guides/source/getting_started.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,6 @@ This will create a Rails application called Blog in a `blog` directory and
182182
install the gem dependencies that are already mentioned in `Gemfile` using
183183
`bundle install`.
184184

185-
NOTE: If you're using Windows Subsystem for Linux then there are currently some
186-
limitations on file system notifications that mean you should disable the `spring`
187-
gem which you can do by running `rails new blog --skip-spring` instead.
188-
189185
TIP: You can see all of the command line options that the Rails application
190186
generator accepts by running `rails new --help`.
191187

guides/source/rails_application_templates.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@ after_bundle do
265265
end
266266
```
267267

268-
The callbacks gets executed even if `--skip-bundle` and/or `--skip-spring` has
269-
been passed.
268+
The callbacks gets executed even if `--skip-bundle` has been passed.
270269

271270
Advanced Usage
272271
--------------

railties/lib/rails/app_updater.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def generator_options
2828
options[:skip_action_cable] = !defined?(ActionCable::Engine)
2929
options[:skip_sprockets] = !defined?(Sprockets::Railtie)
3030
options[:skip_bootsnap] = !defined?(Bootsnap)
31-
options[:skip_spring] = !defined?(Spring)
3231
options[:updating] = true
3332
options
3433
end

railties/lib/rails/generators/app_base.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ def self.add_shared_options_for(name)
6161
class_option :skip_sprockets, type: :boolean, aliases: "-S", default: false,
6262
desc: "Skip Sprockets files"
6363

64-
class_option :skip_spring, type: :boolean, default: false,
65-
desc: "Don't install Spring application preloader"
66-
6764
class_option :skip_javascript, type: :boolean, aliases: "-J", default: name == "plugin",
6865
desc: "Skip JavaScript files"
6966

@@ -395,10 +392,6 @@ def bundle_install?
395392
!(options[:skip_bundle] || options[:pretend])
396393
end
397394

398-
def spring_install?
399-
!options[:skip_spring] && !options.dev? && Process.respond_to?(:fork) && !RUBY_PLATFORM.include?("cygwin")
400-
end
401-
402395
def webpack_install?
403396
!(options[:skip_javascript] || options[:skip_webpack_install])
404397
end

railties/lib/rails/generators/rails/app/app_generator.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ def bin
9898
end
9999
chmod "bin", 0755 & ~File.umask, verbose: false
100100

101-
remove_file "bin/spring" unless spring_install?
102101
remove_file "bin/yarn" if options[:skip_javascript]
103102
end
104103

@@ -123,7 +122,6 @@ def config
123122
template "environment.rb"
124123
template "cable.yml" unless options[:updating] || options[:skip_action_cable]
125124
template "puma.rb" unless options[:updating]
126-
template "spring.rb" if spring_install?
127125
template "storage.yml" unless options[:updating] || skip_active_storage?
128126

129127
directory "environments"
@@ -328,7 +326,6 @@ def initialize(*args)
328326
skip_dev_gems: true,
329327
skip_javascript: true,
330328
skip_jbuilder: true,
331-
skip_spring: true,
332329
skip_system_test: true,
333330
skip_webpack_install: true,
334331
skip_turbolinks: true).tap do |option|
@@ -584,7 +581,7 @@ def file(*args, &block)
584581
create_file(*args, &block)
585582
end
586583

587-
# Registers a callback to be executed after bundle and spring binstubs
584+
# Registers a callback to be executed after bundle binstubs
588585
# have run.
589586
#
590587
# after_bundle do

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ 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 spring_install? -%>
59-
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
60-
gem "spring"
61-
<% end -%>
58+
# Speed up rails commands in dev on slow machines / big apps. See: https://github.com/rails/spring
59+
# gem "spring"
6260
end
6361

6462
<%- if depends_on_system_test? -%>
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
<% if spring_install? -%>
2-
load File.expand_path("spring", __dir__)
3-
<% end -%>
41
APP_PATH = File.expand_path("../config/application", __dir__)
52
require_relative "../config/boot"
63
require "rails/commands"
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
<% if spring_install? -%>
2-
load File.expand_path("spring", __dir__)
3-
<% end -%>
41
require_relative "../config/boot"
52
require "rake"
63
Rake.application.run

0 commit comments

Comments
 (0)