NAME

BarefootJS - Engine- and framework-agnostic server runtime for BarefootJS marked templates

SYNOPSIS

use BarefootJS;

# A host injects a rendering backend (see BarefootJS::Backend::Xslate or
# Mojolicious::Plugin::BarefootJS for shipping backends).
my $bf = BarefootJS->new($context, { backend => $backend });

# The compiled marked template calls the runtime as a `bf` object:
#   <: $bf.scope_attr() :>  <: $bf.json($data) :>  <: $bf.spread_attrs($h) :>

DESCRIPTION

BarefootJS compiles JSX/TSX into a marked template plus client JS. This module is the server-side runtime the marked templates call into at render time. It is deliberately template-engine- and web-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.

That design lets the one runtime drive any backend. Shipping backends:

The core itself pulls in only core Perl modules (POSIX, Scalar::Util); no template engine or web framework is loaded unless a backend that needs one is used.

SEE ALSO

BarefootJS::Backend::Xslate, Mojolicious::Plugin::BarefootJS, https://github.com/piconic-ai/barefootjs

AUTHOR

kobaken <kentafly88@gmail.com>

LICENSE

Copyright (c) 2025-present BarefootJS Contributors.

This library is free software; you can redistribute it and/or modify it under the MIT License. See the LICENSE file in the distribution for the full text.