---
title: Minimize custom JavaScript with Hotwire/Turbo 2.0
impact: MEDIUM
impactDescription: Focus on the Rails "Majestic Monolith" approach for better maintainability.
tags: rails, hotwire, turbo, stimulus, architecture
---

## Minimize custom JavaScript with Hotwire/Turbo 2.0

Focus on the Rails "Majestic Monolith" approach for better maintainability. Prefer `Turbo Frames` and `Turbo Streams` for interaction. Use `Stimulus` for small client-side behaviors.

**Incorrect:**

```javascript
// Complex React/Vue component for a simple list update
```

**Correct:**

```erb
<%# Rails Turbo Stream response %>
<turbo-stream action="append" target="messages">
  <template>
    <%= render @message %>
  </template>
</turbo-stream>
```

**Tools:** Manual Review
---
