Skip to content

Commit 6088576

Browse files
justin808claude
andcommitted
Address review feedback: fix PR number and add unit tests
- Fix CHANGELOG PR reference (was 2125, now correct 2136) - Add unit tests for suppress_unused_component_warnings configuration - Test default value is false - Test can be set to true - Test can be set to false explicitly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent c7af7ef commit 6088576

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Changes since the last non-beta release.
2525

2626
#### Added
2727

28-
- **Suppress Unused Component Warnings**: Added `suppress_unused_component_warnings` configuration option to disable console warnings about registered components that are not used on a page. This is useful for production environments where many components are registered globally but only a subset are used on each page. Set `config.suppress_unused_component_warnings = true` in your React on Rails initializer. Note: This only affects React on Rails Pro users. [PR 2125](https://github.com/shakacode/react_on_rails/pull/2125) by [justin808](https://github.com/justin808).
28+
- **Suppress Unused Component Warnings**: Added `suppress_unused_component_warnings` configuration option to disable console warnings about registered components that are not used on a page. This is useful for production environments where many components are registered globally but only a subset are used on each page. Set `config.suppress_unused_component_warnings = true` in your React on Rails initializer. Note: This only affects React on Rails Pro users. [PR 2136](https://github.com/shakacode/react_on_rails/pull/2136) by [justin808](https://github.com/justin808).
2929

3030
- **Service Dependency Checking for bin/dev**: Added optional `.dev-services.yml` configuration to validate required external services (Redis, PostgreSQL, Elasticsearch, etc.) are running before `bin/dev` starts the development server. Provides clear error messages with start commands and install hints when services are missing. Zero impact if not configured - backwards compatible with all existing installations. [PR 2098](https://github.com/shakacode/react_on_rails/pull/2098) by [justin808](https://github.com/justin808).
3131

react_on_rails/spec/react_on_rails/configuration_spec.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,27 @@ module ReactOnRails
506506
end
507507
end
508508

509+
describe ".suppress_unused_component_warnings" do
510+
it "defaults to false" do
511+
ReactOnRails.configure {} # rubocop:disable Lint/EmptyBlock
512+
expect(ReactOnRails.configuration.suppress_unused_component_warnings).to be(false)
513+
end
514+
515+
it "can be set to true" do
516+
ReactOnRails.configure do |config|
517+
config.suppress_unused_component_warnings = true
518+
end
519+
expect(ReactOnRails.configuration.suppress_unused_component_warnings).to be(true)
520+
end
521+
522+
it "can be set to false explicitly" do
523+
ReactOnRails.configure do |config|
524+
config.suppress_unused_component_warnings = false
525+
end
526+
expect(ReactOnRails.configuration.suppress_unused_component_warnings).to be(false)
527+
end
528+
end
529+
509530
describe "enforce_private_server_bundles validation" do
510531
context "when enforce_private_server_bundles is true" do
511532
before do

0 commit comments

Comments
 (0)