Fix incorrect defer_generated_component_packs = false migration guidance - #4451
Conversation
The 17.0.0 migration docs for the removed config.defer_generated_component_packs option told upgraders that `= false` maps to `generated_component_packs_loading_strategy = :sync`. That is wrong. The removed shim was truthy-gated: only `= true` did anything (it set `generated_component_packs_loading_strategy ||= :defer`). `= false` was a no-op that fell through to the default loading strategy. So `false` never meant `:sync`. Telling upgraders to set `:sync` forces synchronous (blocking) pack loading -- a performance regression for most apps. Correct guidance: replace `= true` with `:defer` (unchanged), and simply delete `= false`. The default strategy then applies: `:async` for Pro or `:defer` for non-Pro on Shakapacker 8.2.0+, and `:sync` on older Shakapacker (per Configuration#validate_generated_component_packs_loading_strategy). Set `:sync` explicitly only if you specifically relied on synchronous loading. Also corrected the inaccurate "otherwise :defer" fallback phrasing to match the real default. Files fixed: - CHANGELOG.md (#4419/#4432 entry) - docs/oss/upgrading/upgrading-react-on-rails.md - docs/oss/configuration/configuration-deprecated.md - docs/oss/configuration/README.md - llms-full.txt (regenerated) Also removed a now-dead require_relative of react_on_rails/utils from rakelib/example_type.rb; #4418 relocated rails_version_less_than into a local Rake-only helper, and the file no longer references ReactOnRails::Utils (only a comment mentions it). Follow-up to #4432 / #4419; found by post-merge audit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
WalkthroughDocumentation-only changes correct migration guidance for the removed ChangesDeprecation migration doc corrections
Rakelib Require Change
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR corrects migration docs for the removed generated component pack defer option. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "Fix incorrect defer_generated_component_..." | Re-trigger Greptile |
ReviewThis is a well-scoped documentation-accuracy fix. It corrects four current-version docs ( Finding
Minor / optional
No security or performance concerns — this is docs-only plus a dead-code removal. |
…w-boundary * origin/main: (26 commits) [Pro] Extract async props settled chunk writer (#4448) Fix incorrect defer_generated_component_packs = false migration guidance (#4451) Fix Pro renderer transport memory and reuse (#4394) Fix Pro RSC loadable stats retry visibility (#4447) Unify Pro component cache fetch behavior (#4384) Replace chalk with picocolors in create-react-on-rails-app (#4411) (#4444) Fix Pro RSC stylesheet stats retry after read failures (#4401) [Pro] Reduce tag-index cache work during streaming (#4443) Warn on truncated Pro RSC parser streams (#4392) Report response-start send rejections (#4389) Add cached static RSC helper and diagnostics (#4386) Fix Pro tag revalidation retry after delete failures (#4375) Fix node renderer graceful shutdown restarts (#4400) Improve release-finish dry-run fetch handling (#4441) Flush RSC payloads before incomplete HTML tails (#4379) Handle sync RSC route failures as fetch errors (#4393) Delete never-wired RenderRequest/JsCodeBuilder/RenderingStrategy layer (#4414) (#4437) Delegate deprecated base/ shims to capabilities/ instead of cloning (#4413) (#4436) Remove pre-monorepo node-renderer devDep baggage; consolidate test multipart builders (#4435) Preserve streaming LoadError during dependency failures (#4388) ... # Conflicts: # CHANGELOG.md # packages/react-on-rails-pro/src/RSCProvider.tsx # packages/react-on-rails-pro/src/RSCRoute.tsx # packages/react-on-rails-pro/tests/boundedCacheProvider.client.test.tsx # packages/react-on-rails-pro/tests/getReactServerComponent.client.test.ts
* origin/main: Fix Claude OAuth token env for Actions (#4469) Tighten hosted CI workflow safeguards (#4390) Docs: add Rails-owned mutation recipes (#4463) Docs: add migration sizing rubrics (#4462) Docs: add Pro RSC changelog coverage (#4461) Funnel sync RSC route failures through RSCRouteErrorBoundary (#4438) Fix getStore optional lookup with no hydrated stores (#4457) [Pro] Extract async props settled chunk writer (#4448) Fix incorrect defer_generated_component_packs = false migration guidance (#4451) Fix Pro renderer transport memory and reuse (#4394) # Conflicts: # packages/react-on-rails-pro/src/getReactServerComponent.client.ts
Summary
Follow-up to #4432 / #4419; found by post-merge audit.
The 17.0.0 migration guidance for the removed
config.defer_generated_component_packsoption was wrong in several docs. It told upgraders:That mapping is incorrect and causes a performance regression if followed.
The defect
The removed shim was truthy-gated. In the old
Configuration#validate_generated_component_packs_loading_strategy:Only
= truedid anything (it set:defer).= falsewas a no-op — the whole block was skipped and the strategy fell through to the default. Sofalsenever meant:sync. Telling upgraders to set:syncforces synchronous (blocking) pack loading, which is slower than the default for most apps.Correct behavior (verified against
configuration.rbonmain)validate_generated_component_packs_loading_strategysets the default when no strategy is configured:PackerUtils.supports_async_loading?)::asyncfor Pro users,:deferfor non-Pro.nil)::sync.So the correct migration for
defer_generated_component_packs = falseis: just delete the line — the default loading strategy applies. Set:syncexplicitly only if you specifically relied on synchronous loading. (= true → :deferremains correct and is unchanged.)I also corrected the inaccurate "otherwise
:defer" fallback phrasing so it matches the real default logic above.Files fixed (source docs)
CHANGELOG.md— the [Core] Drop deprecation-tombstone config attrs (generated_assets_dirs, skip_display_none, defer_generated_component_packs) during the 17.0.0 RC window #4419/Drop deprecation-tombstone config options for 17.0.0 (#4419) #4432 entry.docs/oss/upgrading/upgrading-react-on-rails.mddocs/oss/configuration/configuration-deprecated.mddocs/oss/configuration/README.mdllms-full.txt— regenerated vianode script/generate-llms-full.mjs(not hand-edited).Out of scope (left unchanged): the frozen v16-era historical records that carry the same phrasing for the original deprecation —
CHANGELOG.md:1107anddocs/oss/upgrading/release-notes/16.0.0.md:93. These document a shipped past release's deprecation notice, not the #4419/#4432 removal, so I left them to avoid rewriting release history.Additional cleanup (approved in the same PR)
react_on_rails/rakelib/example_type.rb: removed the now-deadrequire_relativeof.../react_on_rails/utils. #4418 relocatedrails_version_less_thaninto a local Rake-only helper in this file, and the only remainingUtilsreference is a comment — no functionalReactOnRails::Utils.call remains.Codex Decision Log
validate_generated_component_packs_loading_strategyonmainand traced the removed shim in git history (if defer_generated_component_packs…||= :defer) to confirm the truthy gate before wording anything.false → delete the line, not→ :sync. The no-op semantics mean deleting preserves prior behavior; forcing:syncwould be a regression.:asyncfor Pro when Shakapacker supports it, otherwise:defer" to the accurate three-case default (:asyncPro /:defernon-Pro on Shakapacker 8.2.0+,:syncon older).llms-full-pro.txtdrift (aboutcached_static_rsc_component) that the generator surfaced but which is unrelated to this fix. Left frozen v16 historical release notes untouched.Utilsappears only in a comment) before removing.Validation
node script/generate-llms-full.mjs --validate→ exit0.grep -n "defer_generated_component_packs = false" llms-full.txt→ corrected guidance ("delete the line", no blanket→ :sync).false → :syncin any current-version source doc.bundle exec rubocop rakelib/example_type.rb→ no offenses.Confidence note
High confidence. The fix is documentation-only plus one dead-require removal, verified against the authoritative source (
configuration.rb) and git history. No runtime behavior changes.llms-fullvalidate passes and the diff is scoped to the intended files.🤖 Generated with Claude Code
Summary by CodeRabbit
defer_generated_component_packssettings.