Skip to content

Commit 8dba3d3

Browse files
committed
Changes to v2 to encourage docs simplicity
1 parent 9a02db4 commit 8dba3d3

File tree

10 files changed

+27
-31
lines changed

10 files changed

+27
-31
lines changed

docs/source/about/changelog.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Unreleased
1818
**Added**
1919

2020
- :pull:`1113` - Added ``reactpy.executors.asgi.ReactPy`` that can be used to run ReactPy in standalone mode via ASGI.
21-
- :pull:`1269` - Added ``reactpy.executors.asgi.ReactPyPyodide`` that can be used to run ReactPy in standalone mode via ASGI, but rendered entirely client-sided.
21+
- :pull:`1269` - Added ``reactpy.executors.asgi.ReactPyCsr`` that can be used to run ReactPy in standalone mode via ASGI, but rendered entirely client-sided.
2222
- :pull:`1113` - Added ``reactpy.executors.asgi.ReactPyMiddleware`` that can be used to utilize ReactPy within any ASGI compatible framework.
23-
- :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.templatetags.ReactPyJinja`` 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 %}``.
2424
- :pull:`1269` - Added ``reactpy.pyscript_component`` that can be used to embed ReactPy components into your existing application.
25-
- :pull:`1113` - Added ``uvicorn`` and ``jinja`` installation extras (for example ``pip install reactpy[jinja]``).
25+
- :pull:`1113` - Added ``asgi`` and ``jinja`` installation extras (for example ``pip install reactpy[asgi, jinja]``).
2626
- :pull:`1113` - Added support for Python 3.12 and 3.13.
2727
- :pull:`1264` - Added ``reactpy.use_async_effect`` hook.
2828
- :pull:`1267` - Added ``shutdown_timeout`` parameter to the ``reactpy.use_async_effect`` hook.
@@ -72,8 +72,8 @@ Unreleased
7272
**Fixed**
7373

7474
- :pull:`1239` - Fixed a bug where script elements would not render to the DOM as plain text.
75-
- :pull:`1271` - Fixed a bug where the ``key`` property provided via server-side ReactPy code was failing to propagate to the front-end JavaScript component.
76-
- :pull:`1254` - Fixed a bug where ``RuntimeError("Hook stack is in an invalid state")`` errors would be provided when using a webserver that reuses threads.
75+
- :pull:`1271` - Fixed a bug where the ``key`` property provided within server-side ReactPy code was failing to propagate to the front-end JavaScript components.
76+
- :pull:`1254` - Fixed a bug where ``RuntimeError("Hook stack is in an invalid state")`` errors could be generated when using a webserver that reuses threads.
7777

7878
v1.1.0
7979
------

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ urls.Documentation = "https://reactpy.dev/"
4040
urls.Source = "https://github.com/reactive-python/reactpy"
4141

4242
[project.optional-dependencies]
43-
all = ["reactpy[asgi,jinja,uvicorn,testing]"]
43+
all = ["reactpy[asgi,jinja,testing]"]
4444
asgi = ["asgiref", "asgi-tools", "servestatic", "orjson", "pip"]
4545
jinja = ["jinja2-simple-tags", "jinja2 >=3"]
46-
uvicorn = ["uvicorn[standard]"]
4746
testing = ["playwright"]
4847

4948
[tool.hatch.version]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from reactpy.executors.asgi.middleware import ReactPyMiddleware
2-
from reactpy.executors.asgi.pyscript import ReactPyPyscript
2+
from reactpy.executors.asgi.pyscript import ReactPyCsr
33
from reactpy.executors.asgi.standalone import ReactPy
44

5-
__all__ = ["ReactPy", "ReactPyMiddleware", "ReactPyPyscript"]
5+
__all__ = ["ReactPy", "ReactPyCsr", "ReactPyMiddleware"]

src/reactpy/executors/asgi/pyscript.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from reactpy.types import ReactPyConfig, VdomDict
2121

2222

