Skip to content

Docs: frame Redux as legacy shared-store guidance#4278

Merged
justin808 merged 35 commits into
mainfrom
codex/redux-legacy-docs-4275
Jul 1, 2026
Merged

Docs: frame Redux as legacy shared-store guidance#4278
justin808 merged 35 commits into
mainfrom
codex/redux-legacy-docs-4275

Conversation

@justin808

@justin808 justin808 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Why

The V17 new-app path should no longer teach Redux as the normal starter architecture. Redux runtime APIs remain supported, so the docs need to preserve the legitimate shared-store guidance while steering greenfield apps toward local React state, Rails/server state, and smaller patterns first.

Closes #4275.

What changed

  • Remove greenfield react_on_rails:install --redux recommendations from generator and tutorial docs.
  • Reframe the hidden Redux generator path as legacy/recovery guidance.
  • Keep Redux runtime API docs, but label redux_store and registerStoreGenerators as legacy or advanced multi-island shared-store APIs.
  • Add explicit state-choice framing: local island state, server state, and multi-island shared client state.
  • Update adjacent getting-started, router, intro, and API docs so Redux is not presented as the default new-app path.
  • Fix the React Router docs examples so shared route trees are not auto-registered as conflicting ror_components definitions.

Validation

  • PASS: .agents/bin/agent-workflow-seam-doctor
  • PASS: .agents/skills/pr-batch/bin/pr-security-preflight --repo shakacode/react_on_rails 4275 (SECURITY_PREFLIGHT_OK)
  • PASS: node script/generate-llms-full.mjs --check
  • PASS: script/check-docs-sidebar
  • PASS: pnpm start format.listDifferent
  • PASS: PATH="/tmp/codex-lychee-0.23.0:$PATH" bin/check-links
  • PASS: git diff --check
  • PASS: pre-commit and pre-push hooks with repo-compatible lychee 0.23.0 on PATH

CI recommendation

Docs-only change. No hosted CI label recommended beyond normal markdown/docs checks.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bb7633f4-1f9c-41fe-bc7e-1b42e069f35e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Clear and specific; it matches the PR's main documentation shift from Redux defaults to legacy shared-store guidance.
Linked Issues check ✅ Passed The docs remove Redux from new-app guidance, keep legacy/runtime APIs, and separate client, server, and shared-store use cases as requested.
Out of Scope Changes check ✅ Passed The touched files all support the Redux-reframing documentation goal, with no obvious unrelated code or doc changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/redux-legacy-docs-4275

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f939b4ffe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/oss/api-reference/generator-details.md
@greptile-apps

greptile-apps Bot commented Jun 29, 2026

Copy link
Copy Markdown

Greptile Summary

This PR reframes Redux as legacy shared-store guidance in the docs. The main changes are:

  • Removed Redux from the recommended new-app install path.
  • Reworded Redux APIs as legacy or advanced shared-store APIs.
  • Added state-choice guidance for local state, server state, and multi-island shared state.
  • Updated tutorial, router, intro, and related docs to avoid presenting Redux as the default.

Confidence Score: 4/5

The docs update is mostly safe, but the generator reference needs a fix before merging.

  • The changed Redux API wording matches the inspected runtime signature.
  • The generator page now says the Redux install flag is hidden, while the CLI still shows it in install help.
  • That mismatch can confuse users and make the reference docs appear stale.

docs/oss/api-reference/generator-details.md

Important Files Changed

Filename Overview
docs/oss/api-reference/generator-details.md Reframes generator Redux guidance as legacy, but now disagrees with the actual visible install generator help.
docs/oss/api-reference/javascript-api.md Rewords store generator registration as a legacy or advanced shared-store API.
docs/oss/api-reference/redux-store-api.md Reframes the Redux store API around supported existing apps and multi-island shared-store use cases.
docs/oss/building-features/react-router.md Adds a non-Redux router setup first and moves Redux router guidance into legacy usage.
docs/oss/getting-started/tutorial.md Replaces the default Redux appendix with broader state-choice guidance.
docs/oss/core-concepts/render-functions-and-railscontext.md Clarifies render-function and shared-store parameter wording.
docs/oss/introduction.md Updates the intro and navigation language so Redux is no longer positioned as a default path.

