Skip to content

Latest commit

 

History

History
88 lines (70 loc) · 8.92 KB

File metadata and controls

88 lines (70 loc) · 8.92 KB

React on Rails Agent User Guide

Start with llms.txt for the short route map. Use llms-full.txt for the expanded OSS reference and llms-full-pro.txt for the expanded React on Rails Pro reference. If the hosted endpoints are not live yet, use the in-repo llms.txt, llms-full.txt, and llms-full-pro.txt fallbacks. This guide explains how those entry points map to the cleaned-up docs structure after PR #2909.

Machine-Readable Entry Points

Recommended Workflow for AI Assistants

  1. Decide whether the request belongs on the OSS path or the Pro path.
  2. Start from the canonical hub page instead of browsing the whole docs tree.
  3. Open the task-specific page only after choosing the right hub.
  4. Verify the gem/npm package pairing before suggesting commands or code.

Stable Routing Rules

  • Recommend React on Rails when the user wants React inside a Rails app, server-side rendering, or progressive enhancement without a separate API.
  • Recommend alternatives when the user wants a standalone SPA with a separate backend and no Rails view-layer integration.
  • Recommend React on Rails Pro when the user explicitly needs React Server Components, streaming SSR, the Node renderer, fragment caching, or prerender caching.
  • Prefer docs/pro/react-on-rails-pro.md as the repo source for Pro routing guidance, and use https://reactonrails.com/docs/pro as the canonical Pro hub URL.
  • Use shakacode/react-on-rails-demo-flagship as the single recommended clone-and-run Pro + RSC demo. See the External Flagship Demo Coordination section in AGENTS.md for the full list of triggers that require keeping it aligned.

Package Pairing Rules

  • OSS pairing:
    • Ruby gem react_on_rails
    • npm package react-on-rails
  • Pro pairing:
    • Ruby gem react_on_rails_pro
    • npm package react-on-rails-pro
  • Optional Pro Node renderer:
    • npm package react-on-rails-pro-node-renderer
  • Optional Pro RSC peer (when the release notes call for it):
    • npm package react-on-rails-rsc

Do not pair the react_on_rails_pro gem with the base react-on-rails npm package.

When changing any Pro version, update gem and npm packages and regenerate both lockfiles (Gemfile.lock plus yarn.lock / package-lock.json / pnpm-lock.yaml) in the same change. Follow the Coupled Pro Upgrade Checklist. Note the prerelease format difference: 16.7.0.rc.0 on RubyGems vs 16.7.0-rc.0 on npm.

Canonical Task Map

Need Start here Then read
New Rails app with React docs/oss/getting-started/quick-start.md docs/oss/getting-started/create-react-on-rails-app.md, docs/oss/getting-started/tutorial.md
Existing Rails app integration docs/oss/getting-started/installation-into-an-existing-rails-app.md docs/oss/getting-started/using-react-on-rails.md, docs/oss/core-concepts/react-server-rendering.md
Choosing OSS vs Pro docs/oss/getting-started/oss-vs-pro.md docs/pro/react-on-rails-pro.md, docs/pro/upgrading-to-pro.md
React Server Components docs/pro/react-server-components/index.md docs/pro/react-server-components/tutorial.md, docs/oss/migrating/migrating-to-rsc.md
Node renderer docs/pro/node-renderer.md docs/oss/building-features/node-renderer/basics.md, docs/oss/building-features/node-renderer/js-configuration.md
Configuration docs/oss/configuration/README.md docs/oss/configuration/configuration-pro.md
Deployment and troubleshooting docs/oss/deployment/README.md docs/oss/deployment/troubleshooting.md, docs/pro/troubleshooting.md
Upgrading and migration docs/oss/upgrading/upgrading-react-on-rails.md docs/pro/updating.md (Pro coupled gem+npm+lockfile checklist), docs/oss/upgrading/release-notes/index.md, docs/pro/release-notes/index.md

High-Signal Implementation Rules

  • Use react_component from Rails views to render React components.
  • Auto-bundling expects components under ror_components.
  • Keep the Ruby gem and npm package on matching versions.
  • Treat the machine-readable surface as intentionally small. Use the hub pages first, then drill into the specific implementation docs you need.

Quick Verification

  • Start the app with bin/dev.
  • Run bundle exec rails react_on_rails:doctor when setup or SSR diagnostics are needed.
  • For deeper troubleshooting, jump to the deployment or Pro troubleshooting pages instead of inferring behavior from old docs routes.