Skip to content

Commit c5e8437

Browse files
authored
Small tweaks to v2 to encourage simplicity (#1297)
1 parent 6ee7fe0 commit c5e8437

File tree

14 files changed

+26
-30
lines changed

14 files changed

+26
-30
lines changed

docs/source/about/changelog.rst

Lines changed: 6 additions & 6 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.
@@ -74,7 +74,7 @@ Unreleased
7474
- :pull:`1113` - Removed ``reactpy.core.types`` module. Use ``reactpy.types`` instead.
7575
- :pull:`1278` - Removed ``reactpy.utils.html_to_vdom``. Use ``reactpy.utils.string_to_reactpy`` instead.
7676
- :pull:`1278` - Removed ``reactpy.utils.vdom_to_html``. Use ``reactpy.utils.reactpy_to_string`` instead.
77-
- :pull:`1113` - All backend related installation extras (such as ``pip install reactpy[starlette]``) have been removed.
77+
- :pull:`1113` - Removed backend specific installation extras (such as ``pip install reactpy[starlette]``).
7878
- :pull:`1113` - Removed deprecated function ``module_from_template``.
7979
- :pull:`1113` - Removed support for Python 3.9.
8080
- :pull:`1264` - Removed support for async functions within ``reactpy.use_effect`` hook. Use ``reactpy.use_async_effect`` instead.
@@ -85,8 +85,8 @@ Unreleased
8585
**Fixed**
8686

8787
- :pull:`1239` - Fixed a bug where script elements would not render to the DOM as plain text.
88-
- :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.
89-
- :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.
88+
- :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.
89+
- :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.
9090

9191
v1.1.0
9292
------

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ 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]"]
47-
testing = ["playwright"]
46+
testing = ["playwright", "uvicorn[standard]"]
4847

4948
[tool.hatch.version]
5049
path = "src/reactpy/__init__.py"

src/js/bun.lockb

-5.05 KB
Binary file not shown.
-617 Bytes
Binary file not shown.
-72 Bytes
Binary file not shown.
-392 Bytes
Binary file not shown.
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: 2 additions & 2 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,
@@ -88,7 +88,7 @@ def match_dispatch_path(self, scope: AsgiWebsocketScope) -> bool: # nocov
8888
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: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
# ruff: noqa: 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

0 commit comments

Comments
 (0)