Low Nodes 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 Antlers syntax; <html><{ ChildNode }></html>.
Use .rbx as your file extension and now you can place HTML inside of render():
classMyNode < LowNodedefrender
<p>Hello</p>
endendAntlers syntax can be embedded within RBX:
classParentNode < LowNodedefrender
<html><{ChildNode}></html>
endendclassChildNode < LowNodedefrender
<strong>Hello</strong>
endendWhich outputs:
<html><strong>Hello</strong></html>ℹ️ For the full syntax guide see Antlers.
LowNode converts props to immutable copies, allowing you to run sections of code in parallel:
defrender
<{parallelize: }>
# For Loop executed at the same time as UserNode.
<{for: userin: @users}>
<{UserNodeuser=user}>
<{:for}>
# PostsNode executed at the same time as For Loop.
<{PostsNode}>
<{:parallelize}>
endUse .rb as your file extension to render using string interpolation:
classMyNode < LowNodedefinitialize@greeting='Hello'enddefrender<<~HTML<p>#{@greeting}</p> HTMLendend