Reviews (1): Last reviewed commit: "Docs: frame Redux as legacy shared-store..." | Re-trigger Greptile

Comment thread docs/oss/api-reference/generator-details.md Outdated

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
docs/oss/api-reference/redux-store-api.md (1)

24-24: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix hyphenation: "client-side stores" and "server-rendered".

The phrases "client side stores" and "server rendered" need hyphens when used as compound modifiers: "client-side stores" and "server-rendered". The static analysis also flags repetitive "You want to" phrasing; consider varying the sentence structure for readability.

📝 Proposed fix
-  2. You want to place the props to hydrate the client side stores at the very end of your HTML, probably server rendered, so that the browser can render all earlier HTML first. However, you're probably better off using [React on Rails Pro](../../pro/react-on-rails-pro.md) if you're at all concerned about performance.
+  2. You want to place the props to hydrate the client-side stores at the very end of your HTML, probably server-rendered, so that the browser can render all earlier HTML first. However, you're probably better off using [React on Rails Pro](../../pro/react-on-rails-pro.md) if you're at all concerned about performance.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/oss/api-reference/redux-store-api.md` at line 24, The markdown text in
the Redux store API docs has compound modifiers written without hyphens and
should be updated for readability. In the sentence describing props for
hydration, change the phrases in the prose around “client side stores” and
“server rendered” to “client-side stores” and “server-rendered,” and adjust the
repeated “You want to” phrasing in that same paragraph to a more natural
alternative while keeping the meaning intact.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/oss/api-reference/redux-store-api.md`:
- Line 24: The markdown text in the Redux store API docs has compound modifiers
written without hyphens and should be updated for readability. In the sentence
describing props for hydration, change the phrases in the prose around “client
side stores” and “server rendered” to “client-side stores” and
“server-rendered,” and adjust the repeated “You want to” phrasing in that same
paragraph to a more natural alternative while keeping the meaning intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 312f9da6-2cb7-422f-8bed-b159b99c803f

📥 Commits

Reviewing files that changed from the base of the PR and between c7b54be and 5f939b4.

📒 Files selected for processing (12)
  • docs/oss/api-reference/generator-details.md
  • docs/oss/api-reference/javascript-api.md
  • docs/oss/api-reference/redux-store-api.md
  • docs/oss/building-features/react-and-redux.md
  • docs/oss/building-features/react-router.md
  • docs/oss/core-concepts/auto-bundling-file-system-based-automated-bundle-generation.md
  • docs/oss/core-concepts/how-react-on-rails-works.md
  • docs/oss/core-concepts/render-functions-and-railscontext.md
  • docs/oss/getting-started/quick-start.md
  • docs/oss/getting-started/tutorial.md
  • docs/oss/getting-started/using-react-on-rails.md
  • docs/oss/introduction.md

@justin808 justin808 force-pushed the codex/redux-legacy-docs-4275 branch from 5f939b4 to 5bed87b Compare June 29, 2026 03:45
@justin808 justin808 changed the base branch from main to codex/v17-redux-generator-policy-4272-4273 June 29, 2026 03:45
@justin808

Copy link
Copy Markdown
Member Author

Updated after review:

  • Retargeted this docs PR to codex/v17-redux-generator-policy-4272-4273 so it is reviewed on top of Hide legacy Redux install generator path #4277, where --redux is hidden from V17 install help.
  • Fixed the CodeRabbit hyphenation wording nit in redux-store-api.md.
  • Re-ran script/check-docs-sidebar, pnpm start format.listDifferent, and bin/check-links with pinned lychee 0.23.0 matching the GitHub Actions workflow.

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

def recovery_install_command
flags = []
flags << "--typescript" if options.typescript?

P2 Badge Preserve explicit Redux installs in recovery guidance

When an explicit rails generate react_on_rails:install --redux run hits the Shakapacker/Gemfile incomplete-installation recovery paths, this command now drops --redux, so the documented rerun will go through the non-Redux branch and never invoke react_on_rails:react_with_redux. That leaves legacy/scripted users who deliberately selected the hidden escape hatch with a recovered install that does not match the originally requested scaffold; keep the warning, but preserve the flag or tell them to run the Redux generator as an additional recovery step.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@justin808 justin808 force-pushed the codex/v17-redux-generator-policy-4272-4273 branch from 209470d to ba301d9 Compare June 29, 2026 03:53
@justin808 justin808 force-pushed the codex/redux-legacy-docs-4275 branch from 5bed87b to e81cf9f Compare June 29, 2026 03:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e81cf9fbad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/oss/building-features/react-router.md
@justin808 justin808 force-pushed the codex/v17-redux-generator-policy-4272-4273 branch from ba301d9 to 55e928a Compare June 29, 2026 04:28
@justin808 justin808 force-pushed the codex/redux-legacy-docs-4275 branch from e81cf9f to e2d0a50 Compare June 29, 2026 04:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a91e70073c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/oss/api-reference/generator-details.md Outdated
@claude

claude Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review: Docs: frame Redux as legacy shared-store guidance

This PR's strategy is sound — demoting Redux from the default greenfield path while preserving it for existing apps and advanced multi-island shared-store use cases. The WARNING callouts, heading renames, and state-choice framing are well-executed. A few issues worth addressing before merge:


[MEDIUM] Both SSR examples teach manual renderToString — a non-canonical escape hatch

docs/oss/building-features/react-router.md lines 115–139 (new non-Redux section) and lines 142–181 (existing Redux section) both import renderToString from react-dom/server, call it inside the render function, and return { renderedHtml: html }.

The canonical React on Rails pattern is to return JSX from the render function and let the framework call renderToString internally. render-functions-and-railscontext.md describes render functions as "functions that take these 2 params and return a React component or a Redux Store" — not pre-rendered HTML. Returning { renderedHtml: <JSX> } (ReactElement) is the documented pattern; the string form is a supported escape hatch. Teaching the escape hatch as the primary example:

  • Bypasses the framework's rendering pipeline (blocks streaming render integration)
  • Contradicts the canonical docs
  • Requires importing an extra module when returning JSX is sufficient

The simpler canonical form:

const RouterApp = (props, railsContext) => {
  const { location } = railsContext;
  return (
    <StaticRouter location={location}>
      <Routes>
        <Route path="/" element={<Home {...props} />} />
        <Route path="/about" element={<About />} />
      </Routes>
    </StaticRouter>
  );
};

No need to import or call renderToString directly.


[LOW] railsContext.location misdescribed as "string path" (line 188)

The bullet at line 188 says:

location prop takes a string path from railsContext

But railsContext.location is path + query string (e.g., /posts?id=30), not just a bare pathname. The separate railsContext.pathname field is path-only. A developer reading "string path" might reach for pathname instead and lose query-string-sensitive routes in SSR.

Suggested fix: "location prop takes a path-plus-query-string value from railsContext (e.g., /posts?page=2)"


[LOW] Five cross-references to react-and-redux.md carry stale display text

The page was renamed to "Legacy Redux Reducer Guidance" but these links weren't updated to reflect the legacy framing:

File Line Current link text
docs/oss/getting-started/tutorial.md 316 "Redux integration guide"
docs/oss/getting-started/oss-vs-pro.md 17 "Redux store registration"
docs/oss/introduction.md 88 "Redux Integration"
docs/oss/getting-started/using-react-on-rails.md 240 "Redux Integration"
docs/oss/getting-started/quick-start.md 193 "Redux Integration"

The PR updated the surrounding descriptions of these links elsewhere but these five slipped through. tutorial.md:316 is the most misleading — it sits inside the new appendix and calls the target a forward-looking "integration guide."


[LOW] State-choice three-tier taxonomy duplicated in three places

The "local island state / server state / multi-island shared client state" bullet list appears nearly verbatim in redux-store-api.md, tutorial.md, and react-and-redux.md. If the tool recommendations evolve (e.g., TanStack Query phrasing changes), three locations need independent updates with drift risk. Consider linking to one canonical location.

Comment thread docs/oss/building-features/react-router.md Outdated
Comment thread docs/oss/getting-started/tutorial.md Outdated
@justin808

Copy link
Copy Markdown
Member Author

+ci-run-hosted

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2af48bb8cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/oss/building-features/react-router.md Outdated
@justin808 justin808 added the ready-for-hosted-ci Run optimized hosted GitHub CI for this PR label Jun 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hosted CI Requested

Triggered 9 workflow(s) for 2af48bb8cd70.
Mode: optimized hosted CI (path-selected by script/ci-changes-detector).
Added ready-for-hosted-ci, so future commits will keep running optimized hosted CI until +ci-stop-hosted is used.

View progress in the Actions tab.

@claude

claude Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Code Review: Docs — frame Redux as legacy shared-store guidance

This PR cleanly reframes Redux from a recommended starter path to a legacy/advanced option across 12 docs files. The state-choice triad (local island state → server state → multi-island shared client state) is a valuable addition. Overall the direction and execution are good; a few issues need attention before merge.


Findings (most-severe first)

1. llms-full.txt not regenerated — stale anchor link

llms-full.txt line 2647 still contains the old anchor slug #multiple-react-components-on-a-page-with-one-store from render-functions-and-railscontext.md. The source .md was correctly updated, but the generated aggregate file was not regenerated. Any LLM or tooling consuming llms-full.txt gets a broken reference.

Fix: run node script/generate-llms-full.mjs and commit the result.


2. redux-store-api.md — list parallelism broken on use-case item 2

The two-item use-case list now has mixed grammatical structure — item 1 is a qualifying conditional ("You want to have…") while item 2 was changed to an imperative ("Place the props…"), making it read like a required step rather than a second trigger scenario. Restore "You want to place the props…" on item 2.


3. redux-store-api.md — "React components" in prose after heading renamed to "React Islands"

The heading at line 26 now says "Multiple React Islands on a Page with One Store", but body prose at lines 23 and 28 still says "multiple React components". The PR updated the heading but not the surrounding prose.


4. oss-vs-pro.md — missed update, still uses neutral Redux framing

Every file touched by this PR updates Redux descriptions to "legacy or advanced shared-store" language, but docs/oss/getting-started/oss-vs-pro.md (line 17) was not included and still reads:

Redux store registration with server-side rendering support

This is the only place in the docs that describes Redux without the "legacy" qualifier, contradicting the messaging added everywhere else in this PR.


5. generator-details.md — "plain react_component entries" conflates view helper with webpack entries

The WARNING block says: "New apps should start with plain react_component entries…"

"entries" is established React on Rails / webpack / Rspack terminology for bundle entry points. A developer who has not yet read the auto-bundling docs could interpret this as "create a webpack entry for each react_component call," which is the opposite of what auto-bundling provides. Suggested replacement: "plain react_component calls" or "the react_component view helper."

Comment thread docs/oss/api-reference/redux-store-api.md Outdated
Comment thread docs/oss/api-reference/redux-store-api.md Outdated
Comment thread docs/oss/api-reference/generator-details.md Outdated
@claude

claude Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review: Docs: frame Redux as legacy shared-store guidance

The PR cleanly reframes Redux as a legacy/advanced option throughout the docs, adds explicit state-choice guidance (local state → server state → multi-island shared store), and adds a non-Redux React Router example. The messaging is consistent and well-reasoned. Two actionable issues found.


Finding 1 — llms-full.txt not regenerated after heading renames (must fix)

Two section headings were renamed in this PR:

  • ## Appendix: Redux Integration## Appendix: Redux and State Choices (tutorial.md)
  • ## Multiple React Components on a Page with One Store## Multiple React Islands on a Page with One Store (redux-store-api.md)

llms-full.txt is a generated file (header: "GENERATED FILE — DO NOT EDIT DIRECTLY. Regenerate with: node script/generate-llms-full.mjs") that concatenates the source docs. It was not regenerated in this PR, leaving three stale anchor links:

