mayu-live / framework

Mayu is a live updating server-side component-based VDOM rendering framework written in Ruby
https://mayu.live
GNU Affero General Public License v3.0
130 stars 4 forks source link

Rux templates #2

Closed aalin closed 1 year ago

aalin commented 1 year ago

The current markup generator is not very nice to work with.

JSX is great because it's regular JavaScript extended with a subset of XML, so it's very easy to distinguish between elements and logic.

Rux extends whitequark/parser to parse a similar syntax in Ruby. Initially I used Rux for templating, and it's great, except there is no support for it anywhere.

Ruby doesn't really have a culture of transpiling code like there is in the JS-world, so there are no source maps for Ruby, which means that errors will show up where they occurred in the transpiled code, and not in the written code.

So a few things to do:

aalin commented 1 year ago

Decided to use HAML instead. Rux has been great so far, but HAML has better editor support. HAML is probably also a better choice for a Ruby framework since HAML was made for Ruby, while JSX was made for JavaScript and fits better there...