Skip to content

Use Thor's apply instead of prerequisite tasks #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2024

Conversation

jonathanhefner
Copy link
Member

The javascript:install:shared and javascript:install:node_shared tasks serve only as prerequisites for the other installer tasks; they should not be run on their own (nor listed with rake --tasks). By replacing those tasks with corresponding calls to Thor's apply method, we avoid the overhead of running bin/rails app:template (and bundle install) multiple times.

This commit also renames install_node.rb to install_procfile.rb since it is concerned with generating a Procfile.dev file.


As a point of comparison, running the tests from #182 without this PR:

$ time bundle exec appraisal rake test
real  0m50.328s
user  7m3.732s
sys   1m24.657s

And running them with this PR:

$ time bundle exec appraisal rake test
real  0m28.588s
user  3m46.645s
sys   0m47.999s

The `javascript:install:shared` and `javascript:install:node_shared`
tasks serve only as prerequisites for the other installer tasks; they
should not be run on their own (nor listed with `rake --tasks`).  By
replacing those tasks with corresponding calls to Thor's `apply` method,
we avoid the overhead of running `bin/rails app:template` (and
`bundle install`) multiple times.

This commit also renames `install_node.rb` to `install_procfile.rb`
since it is concerned with generating a `Procfile.dev` file.
@dhh dhh merged commit 4bce06b into rails:main Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants