-
-
Notifications
You must be signed in to change notification settings - Fork 639
Fix Turbo navigation script tag #1906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Changed from deprecated 'data-turbolinks-track' to modern 'data-turbo-track' attribute with 'reload' value. Also explicitly added defer: true for clarity. This fixes Turbo navigation issues in the dummy app. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
WalkthroughUpdated the script tag in the application layout view to replace Turbolinks tracking with Turbo tracking. Changed from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (3)📓 Common learnings📚 Learning: 2024-10-08T20:53:47.076ZApplied to files:
📚 Learning: 2025-02-13T16:50:26.861ZApplied to files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review: Fix Turbo Navigation Script TagSummaryThis PR fixes a critical Turbo navigation bug by updating from deprecated ✅ Positive Findings1. Correct Migration Path
2. Well-Documented Fix
3. Follows Best PracticesPer the Turbo documentation for Rails, the correct syntax for Turbo 7+ is: data-turbo-track: 'reload'The
|
PR Review: Fix Turbo navigation script tagSummaryThis PR updates the dummy app to use modern Turbo syntax instead of deprecated Turbolinks syntax. The change is small but important for compatibility. Code Quality ✅Positive aspects:
Issues & Recommendations🔴 CRITICAL: Inconsistent migration - Pro dummy app not updatedThe React on Rails Pro dummy app at <%= stylesheet_pack_tag('client-bundle',
media: 'all',
'data-turbolinks-track': true) %>
...
<%= javascript_pack_tag('client-bundle', 'data-turbolinks-track': true, defer: false) %>Recommendation: Update both locations in the Pro dummy app for consistency.
|
Code Review - PR #1906: Fix Turbo navigation script tagSummaryThis PR updates the dummy app's layout to use modern Turbo conventions instead of deprecated Turbolinks syntax. The change is straightforward and appropriate. ✅ Positive Aspects
|
| Aspect | Rating | Notes |
|---|---|---|
| Correctness | ✅ Good | Syntax is correct for Turbo |
| Consistency | Pro dummy app needs same update | |
| Documentation | Docs still reference old syntax | |
| Test Coverage | No test changes in PR | |
| Best Practices | ✅ Good | Following modern Turbo conventions |
🎯 Recommended Actions Before Merge
- Update Pro dummy app with matching changes to
/react_on_rails_pro/spec/dummy/app/views/layouts/application.html.erb - Update documentation in
docs/building-features/turbolinks.mdto reflect modern practices - Verify test suite passes with the new attribute
- Consider adding a system test for Turbo navigation (optional but recommended)
- Update CHANGELOG.md if this affects end users (though it's primarily a test/dummy app change)
💡 Additional Observations
- The project currently depends on both
turbo-rails(2.0.6) andturbolinks(5.2.1), suggesting a transitional phase - Consider documenting the migration strategy for users moving from Turbolinks to Turbo
- The change is isolated to test/dummy apps, so impact on production users is minimal
Overall Assessment: ✅ Approve with minor changes recommended
The core change is correct and beneficial. Addressing the consistency issues across Pro dummy app and documentation would make this PR excellent.
Great work on modernizing the codebase! 🚀
Code Review: Fix Turbo navigation script tagSummaryThis PR updates the Positive Aspects✅ Correct modernization: The change from ✅ Explicit defer parameter: Making ✅ Maintains script loading order: The inline comment correctly notes that defer (not async) is needed to maintain proper script loading order, which is critical for React on Rails. Concerns & Questions1. Verify shakapacker's default defer behavior
|
Code Review: Fix Turbo navigation script tagSummaryThis PR updates the dummy app's layout to use modern Turbo conventions, replacing deprecated ✅ Positive Findings
|
Summary
data-turbolinks-trackto moderndata-turbo-track: 'reload'defer: truefor clarityTest plan
🤖 Generated with Claude Code
This change is
Summary by CodeRabbit
Release Notes