Module: BarefootJS

Defined in:
lib/barefoot_js.rb,
lib/barefoot_js/evaluator.rb,
lib/barefoot_js/dev_reload.rb,
lib/barefoot_js/backend/erb.rb,
lib/barefoot_js/search_params.rb

Overview

BarefootJS - engine- and framework-agnostic server runtime for BarefootJS marked templates (ERB port).

Ruby port of BarefootJS.pm (@barefootjs/perl), keeping method names 1:1 with the Perl runtime (already snake_case) so the ERB compile-time adapter and this runtime share one naming contract. This module is deliberately template-engine- and framework-agnostic: every operation that depends on how a template is rendered -- JSON marshalling, raw-string marking, JSX-children materialisation, and named-template rendering -- is delegated to a pluggable backend (see BarefootJS::Backend::Erb for the ERB reference implementation), which is the only component that knows about a specific template engine.

Value domain: JSON-shaped Ruby data with SYMBOL hash keys throughout (props, env hashes, array-of-hash records). Ruby's real Integer/Float/ String/true/false/nil type system maps onto the JS value domain far more directly than Perl's blurred numeric-string scalars, so this port needs none of the JSON::PP::Boolean sentinel-detection machinery the Perl runtime carries -- a Ruby true/false IS a boolean, distinguishable from 0/1 for free.

Defined Under Namespace

Modules: Backend, DevReload, Evaluator Classes: Context, SearchParams