Rbexy

screenshot of Rbexy
rails

A Ruby template language and component framework inspired by JSX and React

Overview

Rbexy is a Ruby template language that is inspired by JSX. It allows developers to work with HTML elements and custom components using an interchangeable syntax in Rails server-rendered apps. By combining Rbexy with CSS Modules in the Webpacker PostCSS pipeline, developers can have a seamless frontend development experience while maintaining the efficiency of Rails.

Features

  • JSX-like syntax for working with HTML elements and custom components
  • Integration with Rails' ActionView and controller rendering context
  • Support for Ruby classes as components alongside standard HTML tags
  • Customizable component resolution
  • Ability to use Ruby code, splat hashes into attributes, and use HTML or component tags within expressions
  • Support for blocks, conditional templates, loops, and comments

Summary

Rbexy is a Ruby template language that brings the elegance of JSX to Rails server-rendered apps. It allows developers to work with HTML elements and custom components using an interchangeable syntax. By combining it with CSS Modules and leveraging existing Rails features like RailsUJS, Turbolinks, and StimulusJS, developers can build modern user experiences while writing and maintaining less code. With support for Ruby classes as components, customizable component resolution, and various template syntax features, Rbexy offers a powerful and efficient frontend development experience in Rails.

rails
Ruby on Rails

Ruby on Rails, often referred to as Rails, is an open-source web application framework written in Ruby. Known for its convention over configuration and don't repeat yourself (DRY) principles, Rails simplifies and accelerates the development of database-backed web applications.