@barefootjs/jinja 0.18.0 → 0.18.1
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.
- package/package.json +3 -3
- package/python/README.md +43 -0
- package/python/pyproject.toml +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/jinja",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Jinja2 adapter for BarefootJS — compiles IR to .jinja templates and ships the Python BarefootJS rendering runtime; runs under any Python web framework (Flask, etc.)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"directory": "packages/adapter-jinja"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@barefootjs/shared": "0.18.
|
|
56
|
+
"@barefootjs/shared": "0.18.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@barefootjs/jsx": ">=0.2.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
63
|
-
"@barefootjs/jsx": "0.18.
|
|
63
|
+
"@barefootjs/jsx": "0.18.1",
|
|
64
64
|
"typescript": "^5.0.0"
|
|
65
65
|
}
|
|
66
66
|
}
|
package/python/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# barefootjs
|
|
2
|
+
|
|
3
|
+
Python runtime for [BarefootJS](https://barefootjs.dev/) marked templates, targeting [Jinja2](https://jinja.palletsprojects.com/).
|
|
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 package is the server half for Python — it renders the `.jinja` templates produced by the `@barefootjs/jinja` adapter.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pip install barefootjs
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The only dependency is `jinja2`; everything else is stdlib.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
Generated `.jinja` templates call the `BarefootJS` instance as a `bf` object (`{{ bf.scope_attr() }}`, `{{ bf.json(x) }}`, `{{ bf.spread_attrs(bag) }}`):
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from barefootjs import BarefootJS, JinjaBackend
|
|
21
|
+
|
|
22
|
+
backend = JinjaBackend(paths=["templates"])
|
|
23
|
+
bf = BarefootJS(None, {"backend": backend})
|
|
24
|
+
html = backend.render_named("counter", bf, {"count": 0})
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Package layout
|
|
28
|
+
|
|
29
|
+
| Module | Role |
|
|
30
|
+
|--------|------|
|
|
31
|
+
| `runtime.py` | the engine-agnostic `bf` object |
|
|
32
|
+
| `evaluator.py` | ParsedExpr evaluator for the `*_eval` helpers |
|
|
33
|
+
| `search_params.py` | `searchParams()` SSR reader |
|
|
34
|
+
| `backend_jinja.py` | the Jinja2 engine backend |
|
|
35
|
+
|
|
36
|
+
## Documentation
|
|
37
|
+
|
|
38
|
+
- [barefootjs.dev](https://barefootjs.dev/) — core documentation
|
|
39
|
+
- [GitHub: piconic-ai/barefootjs](https://github.com/piconic-ai/barefootjs) — monorepo (this package lives at `packages/adapter-jinja/python`)
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
package/python/pyproject.toml
CHANGED
|
@@ -6,6 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
name = "barefootjs"
|
|
7
7
|
dynamic = ["version"]
|
|
8
8
|
description = "Python runtime for the @barefootjs/jinja adapter"
|
|
9
|
+
readme = "README.md"
|
|
9
10
|
license = {text = "MIT"}
|
|
10
11
|
requires-python = ">=3.10"
|
|
11
12
|
authors = [{ name = "kobaken", email = "kentafly88@gmail.com" }]
|