barefoot_js 0.18.0 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +32 -0
- data/lib/barefoot_js.rb +9 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3625fef89e8828740d0479c35034555bf880b3ad88548bf9208b635eec547ea6
|
|
4
|
+
data.tar.gz: f30324b4b0f3211c7b921726a6a496d2eb61637a59b580cdf79e356d3b720d72
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 44dd727b16cce0b6025b058d26e5f0e98266142c22b4c0134981d80ad8756567b1475c78739032d49dc2daf424e8de4d0555f04a69d63b8463971663d7a746b2
|
|
7
|
+
data.tar.gz: 4ba8504636d54a77ec53eaf1dd1a30dadaf7c4836dab9d73358efe147c92a6e1d69de8681e50bb0b09c6e78e3f3883fe8ac3c05860f3add0202dcab2994fc2ce
|
data/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# barefoot_js
|
|
2
|
+
|
|
3
|
+
Ruby runtime for [BarefootJS](https://barefootjs.dev/) marked templates, targeting ERB.
|
|
4
|
+
|
|
5
|
+
[BarefootJS](https://github.com/piconic-ai/barefootjs) is a fine-grained reactive TSX compiler: you write components in TSX, and the compiler emits templates for your backend's template engine plus the client-side JS that hydrates them. This gem is the server half for Ruby — it renders the `.erb` templates produced by the `@barefootjs/erb` adapter.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
gem install barefoot_js
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Every compiled `.erb` template receives a `BarefootJS::Context` as the `bf` local. The context is engine-agnostic; everything that depends on how a template is rendered is delegated to a pluggable backend (`BarefootJS::Backend::Erb` is the ERB reference implementation):
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
require 'barefoot_js'
|
|
19
|
+
|
|
20
|
+
bf = BarefootJS::Context.new(backend)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Values are JSON-shaped Ruby data with symbol hash keys throughout (props, env hashes, array-of-hash records).
|
|
24
|
+
|
|
25
|
+
## Documentation
|
|
26
|
+
|
|
27
|
+
- [barefootjs.dev](https://barefootjs.dev/) — core documentation
|
|
28
|
+
- [GitHub: piconic-ai/barefootjs](https://github.com/piconic-ai/barefootjs) — monorepo (this gem lives at `packages/adapter-erb`)
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
MIT
|
data/lib/barefoot_js.rb
CHANGED
|
@@ -324,7 +324,15 @@ module BarefootJS
|
|
|
324
324
|
extra[name] = props.key?(name) ? props[name] : d[:value]
|
|
325
325
|
next
|
|
326
326
|
end
|
|
327
|
-
|
|
327
|
+
# `propName` rides in from the JSON manifest as a String -- JSON has
|
|
328
|
+
# no symbol type, and the manifest's `symbolize_names: true` parse
|
|
329
|
+
# only symbolizes hash KEYS, never string values. Runtime prop
|
|
330
|
+
# hashes, meanwhile, are symbol-keyed because compiled ERB templates
|
|
331
|
+
# pass `{ children: ... }` literals, so `props.key?(prop_name)` with
|
|
332
|
+
# the String would always miss, silently falling back to the static
|
|
333
|
+
# default for every manifest-registered child (e.g. `children`
|
|
334
|
+
# rendering empty) (#2157).
|
|
335
|
+
prop_name = d[:propName]&.to_sym
|
|
328
336
|
extra[name] =
|
|
329
337
|
if !prop_name.nil? && props.key?(prop_name) && !props[prop_name].nil?
|
|
330
338
|
props[prop_name]
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: barefoot_js
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.18.
|
|
4
|
+
version: 0.18.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kobaken
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Engine-agnostic BarefootJS server runtime targeting ERB, ported from
|
|
14
14
|
packages/adapter-perl/lib/BarefootJS.pm.
|
|
@@ -18,6 +18,7 @@ executables: []
|
|
|
18
18
|
extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
|
20
20
|
files:
|
|
21
|
+
- README.md
|
|
21
22
|
- lib/barefoot_js.rb
|
|
22
23
|
- lib/barefoot_js/backend/erb.rb
|
|
23
24
|
- lib/barefoot_js/dev_reload.rb
|
|
@@ -27,6 +28,7 @@ homepage: https://github.com/piconic-ai/barefootjs
|
|
|
27
28
|
licenses:
|
|
28
29
|
- MIT
|
|
29
30
|
metadata:
|
|
31
|
+
documentation_uri: https://barefootjs.dev
|
|
30
32
|
source_code_uri: https://github.com/piconic-ai/barefootjs/tree/main/packages/adapter-erb
|
|
31
33
|
rubygems_mfa_required: 'true'
|
|
32
34
|
post_install_message:
|