Skip to content

Commit f36e40d

Browse files
committed
Improve docs and print statements
1 parent 6e8d443 commit f36e40d

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

CONTRIBUTING.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,20 @@ yalc add react-on-rails
7979
The workflow is:
8080

8181
1. Make changes to the node package.
82-
2. We need yalc to push and then run yarn:
82+
2. **CRITICAL**: Run yalc push to send updates to all linked apps:
8383

8484
```
8585
cd <top dir>
86-
# Will send the updates to other folders
86+
# Will send the updates to other folders - MUST DO THIS AFTER ANY CHANGES
8787
yalc push
8888
cd spec/dummy
8989
9090
# Will update from yalc
9191
yarn
9292
```
9393

94+
**⚠️ Common Mistake**: Forgetting to run `yalc push` after making changes to React on Rails source code will result in test apps not receiving updates, making it appear that your changes have no effect.
95+
9496
When you run `yalc push`, you'll get an informative message
9597

9698
```
@@ -388,19 +390,41 @@ gem 'react_on_rails', path: '../relative/path/to/react_on_rails'
388390
```
389391

390392
```bash
391-
# After running the install generator
393+
# After running the install generator AND after making any changes to the React on Rails source code
392394
cd /path/to/react_on_rails
393395
npm run build
394396
npx yalc publish
397+
# CRITICAL: Push changes to all linked apps
398+
npx yalc push
395399

396400
cd /path/to/test_app
397-
npx yalc add react-on-rails
398401
npm install
399402

400403
# Restart development server
401404
bin/dev
402405
```
403406

407+
**⚠️ CRITICAL DEBUGGING NOTE:**
408+
Always run `yalc push` after making changes to React on Rails source code. Without this step, your test app won't receive the updated package, leading to confusing behavior where changes appear to have no effect.
409+
410+
**Alternative to Yalc: npm pack (More Reliable)**
411+
For a more reliable alternative that exactly mimics real package installation:
412+
413+
```bash
414+
# In react_on_rails directory
415+
npm run build
416+
npm pack # Creates react-on-rails-15.0.0.tgz
417+
418+
# In test app directory
419+
npm install ../path/to/react_on_rails/react-on-rails-15.0.0.tgz
420+
```
421+
422+
This approach:
423+
- ✅ Exactly mimics real package installation
424+
- ✅ No symlink issues across different filesystems
425+
- ✅ More reliable for CI/CD testing
426+
- ⚠️ Requires manual step after each change (can be scripted)
427+
404428
**Why this is needed**:
405429
- The gem provides Rails integration and server-side rendering
406430
- Yalc provides the complete JavaScript client library needed for component mounting

lib/generators/react_on_rails/generator_messages.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def helpful_message_after_installation(component_name: "HelloWorld")
5050
║ 🎉 React on Rails Successfully Installed! ║
5151
╚════════════════════════════════════════════════════════════════════════╝
5252
#{process_manager_section}#{shakapacker_status}
53+
5354
📋 QUICK START:
5455
─────────────────────────────────────────────────────────────────────────
5556
1. Install dependencies:
@@ -86,10 +87,10 @@ def build_process_manager_section
8687
process_manager = detect_process_manager
8788
if process_manager
8889
if process_manager == "overmind"
89-
"\n #{Rainbow("#{process_manager} detected ✓").green} " \
90+
"\n📦 #{Rainbow("#{process_manager} detected ✓").green} " \
9091
"#{Rainbow('(Recommended for easier debugging)').blue}"
9192
else
92-
"\n #{Rainbow("#{process_manager} detected ✓").green}"
93+
"\n📦 #{Rainbow("#{process_manager} detected ✓").green}"
9394
end
9495
else
9596
<<~INSTALL
@@ -138,9 +139,9 @@ def build_shakapacker_status_section
138139
#{Rainbow('✓ Webpack integration configured').green}
139140
SHAKAPACKER
140141
elsif File.exist?("bin/shakapacker") && File.exist?("bin/shakapacker-dev-server")
141-
"\n 📦 #{Rainbow('Shakapacker already configured ✓').green}"
142+
"\n📦 #{Rainbow('Shakapacker already configured ✓').green}"
142143
else
143-
"\n 📦 #{Rainbow('Shakapacker setup may be incomplete').yellow}"
144+
"\n📦 #{Rainbow('Shakapacker setup may be incomplete').yellow}"
144145
end
145146
end
146147

0 commit comments

Comments
 (0)