You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are two maintainability nits raised by the claude[bot] review run on PR #3219 that are documented in the relevant methods but worth cleaning up in a focused follow-up.
Discuss items
react_on_rails/lib/generators/react_on_rails/rsc_setup/client_references.rb:134 — rsc_client_references_rewrite_needed? predicate has side effects (@claude[bot], fix: scope RSC client reference discovery #3219 (comment))
The _needed? suffix advertises a pure predicate, but the method calls ensure_rsc_client_references_setup, which can write the scoped helper to disk. The behavior is documented in the method's opening comment, but a future maintainer scanning method names alone could miss it. Likely fix: split into an explicit prepare_rsc_client_references_setup step and a pure rsc_plugin_needs_client_references_rewrite? predicate, then update the single internal call site in update_existing_rsc_webpack_config.
react_on_rails/lib/generators/react_on_rails/rsc_setup/client_references.rb:152 — rsc_plugin_sections_safe_to_rewrite?is_server: kwarg is misleading (@claude[bot], fix: scope RSC client reference discovery #3219 (comment))
The kwarg is forwarded to rsc_plugin_option_sections_partition, but the :unparseable count the safety predicate gates on is computed across all RSCWebpackPlugin invocations regardless of is_server. So is_server: true and is_server: false produce the same safety verdict on the same file. Either drop the kwarg and call partition with one side, or add a one-line comment clarifying the cross-bundle scope.
Deferred review feedback from PR #3219
These are two maintainability nits raised by the
claude[bot]review run on PR #3219 that are documented in the relevant methods but worth cleaning up in a focused follow-up.Discuss items
react_on_rails/lib/generators/react_on_rails/rsc_setup/client_references.rb:134—rsc_client_references_rewrite_needed?predicate has side effects (@claude[bot], fix: scope RSC client reference discovery #3219 (comment))The
_needed?suffix advertises a pure predicate, but the method callsensure_rsc_client_references_setup, which can write the scoped helper to disk. The behavior is documented in the method's opening comment, but a future maintainer scanning method names alone could miss it. Likely fix: split into an explicitprepare_rsc_client_references_setupstep and a purersc_plugin_needs_client_references_rewrite?predicate, then update the single internal call site inupdate_existing_rsc_webpack_config.react_on_rails/lib/generators/react_on_rails/rsc_setup/client_references.rb:152—rsc_plugin_sections_safe_to_rewrite?is_server:kwarg is misleading (@claude[bot], fix: scope RSC client reference discovery #3219 (comment))The kwarg is forwarded to
rsc_plugin_option_sections_partition, but the:unparseablecount the safety predicate gates on is computed across allRSCWebpackPlugininvocations regardless ofis_server. Sois_server: trueandis_server: falseproduce the same safety verdict on the same file. Either drop the kwarg and call partition with one side, or add a one-line comment clarifying the cross-bundle scope.Original PR: #3219