Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ Run `rake` for testing the gem and `react_on_rails/spec/dummy`. Otherwise, the `

If you run `rspec` at the top level, you'll see this message: `require': cannot load such file -- rails_helper (LoadError)`

After running a test, you can view the coverage results SimpleCov reports by opening `coverage/index.html`.
If you run tests with `COVERAGE=true`, you can view the SimpleCov report at `coverage/index.html`.

Turbolinks 5 is included in the test app, unless "DISABLE_TURBOLINKS" is set to YES in the environment.

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

---

[![License](https://img.shields.io/badge/license-mit-green.svg)](LICENSE.md)[![Gem Version](https://badge.fury.io/rb/react_on_rails.svg)](https://badge.fury.io/rb/react_on_rails) [![npm version](https://badge.fury.io/js/react-on-rails.svg)](https://badge.fury.io/js/react-on-rails) [![Coverage Status](https://coveralls.io/repos/shakacode/react_on_rails/badge.svg?branch=main&service=github)](https://coveralls.io/github/shakacode/react_on_rails?branch=main) [![Gem Downloads](https://img.shields.io/gem/dt/react_on_rails)](https://rubygems.org/gems/react_on_rails)
[![License](https://img.shields.io/badge/license-mit-green.svg)](LICENSE.md)[![Gem Version](https://badge.fury.io/rb/react_on_rails.svg)](https://badge.fury.io/rb/react_on_rails) [![npm version](https://badge.fury.io/js/react-on-rails.svg)](https://badge.fury.io/js/react-on-rails) [![Gem Downloads](https://img.shields.io/gem/dt/react_on_rails)](https://rubygems.org/gems/react_on_rails)

[![Integration Tests](https://github.com/shakacode/react_on_rails/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/shakacode/react_on_rails/actions/workflows/integration-tests.yml)
[![Gem Tests](https://github.com/shakacode/react_on_rails/actions/workflows/gem-tests.yml/badge.svg)](https://github.com/shakacode/react_on_rails/actions/workflows/gem-tests.yml)
Expand Down Expand Up @@ -115,7 +115,8 @@ Start with the docs here:
- [GitHub Discussions](https://github.com/shakacode/react_on_rails/discussions)
for questions
- [GitHub Issues](https://github.com/shakacode/react_on_rails/issues) for bugs
- [React + Rails Slack](https://invite.reactrails.com) for community chat
- [React + Rails Slack](https://reactrails.slack.com) for community chat
Comment thread
justin808 marked this conversation as resolved.
Comment thread
justin808 marked this conversation as resolved.
Comment thread
justin808 marked this conversation as resolved.
Comment thread
justin808 marked this conversation as resolved.
(existing members; non-members, please use GitHub Discussions above)
- [Commercial support](mailto:react_on_rails@shakacode.com) for upgrades,
consulting, and Pro guidance
- [AI Agent User Guide](AGENTS_USER_GUIDE.md) for AI coding assistants
Expand Down
2 changes: 1 addition & 1 deletion docs/oss/deployment/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ console.log(ReactOnRails.registeredComponents());

- **[GitHub Issues](https://github.com/shakacode/react_on_rails/issues)** - Bug reports and feature requests
- **[GitHub Discussions](https://github.com/shakacode/react_on_rails/discussions)** - Questions and help
- **[React + Rails Slack](https://invite.reactrails.com)** - Real-time community support
- **[React + Rails Slack](https://reactrails.slack.com)** - Real-time community support

### Professional support

Expand Down
2 changes: 1 addition & 1 deletion docs/oss/getting-started/common-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,5 +262,5 @@ ls -la public/packs/
1. **Check the detailed [Troubleshooting Guide](../deployment/troubleshooting.md)**
2. **Search [GitHub Issues](https://github.com/shakacode/react_on_rails/issues)**
3. **Ask in [GitHub Discussions](https://github.com/shakacode/react_on_rails/discussions)**
4. **Join [React + Rails Slack](https://invite.reactrails.com)**
4. **Join [React + Rails Slack](https://reactrails.slack.com)**
5. **Professional support**: [react_on_rails@shakacode.com](mailto:react_on_rails@shakacode.com)
2 changes: 1 addition & 1 deletion react_on_rails/Gemfile.development_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ end
group :test do
gem "capybara", "~> 3.40"
gem "capybara-screenshot"
gem "coveralls", require: false
gem "simplecov", "~> 0.16.1", require: false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version constraint (~> 0.16.1) is carried forward from the old coveralls gem requirement, which pinned to the same range. SimpleCov 0.16.x is from 2019; the current release line is 0.22.x, which adds branch coverage support and better HTML output. Consider loosening to ~> 0.22 either here or in a quick follow-up.

Suggested change
gem "simplecov", "~> 0.16.1", require: false
gem "simplecov", "~> 0.22", require: false

gem "cypress-on-rails", "~> 1.19"
gem "equivalent-xml"
gem "generator_spec"
Expand Down
14 changes: 1 addition & 13 deletions react_on_rails/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
crass (1.0.6)
csv (3.3.5)
cypress-on-rails (1.20.0)
Expand Down Expand Up @@ -401,17 +395,11 @@ GEM
uri (>= 0.12.0)
stringio (3.2.0)
strscan (3.1.0)
sync (0.5.0)
term-ansicolor (1.8.0)
tins (~> 1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.5.0)
tilt (2.3.0)
timeout (0.6.0)
tins (1.33.0)
bigdecimal
sync
tsort (0.2.0)
turbo-rails (2.0.20)
actionpack (>= 7.1.0)
Expand Down Expand Up @@ -448,7 +436,6 @@ DEPENDENCIES
bootsnap
capybara (~> 3.40)
capybara-screenshot
coveralls
cypress-on-rails (~> 1.19)
debug
equivalent-xml
Expand Down Expand Up @@ -481,6 +468,7 @@ DEPENDENCIES
sdoc
selenium-webdriver (= 4.9.0)
shakapacker (= 9.6.1)
simplecov (~> 0.16.1)
spring (~> 4.0)
sprockets (~> 4.0)
sqlite3 (~> 1.6)
Expand Down
6 changes: 0 additions & 6 deletions react_on_rails/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
tasks = %w[lint run_rspec]
prepare_for_ci = %w[node_package dummy_apps]

if ENV["USE_COVERALLS"] == "TRUE"
require "coveralls/rake/task"
Coveralls::RakeTask.new
tasks << "coveralls:push"
end

desc "Run all tests and linting"
task default: tasks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def add_test_related_gems_to_gemfile
gem("rspec-rails", group: :test)
# NOTE: chromedriver-helper was deprecated in 2019. Modern selenium-webdriver (4.x)
# and GitHub Actions have built-in driver management, so no driver helper is needed.
gem("coveralls", require: false)
gem("simplecov", require: false, group: :test)
end

def replace_prerender_if_server_rendering
Expand Down
5 changes: 0 additions & 5 deletions react_on_rails/rakelib/run_rspec.rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "coveralls/rake/task" if ENV["USE_COVERALLS"] == "TRUE"

require "pathname"
require "yaml"

Expand Down Expand Up @@ -141,8 +139,6 @@ namespace :run_rspec do
pinned_version_examples.each { |example_type| Rake::Task[example_type.rspec_task_name].invoke }
end

Coveralls::RakeTask.new if ENV["USE_COVERALLS"] == "TRUE"

desc "run all tests no examples"
task all_but_examples: %i[gem dummy_no_turbolinks dummy js_tests] do
puts "Completed all RSpec tests"
Expand Down Expand Up @@ -209,7 +205,6 @@ def run_tests_in(dir, options = {})
env_tokens = []
env_tokens << options.fetch(:env_vars, "").strip unless options.fetch(:env_vars, "").strip.empty?
env_tokens << "TEST_ENV_COMMAND_NAME=\"#{command_name}\""
env_tokens << "COVERAGE=true" if ENV["USE_COVERALLS"]

env_vars = env_tokens.join(" ")
command = "#{env_vars} bundle exec rspec #{rspec_args}"
Expand Down
2 changes: 1 addition & 1 deletion react_on_rails/rakelib/shakapacker_examples.rake
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace :shakapacker_examples do # rubocop:disable Metrics/BlockLength
# Use unbundled_sh_in_dir to ensure the generator uses the example app's
# gem versions, not the parent workspace's cached bundle context.
unbundled_sh_in_dir(example_type.dir, generator_commands)
# Re-run bundle install since dev_tests generator adds rspec-rails and coveralls to Gemfile
# Re-run bundle install since dev_tests generator adds rspec-rails and simplecov to Gemfile
bundle_install_in(example_type.dir)

# Apply specific React version for compatibility testing examples
Expand Down
13 changes: 1 addition & 12 deletions react_on_rails/spec/dummy/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
crass (1.0.6)
csv (3.3.5)
cypress-on-rails (1.19.0)
Expand Down Expand Up @@ -391,16 +385,11 @@ GEM
uri (>= 0.12.0)
stringio (3.2.0)
strscan (3.1.5)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.5.0)
tilt (2.2.0)
timeout (0.4.3)
tins (1.32.1)
sync
tsort (0.2.0)
turbo-rails (2.0.6)
actionpack (>= 6.0.0)
Expand Down Expand Up @@ -439,7 +428,6 @@ DEPENDENCIES
bootsnap
capybara (~> 3.40)
capybara-screenshot
coveralls
cypress-on-rails (~> 1.19)
debug
equivalent-xml
Expand Down Expand Up @@ -471,6 +459,7 @@ DEPENDENCIES
sdoc
selenium-webdriver (= 4.9.0)
shakapacker (= 9.6.1)
simplecov (~> 0.16.1)
spring (~> 4.0)
sprockets (~> 4.0)
sqlite3 (~> 1.6)
Expand Down
29 changes: 0 additions & 29 deletions react_on_rails/spec/dummy/bin/coveralls

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
it "adds test-related gems to Gemfile" do
assert_file("Gemfile") do |contents|
expect(contents).to match("gem \"rspec-rails\", group: :test")
expect(contents).to match("gem \"coveralls\", require: false")
expect(contents).to match("gem \"simplecov\", require: false, group: :test")
# chromedriver-helper was removed as it's deprecated since 2019
# Modern selenium-webdriver (4.x) handles driver management automatically
end
Expand Down
2 changes: 1 addition & 1 deletion react_on_rails_pro/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ bundle exec rspec

If you run `rspec` at the top level, you'll see this message: `require': cannot load such file -- rails_helper (LoadError)`

After running a test, you can view the coverage results in SimpleCov reports by opening `coverage/index.html`.
If you run tests with `COVERAGE=true`, you can view the SimpleCov report at `coverage/index.html`.

### Debugging

Expand Down
26 changes: 13 additions & 13 deletions react_on_rails_pro/Gemfile.development_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,33 @@ gem "amazing_print"

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console'
gem 'listen'
gem "web-console"
gem "listen"
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen'
gem "spring"
gem "spring-watcher-listen"
end

group :development, :test do
gem 'faker'
gem 'graphiql-rails'
gem 'pry', '>= 0.14.1' # Console with powerful introspection capabilities
gem "faker"
gem "graphiql-rails"
gem "pry", ">= 0.14.1" # Console with powerful introspection capabilities
# Need to use master of pry-byebug to use latest pry version
# Loaded manually in spec_helper.rb so specs can boot on readline-less Ruby builds.
gem 'pry-byebug', github: 'shakacode/pry-byebug', require: false # Integrates pry with byebug
gem 'pry-doc' # Provide MRI Core documentation
gem 'pry-rails' # Causes rails console to open pry. `DISABLE_PRY_RAILS=1 rails c` can still open with IRB
gem 'pry-theme' # An easy way to customize Pry colors via theme files
gem "pry-byebug", github: "shakacode/pry-byebug", require: false # Integrates pry with byebug
gem "pry-doc" # Provide MRI Core documentation
gem "pry-rails" # Causes rails console to open pry. `DISABLE_PRY_RAILS=1 rails c` can still open with IRB
gem "pry-theme" # An easy way to customize Pry colors via theme files

gem "rbs", require: false
gem "scss_lint", require: false
gem 'fakefs', require: 'fakefs/safe'
gem "fakefs", require: "fakefs/safe"
end

group :test do
gem "capybara", ">= 3.38.0"
gem "capybara-screenshot"
gem "coveralls", require: false
gem "simplecov", "~> 0.16.1", require: false
gem "equivalent-xml"
gem "generator_spec"
gem "launchy"
Expand Down
14 changes: 1 addition & 13 deletions react_on_rails_pro/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ GEM
fiber-annotation
fiber-local (~> 1.1)
json
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
crack (1.0.0)
bigdecimal
rexml
Expand Down Expand Up @@ -436,15 +430,9 @@ GEM
sqlite3 (2.9.2-x86_64-darwin)
sqlite3 (2.9.2-x86_64-linux-gnu)
stringio (3.2.0)
sync (0.5.0)
term-ansicolor (1.11.3)
tins (~> 1)
thor (1.5.0)
tilt (2.4.0)
timeout (0.4.4)
tins (1.33.0)
bigdecimal
sync
traces (0.18.2)
tsort (0.2.0)
turbolinks (5.2.1)
Expand Down Expand Up @@ -492,7 +480,6 @@ DEPENDENCIES
capybara (>= 3.38.0)
capybara-screenshot
commonmarker
coveralls
equivalent-xml
fakefs
faker
Expand Down Expand Up @@ -527,6 +514,7 @@ DEPENDENCIES
scss_lint
selenium-webdriver (= 4.9.0)
shakapacker (= 9.6.1)
simplecov (~> 0.16.1)
spring
spring-watcher-listen
sprockets
Expand Down
5 changes: 0 additions & 5 deletions react_on_rails_pro/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
# Rake will automatically load any *.rake files inside of the "rakelib" folder
# See rakelib/
tasks = %w[run_rspec lint]
if ENV["USE_COVERALLS"] == "TRUE"
require "coveralls/rake/task"
Coveralls::RakeTask.new
tasks << "coveralls:push"
end

desc "Run all tests and linting"
task default: tasks
12 changes: 6 additions & 6 deletions react_on_rails_pro/rakelib/run_rspec.rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

# TODO: This file is not used for CI
require "coveralls/rake/task" if ENV["USE_COVERALLS"] == "TRUE"

require "pathname"
Comment thread
justin808 marked this conversation as resolved.
require "active_support/core_ext/string"
Expand All @@ -23,13 +22,15 @@ namespace :run_rspec do
run_tests_in(spec_dummy_dir)
end

desc "(HACK) Run RSpec on spec/empty_spec in order to have SimpleCov generate a coverage report from cache"
desc "(HACK) Run RSpec on spec/empty_spec.rb — set COVERAGE=true to generate a SimpleCov report from cache"
task :empty do
sh %(#{ENV['USE_COVERALLS'] ? 'COVERAGE=true' : ''} rspec spec/empty_spec.rb)
if ENV["COVERAGE"] == "true"
sh "bundle exec rspec spec/empty_spec.rb"
else
puts "Skipping run_rspec:empty (set COVERAGE=true to generate a SimpleCov report from cache)"
end
end

Coveralls::RakeTask.new if ENV["USE_COVERALLS"] == "TRUE"

desc "run all tests"
task run_rspec: %i[gem dummy empty js_tests] do
puts "Completed all RSpec tests"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement — the task now skips cleanly instead of running a no-op spec. One edge case: spec/empty_spec.rb itself does an unconditional require "simplecov" (no COVERAGE guard), so if a developer runs rspec spec/empty_spec.rb directly without COVERAGE=true, SimpleCov will still be loaded and may emit output. The task-level guard here is correct, but adding a matching guard in spec/empty_spec.rb would make direct invocations consistent too.

Expand Down Expand Up @@ -71,7 +72,6 @@ def run_tests_in(dir, options = {})
command_name = options.fetch(:command_name, path.basename)
rspec_args = options.fetch(:rspec_args, "")
env_vars = +"#{options.fetch(:env_vars, '')} TEST_ENV_COMMAND_NAME=\"#{command_name}\""
env_vars << "COVERAGE=true" if ENV["USE_COVERALLS"]
sh_in_dir(path.realpath, "#{env_vars} bundle exec rspec #{rspec_args}")
end

Expand Down
Loading
Loading