llms-full.txt line Stale anchor Correct anchor
865 #appendix-redux-integration #appendix-redux-and-state-choices
879 #appendix-redux-integration #appendix-redux-and-state-choices
2647 redux-store-api.md#multiple-react-components-on-a-page-with-one-store redux-store-api.md#multiple-react-islands-on-a-page-with-one-store

Fix: run node script/generate-llms-full.mjs and commit the updated file.


Finding 2 — New server SSR example has incompatible client/server signatures with no explanation (should fix)

The new Basic Router examples use the .client.jsx / .server.jsx auto-bundling convention, but never say so. This creates a silent trap:

  • RouterApp.client.jsx exports a plain React component: (props) => JSX
  • RouterApp.server.jsx exports a React on Rails render-function: (props, railsContext) => () => JSX

These two signatures are intentionally different and work correctly only when auto-bundling is active (requires config.components_subdirectory set and nested_entries: true in shakapacker). Without auto-bundling, a developer who calls ReactOnRails.register({ RouterApp }) with one file will silently break the other: registering the client file on the server means railsContext is undefined, and const { location } = railsContext (line 124) throws TypeError: Cannot destructure property 'location' of undefined, producing a blank SSR page.

The auto-bundling docs fully document the convention, but react-router.md does not link to them or warn that the .client.jsx / .server.jsx split is a prerequisite, not just a naming convention.

Suggested fix: add a brief note before the server example (line 113) such as:

Note: The .client.jsx / .server.jsx suffix split relies on React on Rails auto-bundling (config.components_subdirectory). Without auto-bundling, you need separate ReactOnRails.register() calls for the client and server entry points, or a single render-function that conditionally uses StaticRouter vs BrowserRouter. See the auto-bundling guide.

Comment thread docs/oss/building-features/react-router.md
Comment thread docs/oss/building-features/react-router.md
@claude

claude Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Code Review

