Commit eebed29
Move Pro features from core gem to Pro gem
This PR moves all Pro-specific features from lib/react_on_rails/pro/ to the
react_on_rails_pro gem, ensuring complete separation between MIT and Pro licensed code.
Key Changes:
- Move immediate_hydration config from core to Pro gem (default: true in Pro)
- Refactor helper methods to use data enhancement pattern
- Core gem collects script data, Pro gem enhances it if loaded
- Delete lib/react_on_rails/pro/ directory entirely
- Update RenderOptions to retrieve immediate_hydration from Pro config
- Add comprehensive tests for immediate_hydration option
- Update LICENSE.md to reflect that lib/react_on_rails/ is now 100% MIT
- Update MONOREPO_MERGER_PLAN.md with new Phase 5
Benefits:
- Clean separation: Core gem is 100% MIT licensed
- No HTML parsing needed for Pro enhancements
- Better architecture: Core gem doesn't know about Pro internals
- Backward compatible: Functionality unchanged
Technical Implementation:
- Core gem's generate_component_script() and generate_store_script() collect
script attributes as data structures before HTML generation
- If Pro gem is loaded, ReactOnRailsPro::Helper.enhance_*_script_data() adds
immediate hydration attributes and scripts
- Core gem then generates final HTML from the enhanced data
- RenderOptions.immediate_hydration uses retrieve_react_on_rails_pro_config_value_for()
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 7bce94a commit eebed29
File tree
13 files changed
+307
-235
lines changed- docs
- lib/react_on_rails
- pro
- react_component
- react_on_rails_pro/lib
- react_on_rails_pro
- spec
- dummy/spec/helpers
- react_on_rails/react_component
13 files changed
+307
-235
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
408 | 475 | | |
409 | 476 | | |
410 | 477 | | |
| |||
455 | 522 | | |
456 | 523 | | |
457 | 524 | | |
458 | | - | |
| 525 | + | |
459 | 526 | | |
460 | 527 | | |
461 | 528 | | |
| |||
522 | 589 | | |
523 | 590 | | |
524 | 591 | | |
525 | | - | |
| 592 | + | |
526 | 593 | | |
527 | 594 | | |
528 | 595 | | |
| |||
588 | 655 | | |
589 | 656 | | |
590 | 657 | | |
591 | | - | |
| 658 | + | |
592 | 659 | | |
593 | 660 | | |
594 | 661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
| |||
72 | 70 | | |
73 | 71 | | |
74 | 72 | | |
75 | | - | |
| 73 | + | |
76 | 74 | | |
77 | 75 | | |
78 | 76 | | |
| |||
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
92 | | - | |
| 90 | + | |
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
| |||
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
137 | | - | |
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
| |||
793 | 791 | | |
794 | 792 | | |
795 | 793 | | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
796 | 854 | | |
797 | 855 | | |
798 | 856 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments