|
| 1 | +# React on Rails TODO |
| 2 | + |
| 3 | +## Generator Improvements |
| 4 | + |
| 5 | +### HelloWorld Component Structure |
| 6 | +- [x] Fix bad import in HelloWorld.server.jsx (server importing from client) |
| 7 | +- [x] Simplify to single HelloWorld.jsx file with documentation |
| 8 | +- [ ] **Consider alternative approach**: Create second example component showing client/server split |
| 9 | + - Add `client_server_different.jsx` in sibling directory like `/examples/` or `/advanced/` |
| 10 | + - Show real-world use case (React Router, styled-components, etc.) |
| 11 | + - Keep HelloWorld simple for beginners |
| 12 | + |
| 13 | +### File Organization |
| 14 | +- [x] **Improved ror_components directory structure** |
| 15 | + - Documentation now suggests moving shared components to `../components/` directory |
| 16 | + - Keeps ror_components clean for React on Rails specific entry points |
| 17 | + - Recommended structure: |
| 18 | + ``` |
| 19 | + src/HelloWorld/ |
| 20 | + ├── components/ |
| 21 | + │ └── HelloWorld.jsx # Shared component implementation |
| 22 | + └── ror_components/ |
| 23 | + ├── HelloWorld.client.jsx # Client entry point (when needed) |
| 24 | + └── HelloWorld.server.jsx # Server entry point (when needed) |
| 25 | + ``` |
| 26 | +- [ ] **Consider adding generator flag to create this structure automatically** |
| 27 | +
|
| 28 | +### Generator Options |
| 29 | +- [ ] **Add generator flags for different patterns** |
| 30 | + - `--simple` (default): Single component file |
| 31 | + - `--split`: Generate client/server split example |
| 32 | + - `--example-name`: Customize component name beyond HelloWorld |
| 33 | +
|
| 34 | +## Documentation Improvements |
| 35 | +
|
| 36 | +### Component Architecture Guide |
| 37 | +- [ ] **Add comprehensive docs on client/server patterns** |
| 38 | + - When to use single vs split files |
| 39 | + - Common libraries requiring server setup (React Router, styled-components, Apollo) |
| 40 | + - Migration path from simple to split architecture |
| 41 | + - Auto-registration behavior explanation |
| 42 | +
|
| 43 | +### Code Comments |
| 44 | +- [x] Add inline documentation to HelloWorld.jsx explaining split pattern |
| 45 | +- [ ] Add JSDoc comments for better IDE support |
| 46 | +- [ ] Include links to relevant documentation sections |
| 47 | +
|
| 48 | +## Testing Infrastructure |
| 49 | +- [ ] **Test generator output for both simple and split patterns** |
| 50 | +- [ ] **Validate that auto-registration works correctly** |
| 51 | +- [ ] **Add integration tests for client/server rendering differences** |
| 52 | +
|
| 53 | +## Developer Experience |
| 54 | +- [ ] **bin/dev help command enhancements** |
| 55 | + - [x] Add emojis and colors for better readability |
| 56 | + - [ ] Add section about component development patterns |
| 57 | + - [ ] Include troubleshooting for client/server split issues |
| 58 | +
|
| 59 | +- [ ] **Babel Configuration Conflict Detection** |
| 60 | + - [ ] Add validation in generator/initializer to detect conflicting Babel configs |
| 61 | + - [ ] Improve error messaging for duplicate preset issues |
| 62 | + - [ ] Common conflict: babel.config.js + package.json "babel" section |
| 63 | + - [ ] Specific guidance for yalc development workflow |
| 64 | + - [ ] Add troubleshooting section for this common issue: |
| 65 | + ``` |
| 66 | + ❌ BABEL CONFIGURATION CONFLICT DETECTED |
| 67 | + Found duplicate Babel configurations: |
| 68 | + • babel.config.js ✓ (recommended) |
| 69 | + • package.json "babel" section ❌ (conflicting) |
| 70 | +
|
| 71 | + 🔧 FIX: Remove the "babel" section from package.json |
| 72 | + ``` |
| 73 | +
|
| 74 | +### IDE Support |
| 75 | +- [ ] **Improve TypeScript support** |
| 76 | + - Add .d.ts files for better type inference |
| 77 | + - Document TypeScript patterns for client/server split |
| 78 | + - Consider TypeScript generator templates |
| 79 | +
|
| 80 | +## Performance & Bundle Analysis |
| 81 | +- [ ] **Bundle splitting documentation** |
| 82 | + - How React on Rails handles client/server bundles |
| 83 | + - Best practices for code splitting |
| 84 | + - webpack bundle analysis guidance |
| 85 | +
|
| 86 | +## Real-World Examples |
| 87 | +- [ ] **Create example apps showing advanced patterns** |
| 88 | + - React Router with SSR |
| 89 | + - styled-components with server-side rendering |
| 90 | + - Apollo Client hydration |
| 91 | + - Next.js-style patterns |
| 92 | +
|
| 93 | +## Migration Guide |
| 94 | +- [ ] **Document upgrade paths** |
| 95 | + - Converting from Webpacker to Shakapacker |
| 96 | + - Migrating from single to split components |
| 97 | + - Updating existing projects to new patterns |
| 98 | +
|
| 99 | +## Community & Ecosystem |
| 100 | +- [ ] **Plugin ecosystem considerations** |
| 101 | + - Standard patterns for community components |
| 102 | + - Guidelines for React on Rails compatible libraries |
| 103 | + - Template repository for component patterns |
| 104 | +
|
| 105 | +--- |
| 106 | +
|
| 107 | +## Current Known Issues |
| 108 | +- Generator installer still has remaining issues (mentioned in context) |
| 109 | +- Version mismatch warnings with yalc during development |
| 110 | +- Need clearer documentation on when to use different patterns |
| 111 | +- **Babel configuration conflicts** - Common during yalc development when package.json and babel.config.js both define presets |
| 112 | +
|
| 113 | +## Priority Order |
| 114 | +1. Fix remaining generator installer issues |
| 115 | +2. Improve HelloWorld component documentation |
| 116 | +3. Add alternative example showing client/server split |
| 117 | +4. Create comprehensive architecture documentation |
| 118 | +5. Add generator flags for different patterns |
0 commit comments