23-
class ReactPyPyscript(ReactPy):
23+
class ReactPyCsr(ReactPy):
2424
def __init__(
2525
self,
2626
*file_paths: str | Path,
@@ -64,7 +64,7 @@ def __init__(
6464
are not applicable to CSR and will have no effect.
6565
"""
6666
ReactPyMiddleware.__init__(
67-
self, app=ReactPyPyscriptApp(self), root_components=[], **settings
67+
self, app=ReactpyPyscriptApp(self), root_components=[], **settings
6868
)
6969
if not file_paths:
7070
raise ValueError("At least one component file path must be provided.")
@@ -85,10 +85,10 @@ def match_dispatch_path(self, scope: AsgiWebsocketScope) -> bool: # nocov
8585

8686

8787
@dataclass
88-
class ReactPyPyscriptApp(ReactPyApp):
88+
class ReactpyPyscriptApp(ReactPyApp):
8989
"""ReactPy's standalone ASGI application for Client-Side Rendering (CSR) via PyScript."""
9090

91-
parent: ReactPyPyscript
91+
parent: ReactPyCsr
9292
_index_html = ""
9393
_etag = ""
9494
_last_modified = ""

src/reactpy/pyscript/component_template.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
# ruff: noqa: TC004, N802, N816, RUF006
1+
# ruff: noqa: N802, N816, RUF006
22
# type: ignore
3-
from typing import TYPE_CHECKING
3+
import asyncio
44

5-
if TYPE_CHECKING:
6-
import asyncio
7-
8-
from reactpy.pyscript.layout_handler import ReactPyLayoutHandler
5+
from reactpy.pyscript.layout_handler import ReactPyLayoutHandler
96

107

118
# User component is inserted below by regex replacement

src/reactpy/pyscript/layout_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
class ReactPyLayoutHandler:
14-
"""Encapsulate the entire layout handler with a class to prevent overlapping
14+
"""Encapsulate the entire PyScript layout handler with a class to prevent overlapping
1515
variable names between user code.
1616
1717
This code is designed to be run directly by PyScript, and is not intended to be run
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from reactpy.templatetags.jinja import Jinja
1+
from reactpy.templatetags.jinja import ReactPyJinja
22

3-
__all__ = ["Jinja"]
3+
__all__ = ["ReactPyJinja"]

src/reactpy/templatetags/jinja.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from reactpy.pyscript.utils import pyscript_component_html, pyscript_setup_html
88

99

10-
class Jinja(StandaloneTag): # type: ignore
10+
class ReactPyJinja(StandaloneTag): # type: ignore
1111
safe_output = True
1212
tags: ClassVar[set[str]] = {"component", "pyscript_component", "pyscript_setup"}
1313

tests/test_asgi/test_middleware.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async def display(page):
2222
templates = Jinja2Templates(
2323
env=JinjaEnvironment(
2424
loader=JinjaFileSystemLoader("tests/templates"),
25-
extensions=["reactpy.templatetags.Jinja"],
25+
extensions=["reactpy.templatetags.ReactPyJinja"],
2626
)
2727
)
2828

@@ -60,7 +60,7 @@ async def test_unregistered_root_component():
6060
templates = Jinja2Templates(
6161
env=JinjaEnvironment(
6262
loader=JinjaFileSystemLoader("tests/templates"),
63-
extensions=["reactpy.templatetags.Jinja"],
63+
extensions=["reactpy.templatetags.ReactPyJinja"],
6464
)
6565
)
6666

@@ -124,7 +124,7 @@ async def test_templatetag_bad_kwargs(page, caplog):
124124
templates = Jinja2Templates(
125125
env=JinjaEnvironment(
126126
loader=JinjaFileSystemLoader("tests/templates"),
127-
extensions=["reactpy.templatetags.Jinja"],
127+
extensions=["reactpy.templatetags.ReactPyJinja"],
128128
)
129129
)
130130

tests/test_asgi/test_pyscript.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
from starlette.templating import Jinja2Templates
1010

1111
from reactpy import html
12-
from reactpy.executors.asgi.pyscript import ReactPyPyscript
12+
from reactpy.executors.asgi.pyscript import ReactPyCsr
1313
from reactpy.testing import BackendFixture, DisplayFixture
1414

1515

1616
@pytest.fixture()
1717
async def display(page):
1818
"""Override for the display fixture that uses ReactPyMiddleware."""
19-
app = ReactPyPyscript(
19+
app = ReactPyCsr(
2020
Path(__file__).parent / "pyscript_components" / "root.py",
2121
initial=html.div({"id": "loading"}, "Loading..."),
2222
)
@@ -29,7 +29,7 @@ async def display(page):
2929
@pytest.fixture()
3030
async def multi_file_display(page):
3131
"""Override for the display fixture that uses ReactPyMiddleware."""
32-
app = ReactPyPyscript(
32+
app = ReactPyCsr(
3333
Path(__file__).parent / "pyscript_components" / "load_first.py",
3434
Path(__file__).parent / "pyscript_components" / "load_second.py",
3535
initial=html.div({"id": "loading"}, "Loading..."),
@@ -46,7 +46,7 @@ async def jinja_display(page):
4646
templates = Jinja2Templates(
4747
env=JinjaEnvironment(
4848
loader=JinjaFileSystemLoader("tests/templates"),
49-
extensions=["reactpy.templatetags.Jinja"],
49+
extensions=["reactpy.templatetags.ReactPyJinja"],
5050
)
5151
)
5252

@@ -93,7 +93,7 @@ async def test_multi_file_components(multi_file_display: DisplayFixture):
9393

9494
def test_bad_file_path():
9595
with pytest.raises(ValueError):
96-
ReactPyPyscript()
96+
ReactPyCsr()
9797

9898

9999
async def test_jinja_template_tag(jinja_display: DisplayFixture):

0 commit comments

Comments
 (0)