Skip to content

Conversation

@justin808
Copy link
Member

@justin808 justin808 commented Nov 5, 2025

Summary

This PR addresses the incomplete migration to modern Turbo syntax identified in the codebase review. It completes the migration by updating:

  • Pro version dummy app layout to use 'data-turbo-track': 'reload' instead of deprecated 'data-turbolinks-track': true
  • Documentation to clearly distinguish between Turbolinks 5.x, 2.x, and modern Turbo syntax

Changes

1. Pro Version Dummy App (react_on_rails_pro/spec/dummy/app/views/layouts/application.html.erb)

Before:

<%= stylesheet_pack_tag('client-bundle', media: 'all', 'data-turbolinks-track': true) %>
<%= javascript_pack_tag('client-bundle', 'data-turbolinks-track': true, defer: false) %>

After:

<%= stylesheet_pack_tag('client-bundle', media: 'all', 'data-turbo-track': 'reload') %>
<%= javascript_pack_tag('client-bundle', 'data-turbo-track': 'reload', defer: false) %>

This brings the Pro version in sync with the main dummy app, which was already updated in a previous commit.

2. Documentation (docs/building-features/turbolinks.md)

  • Separated Turbolinks 5.x and 2.x syntax examples for clarity
  • Added note directing users to modern Turbo syntax (recommended approach)
  • Improved organization of the "Legacy Turbolinks Support" section

Testing

  • ✅ All dummy app tests pass (63 examples, 0 failures)
  • ✅ RuboCop passes with no violations
  • ✅ Pre-commit hooks pass (autofix, rubocop, trailing-newlines, prettier)

Context

This PR completes the Turbo migration work started in PR #1620. The main dummy app was already updated to use modern Turbo syntax, but the Pro version and documentation were missed. This ensures consistency across all test apps and provides clearer guidance for users.

🤖 Generated with Claude Code


This change is Reviewable

justin808 and others added 2 commits November 4, 2025 16:21
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 <noreply@anthropic.com>
Address inconsistencies identified in the Turbo migration by updating:

1. Pro version dummy app layout (react_on_rails_pro/spec/dummy/app/views/layouts/application.html.erb):
   - Change 'data-turbolinks-track': true to 'data-turbo-track': 'reload'
   - Ensures consistency with main dummy app which was already updated

2. Documentation (docs/building-features/turbolinks.md):
   - Clarify Turbolinks 5.x vs 2.x syntax differences
   - Add note pointing users to modern Turbo syntax
   - Improve readability of legacy Turbolinks section

These changes complete the Turbo migration across all dummy apps and provide
clearer guidance for users on the recommended modern approach.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Warning

Rate limit exceeded

@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 45821a2 and 4740d4f.

📒 Files selected for processing (3)
  • docs/building-features/turbolinks.md (1 hunks)
  • react_on_rails_pro/spec/dummy/app/views/layouts/application.html.erb (1 hunks)
  • spec/dummy/app/views/layouts/application.html.erb (1 hunks)
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch justin808/taipei-v2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@justin808
Copy link
Member Author

@claude review this PR.

@claude
Copy link

claude bot commented Nov 5, 2025

Claude finished @justin808's task —— View job


PR Review Complete ✅

Tasks:

  • Read all changed files
  • Search for any remaining turbolinks references
  • Analyze changes for correctness and consistency
  • Provide comprehensive review feedback

Code Review

Overall Assessment: ✅ Approved with Minor Suggestions

This PR successfully completes the Turbo migration by updating the Pro dummy app and improving documentation clarity. The changes are consistent, well-documented, and align with modern best practices.

Changes Reviewed

1. Pro Dummy App Layout (react_on_rails_pro/spec/dummy/app/views/layouts/application.html.erb)

Looks Good

  • Correctly updates from deprecated 'data-turbolinks-track': true to modern 'data-turbo-track': 'reload'
  • Changes on lines 23-29 properly update both stylesheet_pack_tag and javascript_pack_tag
  • Now consistent with the main dummy app (already updated in commit d5a5f27)