This PR does a clean job of reframing Redux as a legacy/advanced path across the docs: renamed headings, updated anchors, new state-choice decision matrix, and re-labelled sections are all consistent. The cross-reference audit confirms the major anchors resolve correctly (#multiple-react-islands-on-a-page-with-one-store, #legacy-redux-structure-hidden---redux-path, #appendix-redux-and-state-choices). The combineReducers change in react-and-redux.md is also a genuine correctness fix — the old plain-object export was not a valid Redux reducer.

Four issues found, all in the newly added content.


1. Misleading link in redux-store-api.md [!IMPORTANT] note — docs/oss/api-reference/redux-store-api.md line 9

The note warns that Redux inline-script registration breaks with async: true — a generic script-ordering hazard. The replacement link turbolinks.md#async-script-loading points into the "Legacy Turbolinks Support" subsection; its content is about Turbolinks 5 navigation events (turbolinks:load firing timing), not the async/defer ordering concern for Redux component registration. Rails 7+ Turbo users following this link find Turbolinks-specific event handler guidance that doesn't apply to them. Either drop the Turbolinks link (the auto-bundling link is the more relevant one here) or replace it with a link that covers the async/defer race for inline-script registration directly.


2. react_component_hash warning missing from non-Redux SSR example — docs/oss/building-features/react-router.md ~lines 128–158

The "Basic Server-Side Rendering with React Router" section introduces the render-function thunk pattern (return (_props) => (...)) for the non-Redux case. An identical warning about react_component_hash incompatibility appears only in the "Important changes from React Router v5" bullet list closing the Legacy Redux section (lines 205–208). A developer using the greenfield non-Redux path will never see it but is equally exposed to the same issue.


3. --tailwind incompatibility not documented for react_with_redux generator — docs/oss/api-reference/generator-details.md ~line 119

The new section documents rails generate react_on_rails:react_with_redux and notes that --typescript is supported. The generator source (react_on_rails/lib/generators/react_on_rails/react_with_redux_generator.rb) explicitly raises Thor::Error when --tailwind is passed — with a recovery message pointing back to the full installer. This incompatibility is not mentioned in the docs, so a Tailwind user hits a confusing runtime error with no in-docs guidance.


4. Misleading inline comment in RouterApp.server.jsx example — docs/oss/building-features/react-router.md lines 147–149

The comment says "Props are passed again by React, but this example uses the props and location captured by closure." This is inaccurate: React on Rails calls createElement(returnedFn, props) (in createReactOutput.ts) before passing the element to renderToString — it is React on Rails, not React itself, that re-injects the original props. The inner _props parameter (underscore prefix signals intentionally unused) never influences SSR output. The comment implies React's own reconciler independently re-delivers props, which could confuse developers debugging SSR prop flow. The comment should be simplified or replaced with an explanation of why _props is discarded.

Comment thread docs/oss/api-reference/redux-store-api.md Outdated
Comment thread docs/oss/api-reference/generator-details.md
Comment thread docs/oss/building-features/react-router.md
Comment thread docs/oss/building-features/react-router.md Outdated
@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review: Docs — frame Redux as legacy shared-store guidance

Overall this is a well-structured docs-only PR with clear intent and good execution. A few specific observations below.

What's working well

combineReducers fix in react-and-redux.md: The reducer example previously exported a plain object (export default { $$usersStore: reducer, ... }), which would throw at runtime because Redux's createStore expects a reducer function, not an object. The PR correctly wraps it with combineReducers. This is a real correctness fix disguised as a docs update.

Server-side render thunk pattern: Changing the legacy Redux SSR example from manual renderToString + { renderedHtml: html } to the render-function thunk pattern is the right move — it's how React on Rails is meant to be used with react_component, and the caveat about react_component_hash still needing the explicit return shape is correctly called out.

Link repair in redux-store-api.md: The old streaming-server-rendering.md#important-redux-shared-store-caveat anchor no longer exists in that file. The replacement link (auto-bundling-...#layout-integration-with-auto-loading) resolves correctly — confirmed the heading exists.

StoreGenerator JSDoc correction in types/index.ts: The type is defined as (props, railsContext) => Store, but the old JSDoc said "take one arg, props". The updated wording ("receive props and railsContext") now matches the actual signature.

Minor issues (inline comments follow)

  1. The comment inside the RouterApp.server.jsx code example uses the phrase "calls createElement(returnedFn, props)" which is technically correct but sounds like React API internals — readers unfamiliar with how React on Rails dispatches render functions may find it confusing.

  2. The render-functions.md link in the react_component_hash note (at two places) is valid — the file exists at docs/oss/core-concepts/render-functions.md.

No concerns on

  • Anchor/heading renames (internal cross-references updated consistently).
  • llms-full.txt in sync with doc sources.
  • The new non-Redux RouterRoutes + RouterApp.client.jsx example correctly avoids placing the shared route tree in ror_components/, which resolves the duplicate registration issue described in the PR.

Comment thread docs/oss/building-features/react-router.md
Comment thread docs/oss/building-features/react-and-redux.md
…-4272-4273' into codex/redux-legacy-docs-4275

* origin/codex/v17-redux-generator-policy-4272-4273:
  Fail fast for RSC on Rspack v1 (#4289)
  [codex] Document agent workflow trust boundary (#4288)
Comment on lines +502 to +505
/**
* Allows registration of store generators to be used by multiple React components on one Rails
* view. Store generators are functions that take one arg, props, and return a store. Note that
* the `setStore` API is different in that it's the actual store hydrated with props.
* view. Store generators receive props and railsContext, then return a store. Note that the
* `setStore` API is different in that it's the actual store hydrated with props.

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.

The registerStoreGenerators JSDoc here was tightened (props + railsContext) but not given the "legacy / advanced shared-store" framing that this PR applies everywhere else. Compare with the markdown copy in docs/oss/api-reference/javascript-api.md (lines 50-57 in this diff), which now reads:

Allows registration of store generators for legacy or advanced pages where multiple React roots on one Rails view share a Redux store...

vs. this JSDoc, which still says:

Allows registration of store generators to be used by multiple React components on one Rails view...

javascript-api.md itself states "The best source of docs is the interface ReactOnRails in types/index.ts" — so a developer following that pointer (or just reading IDE tooltips, which surface this JSDoc directly) lands on the old, non-legacy framing while the website doc says the opposite. Given the PR's whole purpose is consistently reframing Redux as legacy/advanced, this source-of-truth comment looks like a miss rather than an intentional choice.

@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review

This PR reframes Redux as a legacy/advanced shared-store pattern across the docs (generator help text, tutorial, API reference, React Router guide, llms-full.txt), removes greenfield --redux recommendations, and adds a non-Redux React Router example so shared route trees aren't mis-registered as ror_components.

I traced every changed/added link anchor, verified the react_with_redux generator and --redux --tailwind combination claims against the actual generator source (all confirmed accurate), and checked the new render-function code samples (RouterApp.server.jsx, the rewritten HelloWorldApp.server.jsx) against createReactOutput.ts — the "render function returns a component, which gets createElement(returnedFn, props)'d" mechanism described in the new comments is accurate to the actual implementation. Docs-only scope, so no security/performance concerns.

One inconsistency survived verification (left as an inline comment):

  • packages/react-on-rails/src/types/index.ts:502-505 — The registerStoreGenerators JSDoc was updated for accuracy (props + railsContext) but not given the "legacy/advanced shared-store" framing the PR applies everywhere else. The markdown mirror in docs/oss/api-reference/javascript-api.md was updated with that framing, and that same markdown file tells readers "the best source of docs is the interface ReactOnRails in types/index.ts" — so IDE tooltips and that pointer now disagree with the website docs on whether this API is legacy/advanced-only.

Everything else (cross-file anchor links, the new RouterRoutes.jsx / ror_components separation, the generator help-text and --redux/--tailwind claims) checked out.

…-4272-4273' into codex/redux-legacy-docs-4275

* origin/codex/v17-redux-generator-policy-4272-4273:
  Preserve TypeScript in legacy Redux fallback warning
@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review: Docs: frame Redux as legacy shared-store guidance

Scope: Pure docs/comment changes (14 files, no runtime logic). The PR reframes Redux as a legacy/advanced-use API across the generator, tutorial, getting-started, and API-reference docs, and fixes the React Router examples so a shared route tree isn't auto-registered as a conflicting ror_components entry.

Verification performed: Cross-checked the technical claims in the new prose against the actual implementation rather than taking them at face value:

  • --redux/-R is indeed hide: true in install_generator.rb, so its disappearance from the --help text block in generator-details.md matches real CLI output.
  • react_on_rails:react_with_redux exists, is hidden (hide_namespace), and its documented --tailwind restriction ("does not support --tailwind" → use install --redux --tailwind) matches validate_standalone_tailwind / unsupported_standalone_tailwind? verbatim, including the recovery command.
  • StoreGenerator type is (props, railsContext) => Store, matching the updated JSDoc in types/index.ts and javascript-api.md.
  • The new React Router SSR example (returning (_props) => <StaticRouter>... instead of calling renderToString manually) matches createReactOutput.ts / serverRenderReactComponent.ts: a render-function returning a component is wrapped via createElement and renderToString'd automatically, while the react_component_hash exception (object return shape) is correctly called out per isServerRenderHash.
  • The updated react-and-redux.md reducer example (combineReducers + export default rootReducer) matches the current generator template (helloWorldReducer.js), which already uses that pattern.
  • Spot-checked new/changed anchor links (#legacy-redux-structure-hidden---redux-path, #layout-integration-with-auto-loading, #redux-toolkit, #multiple-react-islands-on-a-page-with-one-store, #appendix-redux-and-state-choices) against the actual heading slugs — all resolve.
  • llms-full.txt changes are a 1:1 mirror of the source doc edits (consistent with the PR's generate-llms-full.mjs --check pass).
  • Per .claude/docs/changelog-guidelines.md, documentation-only changes are explicitly excluded from CHANGELOG.md, so no entry is required here.

Findings: None survived verification — no inline comments posted. This PR is unusually well fact-checked against the underlying code (the base branch already shipped the generator behavior this PR documents), and I couldn't find a factual inaccuracy, broken link, or inconsistent example.

@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Code Review

Scope: Docs-only PR (13 markdown/text files + llms-full.txt regeneration + one JSDoc comment in packages/react-on-rails/src/types/index.ts). Reframes Redux as legacy/advanced-only guidance, fixes the React Router SSR/CSR examples to use the correct render-function pattern, and adds a basic (non-Redux) React Router example.

Review approach: Read every changed hunk, then cross-checked the technical claims against the actual generator/runtime code and the render-function contract, specifically:

  • --redux/-R is genuinely hidden (hide: true in install_generator.rb) and react_on_rails:react_with_redux exists with the documented --typescript/no---tailwind-standalone behavior (verified validate_standalone_tailwind only fires when not invoked_by_install) — matches the new doc notes exactly.
  • The rewritten RouterApp.server.jsx / HelloWorldApp.server.jsx examples now return (props, railsContext) => (_props) => (...), which matches the documented render-function contract in render-functions-and-railscontext.md and the real dummy-app source (spec/dummy/client/app/startup/RouterApp.server.tsx) — this is a correctness fix over the old renderToString + { renderedHtml } example, which didn't match the .client.jsx/.server.jsx auto-bundling split it was paired with.
  • The combineReducers fix in react-and-redux.md corrects a previously-invalid "plain object as root reducer" example.
  • Checked every renamed/moved heading's generated anchor against its inbound links (#legacy-redux-structure-hidden---redux-path, #multiple-react-islands-on-a-page-with-one-store, #layout-integration-with-auto-loading, #appendix-redux-and-state-choices, #redux-toolkit, etc.) — all resolve correctly, and llms-full.txt was regenerated in lockstep with the source docs.
  • Grepped the full docs/ tree for stale references to old anchors/headings/section titles this PR renamed — none found.
  • Per .claude/docs/changelog-guidelines.md, doc-only changes are explicitly excluded from CHANGELOG.md, so omitting an entry is correct.

Findings: None survived verification. This is a clean, well-cross-checked documentation change — no correctness, security, or performance concerns.

Base automatically changed from codex/v17-redux-generator-policy-4272-4273 to main July 1, 2026 06:41
@justin808 justin808 added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit 3acb03b Jul 1, 2026
47 checks passed
@justin808 justin808 deleted the codex/redux-legacy-docs-4275 branch July 1, 2026 06:46
justin808 added a commit that referenced this pull request Jul 1, 2026
…st-surface-4274

* origin/main:
  Docs: frame Redux as legacy shared-store guidance (#4278)
  Hide legacy Redux install generator path (#4277)
  Add typed Rails action helper (#4260)
  Add Rails response type generation (#4259)
  Remove stale Pro RSpec encoding workaround (#4291)
  [Pro] Fix Gemfile loader source encoding under C locale (#4281)

# Conflicts:
#	react_on_rails/spec/react_on_rails/generators/install_generator_spec.rb
justin808 added a commit that referenced this pull request Jul 1, 2026
…ered-rsc-rendering

* origin/main:
  Adopt agent-workflow binstubs (.agents/bin/ + AGENTS.md pointer) (#4264)
  [codex] Wire release harnesses into CI (#4266)
  Document bounded coordination audit fallback (#4283)
  Docs: frame Redux as legacy shared-store guidance (#4278)
  Hide legacy Redux install generator path (#4277)
  Add typed Rails action helper (#4260)
  Add Rails response type generation (#4259)
  Remove stale Pro RSpec encoding workaround (#4291)
  [Pro] Fix Gemfile loader source encoding under C locale (#4281)
  Fail fast for RSC on Rspack v1 (#4289)
  [codex] Document agent workflow trust boundary (#4288)
  Fix precompile hook forcing UTF-8 onto non-UTF-8 (national) locales (#4244)
  Regenerate Pro llms bundle (#4280)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-hosted-ci Run optimized hosted GitHub CI for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-up: reframe Redux docs as legacy shared-store guidance

1 participant