JSX is great, but I remember when first learning React that I thought it would have been nicer to use HAML... HAML is pretty common in the Ruby world and it's quite nice to work with. Today I found a HAML parser that returns an AST, https://github.com/ruby-syntax-tree/syntax_tree-haml
That parser can be used to transform this HAML code:
JSX is great, but I remember when first learning React that I thought it would have been nicer to use HAML... HAML is pretty common in the Ruby world and it's quite nice to work with. Today I found a HAML parser that returns an AST, https://github.com/ruby-syntax-tree/syntax_tree-haml
That parser can be used to transform this HAML code:
into this ruby code:
I think HAML would be a really good choice for templating... Could maybe use this naming:
Some pros using HAML:
Here's a more complete example of a pagination component. Not sure if it would work but it looks pretty cool
And this would generate the following Ruby code:
It would be cool to auto-resolve components, so that:
would translate to:
or something...
%./Pagination
could maybe be used to refer to relative paths or something...%.Foo::Bar
maybe forrequire("./Foo/Bar")
?