2. Main Dummy App Layout (spec/dummy/app/views/layouts/application.html.erb)

Looks Good

  • Updates javascript_pack_tag on line 13 from 'data-turbolinks-track' to 'data-turbo-track'
  • Maintains the defer: true setting correctly
  • Syntax is correct: 'data-turbo-track': 'reload'

3. Documentation (docs/building-features/turbolinks.md)

Excellent Improvements

  • Lines 131-143: Separated Turbolinks 5.x and 2.x syntax examples for clarity
  • Line 145: Added helpful note directing users to modern Turbo syntax
  • Much clearer distinction between legacy versions

Findings

Strengths

  1. Consistency: All dummy apps now use the same modern Turbo syntax
  2. Documentation clarity: The separation of Turbolinks 5.x vs 2.x examples is much clearer
  3. Forward-looking: The note directing users to modern Turbo is helpful
  4. Testing: PR description confirms all tests pass
  5. No remaining issues: Search confirms only documentation references to old syntax remain (which is appropriate for legacy docs)

💡 Minor Suggestions (Non-blocking)

  1. Documentation Enhancement: Consider adding a more prominent deprecation notice at the top of the "Legacy Turbolinks Support" section. Something like:

    ## Legacy Turbolinks Support
    
    > **⚠️ Deprecation Notice**
    > Turbolinks is no longer actively maintained. We strongly recommend migrating to modern Turbo (see above).
    > This legacy documentation is maintained for existing projects only.
  2. Consistency Check: In spec/dummy/app/views/layouts/application.html.erb:13, the JS pack uses defer: true while the Pro version (react_on_rails_pro/spec/dummy/app/views/layouts/application.html.erb:29) uses defer: false. This appears intentional based on the comment "Must use defer and not async" in the main app, but verify this difference is intentional:

    • Main dummy: defer: true (line 13)
    • Pro dummy: defer: false (line 29)

    If intentional, consider adding a comment in the Pro version explaining why defer: false is needed there.

Verification

  • ✅ No remaining data-turbolinks-track in code (only in legacy docs, which is correct)
  • ✅ Syntax is correct: 'data-turbo-track': 'reload'
  • ✅ Changes align with Turbo best practices
  • ✅ PR description accurately describes changes
  • ✅ Tests pass according to PR description

Conclusion

This is a solid PR that completes the Turbo migration work. The code changes are correct and the documentation improvements make it much easier for users to understand which syntax to use. The minor suggestions above are optional enhancements that could be addressed in a follow-up if desired.

Recommendation: ✅ Approve and merge

--- | Branch: justin808/taipei-v2

@claude
Copy link

claude bot commented Nov 5, 2025

Code Review - PR #1908: Complete Turbo migration

✅ Overall Assessment

This PR successfully completes the Turbo migration by updating deprecated Turbolinks syntax to modern Turbo syntax. The changes are well-focused, properly tested, and include good documentation updates.


📝 Code Quality & Best Practices

Strengths:

  • Consistent migration pattern: All data-turbolinks-track attributes correctly updated to data-turbo-track: 'reload'
  • Proper attribute syntax: Uses modern Turbo attribute format consistently across both dummy apps
  • Good documentation: Clear separation of Turbolinks 5.x, 2.x, and modern Turbo syntax in docs
  • Test coverage: PR description confirms all tests pass (63 examples, 0 failures)
  • Linting compliance: RuboCop and pre-commit hooks pass

Code changes are minimal and surgical:

  • spec/dummy/app/views/layouts/application.html.erb:13
  • react_on_rails_pro/spec/dummy/app/views/layouts/application.html.erb:25,29
  • docs/building-features/turbolinks.md:134-145

🔍 Potential Issues & Observations

1. Defer Attribute Inconsistency (Pre-existing, not introduced by this PR)

I noticed the main dummy app and Pro dummy app have different defer settings:

Main dummy app (spec/dummy):

<%= javascript_pack_tag('client-bundle', 'data-turbo-track': 'reload', defer: true) %>

Pro dummy app (react_on_rails_pro/spec/dummy):

<%= javascript_pack_tag('client-bundle', 'data-turbo-track': 'reload', defer: false) %>

Question: Is this intentional? The Pro version uses defer: false while the main version uses defer: true. This appears to be a pre-existing difference (not introduced by this PR), but worth documenting why if it's intentional. The comment in the main dummy app mentions "Must use defer and not async", but the Pro version explicitly disables defer.

2. Missing Stylesheet in Main Dummy App

The main dummy app (spec/dummy) doesn't include a stylesheet_pack_tag with turbo-track, while the Pro version does:

Pro version has:

<%= stylesheet_pack_tag('client-bundle', media: 'all', 'data-turbo-track': 'reload') %>

Main version doesn't include this. Is this intentional or an oversight? For complete Turbo integration, stylesheets should also have the tracking attribute.


🔒 Security Considerations

No security concerns identified

  • Changes are limited to view templates and documentation
  • No user input handling or dynamic content generation
  • Turbo tracking attributes are standard Rails helpers

⚡ Performance Considerations

Performance impact is positive

  • Modern Turbo is more efficient than deprecated Turbolinks
  • data-turbo-track: 'reload' ensures proper cache invalidation when assets change
  • The migration improves future maintainability

Note on defer attribute:

  • defer: true (main app) allows HTML parsing to continue while scripts load
  • defer: false (Pro app) blocks HTML parsing until script loads
  • Consider documenting the rationale for this difference if intentional

🧪 Test Coverage

Adequate test coverage confirmed

  • PR description shows 63 examples passing
  • Integration spec at spec/dummy/spec/system/integration_spec.rb:116 has a test named "Turbolinks across pages" that validates navigation behavior
  • Consider updating that test name to "Turbo across pages" in a follow-up to match the modern terminology

📚 Documentation Quality

Excellent documentation improvements

The updated docs/building-features/turbolinks.md now:

  • ✅ Clearly separates Turbolinks 5.x and 2.x syntax
  • ✅ Directs users to modern Turbo (recommended approach)
  • ✅ Provides complete code examples for each version

Minor suggestion: Consider adding a deprecation notice at the top of the "Legacy Turbolinks Support" section to emphasize that users should prefer modern Turbo.


🎯 Recommendations

  1. Consider adding stylesheet_pack_tag to main dummy app with data-turbo-track: 'reload' for consistency
  2. Document the defer attribute difference between main and Pro dummy apps if intentional
  3. Future cleanup: Update test name from "Turbolinks across pages" to "Turbo across pages" (line 116 in spec/dummy/spec/system/integration_spec.rb)
  4. Optional: Add a prominent deprecation banner in the docs for the legacy Turbolinks section

✅ Final Verdict

APPROVED - This is a clean, well-executed PR that completes the Turbo migration as intended. The changes are safe, properly tested, and improve code maintainability. The observations noted above are minor and either pre-existing or optional improvements for future PRs.

Great work completing this migration! 🎉


🤖 Review generated with Claude Code

@claude
Copy link

claude bot commented Nov 5, 2025

Code Review: PR #1908 - Complete Turbo Migration

✅ Overall Assessment

This is a high-quality PR that completes the Turbo migration with excellent attention to detail. The changes are minimal, focused, and well-documented. Great work!


🎯 Strengths

  1. Clear Migration Path: Successfully updates deprecated data-turbolinks-track to modern data-turbo-track syntax
  2. Consistency: Brings Pro dummy app in sync with the main dummy app
  3. Excellent Documentation: The updated turbolinks.md clearly distinguishes between Turbolinks 5.x, 2.x, and modern Turbo
  4. Test Coverage: PR description confirms all tests pass (63 examples, 0 failures)
  5. Linting Compliance: RuboCop and pre-commit hooks pass
  6. Good Context: Links to PR should force load react-components which send over turbo-stream #1620 showing this completes earlier migration work

