Skip to content

Commit 122c00b

Browse files
committed
self review
1 parent 71520cd commit 122c00b

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

docs/source/about/changelog.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Unreleased
1818
**Added**
1919
- :pull:`1113` - Added ``reactpy.ReactPy`` that can be used to run ReactPy in standalone mode.
2020
- :pull:`1113` - Added ``reactpy.ReactPyMiddleware`` that can be used to run ReactPy with any ASGI compatible framework.
21-
- :pull:`1113` - Added ``reactpy.ReactPyMiddleware`` that can be used to run ReactPy with any ASGI compatible framework.
22-
- :pull:`1113` - Added ``uvicorn`` and ``jinja`` installation extras (for example ``pip install reactpy[uvicorn,jinja]``).
21+
- :pull:`1113` - Added ``reactpy.jinja.Component`` that can be used alongside ``ReactPyMiddleware`` to embed several ReactPy components into your existing application.
22+
- :pull:`1113` - Added ``standard``, ``uvicorn``, ``jinja`` installation extras (for example ``pip install reactpy[standard]``).
2323
- :pull:`1113` - Added support for Python 3.12 and 3.13.
2424

2525
**Changed**

docs/source/guides/escape-hatches/distributing-javascript.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ loaded with :func:`~reactpy.web.module.export`.
188188
189189
.. note::
190190

191-
When :data:`reactpy.config.REACTPY_DEBUG_MODE` is active, named exports will be validated.
191+
When :data:`reactpy.config.REACTPY_DEBUG` is active, named exports will be validated.
192192

193193
The remaining files that we need to create are concerned with creating a Python package.
194194
We won't cover all the details here, so refer to the Setuptools_ documentation for

docs/source/guides/getting-started/running-reactpy.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,29 +103,29 @@ Running ReactPy in Debug Mode
103103
-----------------------------
104104

105105
ReactPy provides a debug mode that is turned off by default. This can be enabled when you
106-
run your application by setting the ``REACTPY_DEBUG_MODE`` environment variable.
106+
run your application by setting the ``REACTPY_DEBUG`` environment variable.
107107

108108
.. tab-set::
109109

110110
.. tab-item:: Unix Shell
111111

112112
.. code-block::
113113
114-
export REACTPY_DEBUG_MODE=1
114+
export REACTPY_DEBUG=1
115115
python my_reactpy_app.py
116116
117117
.. tab-item:: Command Prompt
118118

119119
.. code-block:: text
120120
121-
set REACTPY_DEBUG_MODE=1
121+
set REACTPY_DEBUG=1
122122
python my_reactpy_app.py
123123
124124
.. tab-item:: PowerShell
125125

126126
.. code-block:: powershell
127127
128-
$env:REACTPY_DEBUG_MODE = "1"
128+
$env:REACTPY_DEBUG = "1"
129129
python my_reactpy_app.py
130130
131131
.. danger::

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ artifacts = []
7676

7777
[project.optional-dependencies]
7878
all = ["reactpy[jinja,uvicorn,testing]"]
79+
standard = ["reactpy[jinja,uvicorn]"]
7980
jinja = ["jinja2-simple-tags", "jinja2 >=3"]
8081
uvicorn = ["uvicorn[standard]"]
8182
testing = ["playwright"]

src/js/packages/@reactpy/client/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ export * from "./mount";
44
export * from "./types";
55
export * from "./vdom";
66
export * from "./websocket";
7+
export { default as React } from "preact/compat";
8+
export { default as ReactDOM } from "preact/compat";

src/reactpy/jinja.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from reactpy.utils import render_mount_template
77

88

9-
class ReactPyTemplateTag(StandaloneTag): # type: ignore
9+
class Component(StandaloneTag): # type: ignore
1010
"""This allows enables a `component` tag to be used in any Jinja2 rendering context,
1111
as long as this template tag is registered as a Jinja2 extension."""
1212

tests/test_asgi/test_middleware.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# ruff: noqa: S701
22
import asyncio
3-
import os
43
from pathlib import Path
54

65
import pytest
@@ -20,7 +19,7 @@ async def display(page):
2019
templates = Jinja2Templates(
2120
env=JinjaEnvironment(
2221
loader=JinjaFileSystemLoader("tests/templates"),
23-
extensions=["reactpy.jinja.ReactPyTemplateTag"],
22+
extensions=["reactpy.jinja.Component"],
2423
)
2524
)
2625

@@ -60,7 +59,7 @@ async def test_unregistered_root_component():
6059
templates = Jinja2Templates(
6160
env=JinjaEnvironment(
6261
loader=JinjaFileSystemLoader("tests/templates"),
63-
extensions=["reactpy.jinja.ReactPyTemplateTag"],
62+
extensions=["reactpy.jinja.Component"],
6463
)
6564
)
6665

0 commit comments

Comments
 (0)