Migrate SERP chrome from react-rails to React on Rails#2010
Open
justin808 wants to merge 1 commit into
Open
Conversation
02cb743 to
7ceda85
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
react-railsmounts to React on Rails mountsSearchResultsLayoutwhile moving header/footer provider setup into dedicated wrapper componentsWhy this change
I maintain both
react-railsandreact_on_rails, and my recommendation for Rails apps that already use React is to move toward React on Rails as the better-supported path going forward.React on Rails is maintained alongside Shakapacker, has current documentation, and gives a clearer long-term Rails + React integration story than the older
react-rails/react_ujsmounting model.Relevant docs:
For this repository specifically, the main benefit is maintainability through better component boundaries.
Today the search results page is largely organized around one large
react_componentmount with a large Rails-built prop payload. This PR keeps the search-results body contract intact, but moves the header and footer chrome into smaller React on Rails mounts. That makes the page easier to reason about, easier to migrate incrementally, and easier to test without taking on a page-wide rewrite.This also provides a more maintainable path for future work if the project wants to continue moving away from
react-railsone boundary at a time.Scope
This PR intentionally does not rewrite the results layout or change the central prop-building flow.
It keeps the existing search-results rendering contract in place and limits the migration to low-coupling shell chrome so the change stays reviewable and low risk.
Testing
yarn test --runInBand -u app/javascript/test/SearchResultsLayout.test.tsx app/javascript/test/SearchResultsHeader.test.tsx app/javascript/test/SearchResultsFooter.test.tsxyarn test --runInBand app/javascript/test/SearchResultsLayout.test.tsx app/javascript/test/SearchResultsHeader.test.tsx app/javascript/test/SearchResultsFooter.test.tsxbundle exec rspec spec/helpers/react_helper_spec.rbwas blocked locally because MySQL was not available at127.0.0.1:3306in this environmentmain; CircleCI checks are running in the PR checks UI