📋 Code Quality Review

Documentation Changes (docs/building-features/turbolinks.md)

Excellent improvements:

  • Separated Turbolinks 5.x and 2.x examples with clear headers
  • Added code blocks for Turbolinks 2.x (previously just a note)
  • Included helpful note directing users to modern Turbo syntax
  • Improves discoverability and reduces confusion

Layout Updates

Proper modernization:

Pro dummy app (react_on_rails_pro/spec/dummy/app/views/layouts/application.html.erb):

  • 'data-turbolinks-track': true'data-turbo-track': 'reload'
  • Applied to both stylesheet_pack_tag and javascript_pack_tag
  • Maintains defer: false appropriately ✓

Main dummy app (spec/dummy/app/views/layouts/application.html.erb):

  • Small refinement: also adds defer: true explicitly (good practice)

🔍 Minor Observations & Suggestions

1. Defer Attribute Consistency (Minor)

The main dummy app change adds defer: true:

-  <%= javascript_pack_tag('client-bundle', 'data-turbolinks-track': true) %>
+  <%= javascript_pack_tag('client-bundle', 'data-turbo-track': 'reload', defer: true) %>

While the Pro app keeps defer: false:

<%= javascript_pack_tag('client-bundle', 'data-turbo-track': 'reload', defer: false) %>

Question: Is this intentional? The comment in the Pro app mentions "testing purposes to simulate hydration failure" - does the main app need different defer behavior for its tests?

Impact: Low - Both are valid, just noting the difference for consistency review.

2. Completeness Check (Verification Needed)

The PR updates 3 ERB files. Consider verifying:

  • Are there any other layout files in example apps or generators that might need updating?
  • Run: grep -r "data-turbolinks-track" --include="*.erb" . to confirm no other instances remain

3. Documentation Enhancement (Optional)

The turbolinks.md documentation is excellent. Consider adding:

  • A migration guide snippet showing the exact before/after for users upgrading
  • Timeline of when Turbolinks was deprecated (helps users understand urgency)

🔒 Security Considerations

✅ No security concerns. This is a straightforward attribute update for asset tracking.


⚡ Performance Considerations

Positive impact: Modern Turbo provides better performance and maintainability than legacy Turbolinks.

The reload value for data-turbo-track ensures assets are properly reloaded when changed, which is correct behavior.


🧪 Testing Recommendations

Since tests pass, just confirm:

  1. ✅ Tests verify Turbo navigation still works correctly
  2. ✅ Asset reloading behavior works as expected
  3. Consider adding: A test that specifically validates the data-turbo-track attribute is present

📝 Best Practices Alignment

Follows repository conventions:

Aligns with CLAUDE.md guidelines:

  • Would benefit from running bundle exec rubocop to confirm (PR description indicates this passed)
  • Ensure all files end with newlines ✓

🎬 Recommendations

Before Merge:

  1. ✅ Confirm all CI checks pass (lint, tests, rubocop)
  2. ⚠️ Double-check no other .erb files have legacy data-turbolinks-track attributes
  3. ℹ️ Verify the defer attribute difference between dummy apps is intentional

Optional Enhancements (can be separate PR):

  • Consider updating CHANGELOG.md if this affects users upgrading
  • Add a brief note in the upgrade guide about this migration

🏆 Conclusion

This PR successfully completes the Turbo migration with clean, focused changes. The code quality is high, and the documentation improvements are particularly valuable for users.

Recommendation: ✅ Approve with minor verification (check for other .erb files)

Risk Level: 🟢 Low - These are well-understood attribute changes with passing tests.

Great work completing this migration! 🚀


Review generated with Claude Code following repository's CLAUDE.md guidelines

@justin808 justin808 merged commit 3182910 into master Nov 5, 2025
26 checks passed
@justin808 justin808 deleted the justin808/taipei-v2 branch November 5, 2025 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants