Skip to content
On this page

Welcome

What is CableReady?

CableReady offers 38 different operations that let you create reactive user experiences without the need for complex SPA frameworks.

The CableReady client is language, framework and transport agnostic. If your server can create JSON, you can use CableReady.

Operations are typically responses to user activity, but can also be created by jobs or other external events.

Broadcasts can be delivered to one person, everyone online, or ad hoc groups of thousands. Real-time notifications, live comments on a blog post, form validations, collaborative editing, shared media viewing, endless page scrolling and lazy asset loading become easy wins.

TIP

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

GitHub stars GitHub forks Twitter follow

How should I use CableReady?

With WebSockets

As the secret weapon primary dependency powering StimulusReflex, CableReady is the standard mechanism for controlling the browser with no need for custom JavaScript.

With Ajax

New in v5, the Cable Car API allows developers to create a CableReady JSON payload. You're covered, whether you're using the amazing Mrujs or fetching data from URLs.

Why should I use CableReady?

Perhaps you've grown tired of the ever-growing complexity of the JS ecosystem. Single Page Applications are frequently lauded as the only way to build "modern" sites... even though we remember how easily one person could build powerful sites with Rails in 2004.

Or maybe you've realized that trying to synchronize state between the client and server over a stateless protocol is a Sisyphean task. How much time and energy could we reclaim for more interesting problems if we didn't need to write complex branching UI logic to update what the user sees?

It all comes down to The Great Surplus.

CableReady enables a radical new style of development, and it can make you literally 10x more productive than teams not using it. Will you use your surplus for good... or for awesome?

Goals

  • Build reactive UIs without client state 🥏
  • Break free of the request-response lifecycle 🤹
  • Increase functionality, not complexity 🪁
  • Act as a force multiplier for StimulusJS 🔨

What can I do with CableReady?

CableReady currently boasts 38 different operations that can be triggered from server-side Ruby code:

Operations Available
DOM Mutationsappend, graft, inner_html, insert_adjacent_html, insert_adjacent_text, morph, outer_html, prepend, remove, replace, text_content
Element Property Mutationsadd_css_class, remove_attribute, remove_css_class, set_attribute, set_dataset_property, set_property, set_style, set_styles, set_value
DOM Eventsdispatch_event, set_meta
Browser Manipulationsclear_storage, go, push_state, redirect_to, remove_storage_item, replace_state, scroll_into_view, set_cookie, set_focus, set_storage_item, set_title
Notificationsconsole_log, console_table, notification, play_sound

Released under the MIT License.