You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate to react on rails auto-registration (#649)
This PR migrates the application from React on Rails v14 manual component registration to v16's auto-registration feature, eliminating the need to manually register each React component.
Key improvements:
- Components now auto-register via ror_components directory convention
- Removed manual component registration from client-bundle.js
- Simplified pack structure by eliminating client-bundle and server-bundle
- CI workflows updated to generate React on Rails packs before tests
- Layouts updated to use append_javascript_pack_tag for proper loading order
Breaking changes:
- Components must be placed in ror_components subdirectories
- client-bundle.js and server-bundle.js no longer exist
- Pack tags in layouts follow new append/final pattern
- Generated pack files added to gitignore
Technical details:
- Moved 5 components to ror_components directories (App, Footer, NavigationBarApp, RouterApp, SimpleCommentScreen)
- Added stores-registration.js for Redux store management
- Updated serverRegistration.jsx to use auto-registration API
- Fixed import paths for React on Rails v16 compatibility
- Resolved Shakapacker pack tag ordering requirements
Impact on existing installations:
- Existing apps need to restructure components into ror_components directories
- Layout files require updating to new pack tag pattern
- CI/CD pipelines need pack generation step before asset compilation
Impact on new installations:
- Simpler component registration process
- Less boilerplate code required
- Cleaner pack structure with auto-generated files
Security implications:
- No security issues introduced
- Server bundles remain properly isolated
Known issues:
- Minor Turbo warning about script loading location (cosmetic, documented in TODO_TURBO_WARNING.md)
This migration sets the foundation for React on Rails v16's improved developer experience while maintaining full compatibility with existing functionality.
0 commit comments