Welcome

Build reactive applications with the Rails tooling you already know and love

What is StimulusReflex?

StimulusReflex is a new way to craft modern, reactive web interfaces with Ruby on Rails.

We extend the capabilities of both Rails and Stimulus by intercepting user interactions and passing them to Rails over real-time websockets. These interactions are processed by Reflex actions that change application state. The current page is quickly re-rendered and the changes are sent to the client using CableReady. The page is then morphed to reflect the new application state. This entire round-trip allows us to update the UI in 20-30ms without flicker or expensive page loads.

This architecture eliminates the complexity imposed by full-stack frontend frameworks without abandoning high-performance reactive user experiences. With StimulusReflex, small teams can do big things faster than ever before. We invite you to explore a fresh alternative to the Single Page App (SPA).

Get Involved. We are stronger together! Please join us on Discord.

GitHub stars GitHub forks Twitter follow

Why should I use StimulusReflex?

Wouldn't it be great if you could focus on your product instead of the technical noise introduced by modern JavaScript. With StimulusReflex, you'll ship projects faster, with smaller teams and re-discover the joy of programming.

Goals

  • Enable small teams to do big things, faster 🏃🏽‍♀️

  • Increase developer happiness ❤️❤️❤️

  • Facilitate simple, concise, and clear code 🤸

  • Integrate seamlessly with Ruby on Rails 🚝

Live demo

StimulusReflex Expo is a growing collection of like examples showing different use-cases alongside the source code behind them.

Some of our favorite demos include:

  • Tabular: filtering, sorting and pagination without any client JavaScript

  • Todo: our take on the classic, with a wire size 2-15x smaller than every other solution

Build the next Twitter in just 9 minutes (or less) 😉

How we got here

We love Rails. Veterans of the framework remember the feeling of awe and disbelief after seeing David Heinemeier-Hansson's Build a Blog in 15 minutes video. It didn't seem possible that web development could be so easy, productive, and fun. We're talking exponential gains in developer efficiency and happiness. Rails has become so successful that nearly every framework since has borrowed ideas, patterns, and features from it.

The landscape has changed a lot since those early days. Applications are more ambitious now. The pursuit of native UI speeds spawned a new breed of increasingly complex technologies. Modern Single Page Apps have pushed much of the server's responsibilities to the client. Unfortunately this new approach trades a developer experience that was once fun and productive for an alternative of high complexity and only marginal gains.

There must be a better way.

The revolution begins

In his 2018 ElixirConf keynote, Chris McCord (creator of the Phoenix framework for Elixir) introduced LiveView, an alternative to the SPA. His presentation captures the same promise and excitement that Rails had in the early days.

We love Elixir and Phoenix. Elixir hits a sweet spot for people who want Rails-like conventions in a functional language. The community is terrific, but it's still small and comparatively niche.

Also, we just really enjoy using Ruby and Rails.

StimulusReflex was originally inspired by LiveView, but we are charting our own course. Our goal has always been to make building modern apps with Rails the most productive and enjoyable option available. We want to inspire our friends working with other tools and technologies to evaluate how concepts like StimulusReflex could work in their ecosystems and communities.

So far, it's working! Not only do we now have 20+ developers actively contributing to StimulusReflex, but we've inspired projects like SockPuppet for Django.

We are truly stronger together.