Skip to content

Commit f0c47dc

Browse files
committed
Expose pyscript components at top level
1 parent 28c4374 commit f0c47dc

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

docs/source/about/changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Unreleased
1919
- :pull:`1113` - Added ``reactpy.asgi.ReactPy`` that can be used to run ReactPy in standalone mode via ASGI.
2020
- :pull:`1269` - Added ``reactpy.asgi.ReactPyCSR`` that can be used to run ReactPy in standalone mode via ASGI, but rendered entirely client-sided.
2121
- :pull:`1113` - Added ``reactpy.asgi.ReactPyMiddleware`` that can be used to utilize ReactPy within any ASGI compatible framework.
22-
- :pull:`1113` - Added ``reactpy.templatetags.Jinja`` that can be used alongside ``ReactPyMiddleware`` to embed several ReactPy components into your existing application.
22+
- :pull:`1113` :pull:`1269` - Added ``reactpy.templatetags.Jinja`` that can be used alongside ``ReactPyMiddleware`` to embed several ReactPy components into your existing application. This includes the following template tags: ``{% component %}``, ``{% pyscript_component %}``, and ``{% pyscript_setup %}``.
23+
- :pull:`1269` - Added ``reactpy.pyscript_component`` that can be used to embed ReactPy components into your existing application.
2324
- :pull:`1113` - Added ``uvicorn`` and ``jinja`` installation extras (for example ``pip install reactpy[jinja]``).
2425
- :pull:`1113` - Added support for Python 3.12 and 3.13.
2526
- :pull:`1264` - Added ``reactpy.use_async_effect`` hook.

src/reactpy/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
)
2121
from reactpy.core.layout import Layout
2222
from reactpy.core.vdom import vdom
23+
from reactpy.pyscript.components import pyscript_component
2324
from reactpy.utils import Ref, html_to_vdom, vdom_to_html
2425

2526
__author__ = "The Reactive Python Team"
@@ -36,6 +37,7 @@
3637
"html",
3738
"html_to_vdom",
3839
"logging",
40+
"pyscript_component",
3941
"types",
4042
"use_async_effect",
4143
"use_callback",

src/reactpy/pyscript/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from uuid import uuid4
1414

1515
import jsonpointer
16-
import orjson
1716

1817
import reactpy
1918
from reactpy.config import REACTPY_DEBUG, REACTPY_PATH_PREFIX, REACTPY_WEB_MODULES_DIR
@@ -94,6 +93,8 @@ def extend_pyscript_config(
9493
extra_js: dict[str, str] | str,
9594
config: dict[str, Any] | str,
9695
) -> str:
96+
import orjson
97+
9798
# Extends ReactPy's default PyScript config with user provided values.
9899
pyscript_config: dict[str, Any] = {
99100
"packages": [

0 commit comments

Comments
 (0)