-
-
Notifications
You must be signed in to change notification settings - Fork 639
Closed
Description
Overview
Move React on Rails Pro-specific utilities, configurations, and helper methods from the open-source React on Rails gem to the Pro gem. This improves code separation, reduces open-source gem size, and clarifies the distinction between open-source and Pro features.
Key Principle
Keep immediate_hydration in open-source - This Pro feature will remain in the open-source gem with a marketing badge to encourage Pro adoption.
What Moves to Pro Gem
Configuration Options
rsc_bundle_js_file- RSC bundle path (Pro-only feature)react_server_client_manifest_file- Server manifest for RSCreact_client_manifest_file- Client manifest for RSC
Helper Methods
stream_react_component- Streaming SSR helper (Pro-only)rsc_payload_react_component- RSC payload helper (Pro-only)- All internal streaming methods (
internal_stream_react_component,internal_rsc_payload_react_component,run_stream_inside_fiber, etc.)
Render Options
:html_streamingrender mode:rsc_payload_streamingrender moderaise_non_shell_server_rendering_errorsoption- Streaming-related methods (
streaming?,html_streaming?,rsc_payload_streaming?)
Utilities
rsc_support_enabled?- RSC detectionrsc_bundle_js_file_path- RSC bundle path resolutionreact_server_client_manifest_file_path- Manifest path resolution- RSC pack generation logic (
client_entrypoint?detection,registerServerComponentlogic)
What Stays in Open-Source
Marketing/Trial Features
immediate_hydrationconfig - Shows Pro marketing badge when used without licenseProHelpermodule - Generates Pro warning badgesProUtilsmodule - Pro feature detection
Core Infrastructure (Used by Open-Source SSR)
server_bundle_output_path- Used by standard server renderingenforce_private_server_bundles- Security feature for all server bundlescomponent_registry_timeout- Used by core features
Core Functionality
react_component,react_component_hash- Core view helpers- Standard render modes (
:server,:client) - Pro detection utilities (
react_on_rails_pro?,react_on_rails_pro_version) - Server rendering pool delegation logic
Implementation Strategy
Approach: Complete Removal (Option A)
- Remove Pro-specific code from open-source completely
- Pro gem implements all streaming/RSC features
- Clean separation, no code duplication
- Helpful error messages when Pro features used without license
Phase-by-Phase Implementation (11 Phases)
- Update Documentation & CHANGELOG
- Move RSC Configuration Options to Pro Gem
- Move RSC Utility Methods to Pro Gem
- Move Streaming Helper Methods to Pro Gem
- Move Internal Streaming Methods to Pro Gem
- Move Streaming Render Modes & Options to Pro Gem
- Move RSC Pack Generation Logic to Pro Gem
- Update Doctor Diagnostics
- Update Generator Templates
- Update Both Dummy Apps (spec/dummy & react_on_rails_pro/spec/dummy)
- Final Cleanup & Verification
Each phase averages ~60 lines of changes for easy review and maintains a working state.
Breaking Changes
For Pro Users
Pro users will need to update their configuration during upgrade:
Before:
ReactOnRails.configure do |config|
config.rsc_bundle_js_file = "rsc-bundle.js"
config.react_server_client_manifest_file = "server-manifest.json"
endAfter:
ReactOnRailsPro.configure do |config|
config.rsc_bundle_js_file = "rsc-bundle.js"
config.react_server_client_manifest_file = "server-manifest.json"
endFor Open-Source Users
- No breaking changes for standard SSR features
- Attempting to use Pro features without license will show clear error messages directing to Pro
Benefits
- ✅ Clearer separation - Pro features clearly distinguished from open-source
- ✅ Smaller open-source gem - ~600 lines of Pro-specific code removed
- ✅ Better marketing -
immediate_hydrationremains as trial feature with badge - ✅ Maintained security - Server bundle security configs stay in open-source (used by all)
- ✅ Clear errors - Helpful messages when Pro features used without license
- ✅ No code duplication - Single source of truth for each feature
Testing Strategy
- Verify open-source tests pass without Pro gem (using
spec/dummy) - Verify Pro tests pass with Pro gem (using
react_on_rails_pro/spec/dummy) - Test error messages when Pro features used without license
- Verify
immediate_hydrationmarketing badge displays correctly - Test both dummy apps after each phase
Related
- Part of major version release (version number TBD)
- Documentation updates will be grouped with other breaking changes
Metadata
Metadata
Assignees
Labels
No labels