![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
rubocop-daemon
makes RuboCop faster.
Install rubocop-daemon
via rubygems.org:
gem install rubocop-daemon
or if you install RuboCop using bundler, put this in your Gemfile
:
gem 'rubocop-daemon', require: false
To start the server, just run:
rubocop-daemon start
Then you can execute RuboCop fast:
rubocop-daemon exec
And you can pass files:
rubocop-daemon exec foo.rb bar.rb
If you want to pass arguments to RuboCop, you should separate arguments by --
:
rubocop-daemon exec -- --auto-correct
You can control the server like this:
rubocop-daemon <command>
Available commands:
start
: start the serverstop
: stop the serverstatus
: print out whether the server is currently runningrestart
: restart the serverexec [file1, file2, ...] [-- [rubocop-options]]
: invoke rubocop
with the given rubocop-options
rubocop-daemon-wrapper
is a bash script that talks to the rubocop-daemon
server via netcat
. This provides much lower latency than the rubocop-daemon
Ruby script.
For now, you have to manually download and install the bash script:
(
rubygems
will wrap any executable files with a Ruby script, and you can't disable this behavior.)
curl https://raw.githubusercontent.com/fohte/rubocop-daemon/master/bin/rubocop-daemon-wrapper -o /tmp/rubocop-daemon-wrapper
sudo mv /tmp/rubocop-daemon-wrapper /usr/local/bin/rubocop-daemon-wrapper
sudo chmod +x /usr/local/bin/rubocop-daemon-wrapper
You can then replace any calls to rubocop
with rubocop-daemon-wrapper
.
rubocop-daemon-wrapper foo.rb bar.rb
rubocop-daemon-wrapper
will automatically start the daemon server if it is not already running. So the first call will be about the same as rubocop
, but the second call will be much faster.
If you install rubocop-daemon
with bundler, you should set RUBOCOP_DAEMON_USE_BUNDLER
environment variable:
$ export RUBOCOP_DAEMON_USE_BUNDLER=true
Now rubocop-daemon-wrapper
will call the rubocop-daemon
command with bundle exec
.
Unfortunately, the vscode-ruby extension doesn't really allow you to customize the rubocop
path or binary. (You can change the linter path, but not the formatter.)
In the meantime, you could just override the rubocop
binary with a symlink to rubocop-daemon-wrapper
:
# Find your rubocop path
$ which rubocop
<HOME>/.rvm/gems/ruby-x.y.z/bin/rubocop
# Override rubocop with a symlink to rubocop-daemon-wrapper
$ ln -fs /usr/local/bin/rubocop-daemon-wrapper $HOME/.rvm/gems/ruby-x.y.z/bin/rubocop
Or, if you use rbenv:
# which rubocop is rbenv running?
$ rbenv which rubocop
<HOME>/.rbenv/versions/x.y.z/bin/rubocop
# Override rubocop with a symlink to rubocop-daemon-wrapper
$ ln -fs /usr/local/bin/rubocop-daemon-wrapper $HOME/.rbenv/versions/x.y.z/bin/rubocop
Now VS Code will use the rubocop-daemon-wrapper
script, and formatOnSave
should be much faster (~150ms instead of 3-5 seconds).
ALE setting example:
" Use `rubocop-daemon-wrapper` instead of `rubocop`
let g:ale_ruby_rubocop_executable = 'rubocop-daemon-wrapper'
Auto-correct on save setting example:
" optional: Set fixer(not only linter).
let g:ale_fixers = {
\ 'ruby': ['rubocop'],
\}
" optional: Auto-correct on save.
let g:ale_fix_on_save = 1
Bug reports and pull requests are welcome on GitHub at https://github.com/fohte/rubocop-daemon.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that rubocop-daemon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.