Project

low_node

0.0
No release in over 3 years
Flexible building blocks
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

Gem version

LowNode

LowNodes are the flexible building blocks of your application. They can respond to a route request, or they can be called by another node. They can render a return value, or they can create an event. They are designed to be specific enough to observe events and return values, but generic enough to be split up to represent a complex application with its own patterns and structure. Nodes can render HTML/JSON directly from the Ruby class (via RBX, similar to JSX) and render other nodes into the output using Raindeer's special Antlers syntax; <html><{ ChildNode }></html>.

RBX [UNRELEASED]

Use .rbx as your file extension and now you can place HTML inside of render():

def render
  <html>Content</html>
end

Antlers expressions are also now accepted:

def render
  <html><{ ChildNode }></html>
end

Antlers

Props

def render
  <html><{ UserNode user=@user }></html>
end

Slots

def render
  <html>
    <{ LayoutNode: username = @user.username }>
      <{ UserNode user = @user }>
    <{ :LayoutNode }>
  </html>
end

Conditionals

# Block.
<{ if: @user.happy? }>
  <{ UserNode user = @user }>
<{ :if }>

# Directive.
<{ UserNode user = @user if: @user.happy? }>

Loops

# Block.
<{ for: user in: @users }>
  <{ UserNode user = user }>
<{ :for }>

# Directive.
<{ UserNode user = user for: user in: @users }>