Skip to content

Commit 922fa89

Browse files
committed
v2.0.0b9
1 parent 860d403 commit 922fa89

File tree

5 files changed

+221
-2
lines changed

5 files changed

+221
-2
lines changed

CHANGELOG.md

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
<!--
8+
Using the following categories, list your changes in this order:
9+
[Added, Changed, Deprecated, Removed, Fixed, Security]
10+
11+
Don't forget to remove deprecated code on each major release!
12+
-->
13+
14+
## [Unreleased]
15+
16+
### Added
17+
18+
- Added support for Python 3.12, 3.13, and 3.14.
19+
- Added type hints to `reactpy.html` attributes.
20+
- Added support for nested components in web modules
21+
- Added support for inline JavaScript as event handlers or other attributes that expect a callable via `reactpy.types.InlineJavaScript`
22+
- Event functions can now call `event.preventDefault()` and `event.stopPropagation()` methods directly on the event data object, rather than using the `@event` decorator.
23+
- Event data now supports accessing properties via dot notation (ex. `event.target.value`).
24+
- Added `reactpy.types.Event` to provide type hints for the standard `data` function argument (for example `def on_click(event: Event): ...`).
25+
- Added `asgi` and `jinja` installation extras (for example `pip install reactpy[asgi, jinja]`).
26+
- Added `reactpy.executors.asgi.ReactPy` that can be used to run ReactPy in standalone mode via ASGI.
27+
- Added `reactpy.executors.asgi.ReactPyCsr` that can be used to run ReactPy in standalone mode via ASGI, but rendered entirely client-sided.
28+
- Added `reactpy.executors.asgi.ReactPyMiddleware` that can be used to utilize ReactPy within any ASGI compatible framework.
29+
- 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 %}`.
30+
- Added `reactpy.pyscript_component` that can be used to embed ReactPy components into your existing application.
31+
- Added `reactpy.use_async_effect` hook.
32+
- Added `reactpy.Vdom` primitive interface for creating VDOM dictionaries.
33+
- Added `reactpy.reactjs.component_from_file` to import ReactJS components from a file.
34+
- Added `reactpy.reactjs.component_from_url` to import ReactJS components from a URL.
35+
- Added `reactpy.reactjs.component_from_string` to import ReactJS components from a string.
36+
- Added `reactpy.reactjs.component_from_npm` to import ReactJS components from NPM.
37+
- Added `reactpy.h` as a shorthand alias for `reactpy.html`.
38+
39+
### Changed
40+
41+
- The `key` attribute is now stored within `attributes` in the VDOM spec.
42+
- Substitute client-side usage of `react` with `preact`.
43+
- Script elements no longer support behaving like effects. They now strictly behave like plain HTML scripts.
44+
- The `reactpy.html` module has been modified to allow for auto-creation of any HTML nodes. For example, you can create a `<data-table>` element by calling `html.data_table()`.
45+
- Change `set_state` comparison method to check equality with `==` more consistently.
46+
- Add support for rendering `@component` children within `vdom_to_html`.
47+
- Renamed the `use_location` hook's `search` attribute to `query_string`.
48+
- Renamed the `use_location` hook's `pathname` attribute to `path`.
49+
- Renamed `reactpy.config.REACTPY_DEBUG_MODE` to `reactpy.config.REACTPY_DEBUG`.
50+
- ReactPy no longer auto-converts `snake_case` props to `camelCase`. It is now the responsibility of the user to ensure that props are in the correct format.
51+
- Rewrite the `event-to-object` package to be more robust at handling properties on events.
52+
- Custom JS components will now automatically assume you are using ReactJS in the absence of a `bind` function.
53+
- Refactor layout rendering logic to improve readability and maintainability.
54+
- `@reactpy/client` now exports `React` and `ReactDOM`.
55+
- `reactpy.html` will now automatically flatten lists recursively (ex. `reactpy.html(["child1", ["child2"]])`)
56+
- `reactpy.utils.reactpy_to_string` will now retain the user's original casing for `data-*` and `aria-*` attributes.
57+
- `reactpy.utils.string_to_reactpy` has been upgraded to handle more complex scenarios without causing ReactJS rendering errors.
58+
- `reactpy.core.vdom._CustomVdomDictConstructor` has been moved to `reactpy.types.CustomVdomConstructor`.
59+
- `reactpy.core.vdom._EllipsisRepr` has been moved to `reactpy.types.EllipsisRepr`.
60+
- `reactpy.types.VdomDictConstructor` has been renamed to `reactpy.types.VdomConstructor`.
61+
- `REACTPY_ASYNC_RENDERING` can now de-duplicate and cascade renders where necessary.
62+
- `REACTPY_ASYNC_RENDERING` is now defaulted to `True` for up to 40x performance improvements in environments with high concurrency.
63+
64+
### Deprecated
65+
66+
- `reactpy.web.module_from_file` is deprecated. Use `reactpy.reactjs.component_from_file` instead.
67+
- `reactpy.web.module_from_url` is deprecated. Use `reactpy.reactjs.component_from_url` instead.
68+
- `reactpy.web.module_from_string` is deprecated. Use `reactpy.reactjs.component_from_string` instead.
69+
- `reactpy.web.export` is deprecated. Use `reactpy.reactjs.component_from_*` instead.
70+
- `reactpy.web.*` is deprecated. Use `reactpy.reactjs.*` instead.
71+
72+
### Removed
73+
74+
- Removed support for Python 3.9 and 3.10.
75+
- Removed the ability to import `reactpy.html.*` elements directly. You must now call `html.*` to access the elements.
76+
- Removed backend specific installation extras (such as `pip install reactpy[starlette]`).
77+
- Removed support for async functions within `reactpy.use_effect` hook. Use `reactpy.use_async_effect` instead.
78+
- Removed deprecated function `module_from_template`.
79+
- Removed deprecated exception type `reactpy.core.serve.Stop`.
80+
- Removed deprecated component `reactpy.widgets.hotswap`.
81+
- Removed `reactpy.sample` module.
82+
- Removed `reactpy.svg` module. Contents previously within `reactpy.svg.*` can now be accessed via `reactpy.html.svg.*`.
83+
- Removed `reactpy.html._` function. Use `reactpy.html(...)` or `reactpy.html.fragment(...)` instead.
84+
- Removed `reactpy.run`. See the documentation for the new method to run ReactPy applications.
85+
- Removed `reactpy.backend.*`. See the documentation for the new method to run ReactPy applications.
86+
- Removed `reactpy.core.types` module. Use `reactpy.types` instead.
87+
- Removed `reactpy.utils.html_to_vdom`. Use `reactpy.utils.string_to_reactpy` instead.
88+
- Removed `reactpy.utils.vdom_to_html`. Use `reactpy.utils.reactpy_to_string` instead.
89+
- Removed `reactpy.vdom`. Use `reactpy.Vdom` instead.
90+
- Removed `reactpy.core.make_vdom_constructor`. Use `reactpy.Vdom` instead.
91+
- Removed `reactpy.core.custom_vdom_constructor`. Use `reactpy.Vdom` instead.
92+
- Removed `reactpy.Layout` top-level re-export. Use `reactpy.core.layout.Layout` instead.
93+
- Removed `reactpy.types.LayoutType`. Use `reactpy.types.BaseLayout` instead.
94+
- Removed `reactpy.types.ContextProviderType`. Use `reactpy.types.ContextProvider` instead.
95+
- Removed `reactpy.core.hooks._ContextProvider`. Use `reactpy.types.ContextProvider` instead.
96+
- Removed `reactpy.web.utils`. Use `reactpy.reactjs.utils` instead.
97+
98+
### Fixed
99+
100+
- Fixed a bug where script elements would not render to the DOM as plain text.
101+
- Fixed a bug where the `key` property provided within server-side ReactPy code was failing to propagate to the front-end JavaScript components.
102+
- Fixed a bug where `RuntimeError("Hook stack is in an invalid state")` errors could be generated when using a webserver that reuses threads.
103+
- Allow for ReactPy and ReactJS components to be arbitrarily inserted onto the page with any possible hierarchy.
104+
105+
## [1.1.0] - 2024-11-24
106+
107+
### Fixed
108+
109+
- Fixed broken `module_from_template` due to a recent release of `requests`.
110+
- Fixed `module_from_template` not working when using Flask backend.
111+
- Fixed `UnicodeDecodeError` when using `reactpy.web.export`.
112+
- Fixed needless unmounting of JavaScript components during each ReactPy render.
113+
- Fixed missing `event["target"]["checked"]` on checkbox inputs.
114+
- Fixed missing static files on `sdist` Python distribution.
115+
116+
### Added
117+
118+
- Allow concurrently rendering discrete component trees - enable this experimental feature by setting `REACTPY_ASYNC_RENDERING=true`. This improves the overall responsiveness of your app in situations where larger renders would otherwise block smaller renders from executing.
119+
120+
### Changed
121+
122+
- Previously `None`, when present in an HTML element, would render as the string `"None"`. Now `None` will not render at all. This is now equivalent to how `None` is handled when returned from components.
123+
- Move hooks from `reactpy.backend.hooks` into `reactpy.core.hooks`.
124+
125+
### Deprecated
126+
127+
- The `Stop` exception. Recent releases of `anyio` have made this exception difficult to use since it now raises an `ExceptionGroup`. This exception was primarily used for internal testing purposes and so is now deprecated.
128+
- Deprecate `reactpy.backend.hooks` since the hooks have been moved into `reactpy.core.hooks`.
129+
130+
## [1.0.2] - 2023-07-03
131+
132+
### Fixed
133+
134+
- Fix rendering bug when children change positions.
135+
136+
## [1.0.1] - 2023-06-16
137+
138+
### Changed
139+
140+
- Warn and attempt to fix missing mime types, which can result in `reactpy.run` not working as expected.
141+
- Rename `reactpy.backend.BackendImplementation` to `reactpy.backend.BackendType`.
142+
- Allow `reactpy.run` to fail in more predictable ways.
143+
144+
### Fixed
145+
146+
- Better traceback for JSON serialization errors.
147+
- Explain that JS component attributes must be JSON.
148+
- Fix `reactpy.run` port assignment sometimes attaching to in-use ports on Windows.
149+
- Fix `reactpy.run` not recognizing `fastapi`.
150+
151+
## [1.0.0] - 2023-03-14
152+
153+
### Changed
154+
155+
- Reverts PR 841 as per the conclusion in discussion 916, but preserves the ability to declare attributes with snake_case.
156+
- Reverts PR 886 due to issue 896.
157+
- Revamped element constructor interface. Now instead of passing a dictionary of attributes to element constructors, attributes are declared using keyword arguments. For example, instead of writing:
158+
159+
### Deprecated
160+
161+
- Declaration of keys via keyword arguments in standard elements. A script has been added to automatically convert old usages where possible.
162+
163+
### Removed
164+
165+
- Accidental import of reactpy.testing.
166+
167+
### Fixed
168+
169+
- Minor issues with camelCase rewrite CLI utility.
170+
- Minor type hint issue with `VdomDictConstructor`.
171+
- Stale event handlers after disconnect/reconnect cycle.
172+
- Fixed CLI not registered as entry point.
173+
- Unification of component and VDOM constructor interfaces.
174+
175+
[Unreleased]: https://github.com/reactive-python/reactpy/compare/reactpy-v1.1.0...HEAD
176+
[1.1.0]: https://github.com/reactive-python/reactpy/compare/reactpy-v1.0.2...reactpy-v1.1.0
177+
[1.0.2]: https://github.com/reactive-python/reactpy/compare/reactpy-v1.0.1...reactpy-v1.0.2
178+
[1.0.1]: https://github.com/reactive-python/reactpy/compare/reactpy-v1.0.0...reactpy-v1.0.1
179+
[1.0.0]: https://github.com/reactive-python/reactpy/compare/0.44.0...reactpy-v1.0.0
180+
[0.44.0]: https://github.com/reactive-python/reactpy/compare/0.43.0...0.44.0
181+
[0.43.0]: https://github.com/reactive-python/reactpy/compare/0.42.0...0.43.0
182+
[0.42.0]: https://github.com/reactive-python/reactpy/compare/0.41.0...0.42.0
183+
[0.41.0]: https://github.com/reactive-python/reactpy/compare/0.40.2...0.41.0
184+
[0.40.2]: https://github.com/reactive-python/reactpy/compare/0.40.1...0.40.2
185+
[0.40.1]: https://github.com/reactive-python/reactpy/compare/0.40.0...0.40.1
186+
[0.40.0]: https://github.com/reactive-python/reactpy/compare/0.39.0...0.40.0
187+
[0.39.0]: https://github.com/reactive-python/reactpy/compare/0.38.1...0.39.0
188+
[0.38.1]: https://github.com/reactive-python/reactpy/compare/0.38.0...0.38.1
189+
[0.38.0]: https://github.com/reactive-python/reactpy/compare/0.37.2...0.38.0
190+
[0.37.2]: https://github.com/reactive-python/reactpy/compare/0.37.1...0.37.2
191+
[0.37.1]: https://github.com/reactive-python/reactpy/compare/0.37.0...0.37.1
192+
[0.37.0]: https://github.com/reactive-python/reactpy/compare/0.36.3...0.37.0
193+
[0.36.3]: https://github.com/reactive-python/reactpy/compare/0.36.2...0.36.3
194+
[0.36.2]: https://github.com/reactive-python/reactpy/compare/0.36.1...0.36.2
195+
[0.36.1]: https://github.com/reactive-python/reactpy/compare/0.36.0...0.36.1
196+
[0.36.0]: https://github.com/reactive-python/reactpy/compare/0.35.4...0.36.0
197+
[0.35.4]: https://github.com/reactive-python/reactpy/compare/0.35.3...0.35.4
198+
[0.35.3]: https://github.com/reactive-python/reactpy/compare/0.35.2...0.35.3
199+
[0.35.2]: https://github.com/reactive-python/reactpy/compare/0.35.1...0.35.2
200+
[0.35.1]: https://github.com/reactive-python/reactpy/compare/0.35.0...0.35.1
201+
[0.35.0]: https://github.com/reactive-python/reactpy/compare/0.34.0...0.35.0
202+
[0.34.0]: https://github.com/reactive-python/reactpy/compare/0.33.3...0.34.0
203+
[0.33.3]: https://github.com/reactive-python/reactpy/compare/0.33.2...0.33.3
204+
[0.33.2]: https://github.com/reactive-python/reactpy/compare/0.33.1...0.33.2
205+
[0.33.1]: https://github.com/reactive-python/reactpy/compare/0.33.0...0.33.1
206+
[0.33.0]: https://github.com/reactive-python/reactpy/compare/0.32.0...0.33.0
207+
[0.32.0]: https://github.com/reactive-python/reactpy/compare/0.31.0...0.32.0
208+
[0.31.0]: https://github.com/reactive-python/reactpy/compare/0.30.1...0.31.0
209+
[0.30.1]: https://github.com/reactive-python/reactpy/compare/0.30.0...0.30.1
210+
[0.30.0]: https://github.com/reactive-python/reactpy/compare/0.29.0...0.30.0
211+
[0.29.0]: https://github.com/reactive-python/reactpy/compare/0.28.0...0.29.0
212+
[0.28.0]: https://github.com/reactive-python/reactpy/compare/0.27.0...0.28.0
213+
[0.27.0]: https://github.com/reactive-python/reactpy/compare/0.26.0...0.27.0
214+
[0.26.0]: https://github.com/reactive-python/reactpy/compare/0.25.0...0.26.0
215+
[0.25.0]: https://github.com/reactive-python/reactpy/compare/0.24.0...0.25.0
216+
[0.24.0]: https://github.com/reactive-python/reactpy/compare/0.23.1...0.24.0
217+
[0.23.1]: https://github.com/reactive-python/reactpy/compare/0.23.0...0.23.1
218+
[0.23.0]: https://github.com/reactive-python/reactpy/releases/tag/0.23.0

docs/source/about/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.. THIS CHANGELOG HAS BEEN DEPRECATED. SEE TOP LEVEL CHANGELOG.md FILE INSTEAD. ---
12
Changelog
23
=========
34

src/js/bun.lockb

784 Bytes
Binary file not shown.

src/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"json-pointer": "^0.6.2",
1313
"@types/json-pointer": "^1.0.34",
1414
"@reactpy/client": "file:./packages/@reactpy/client",
15-
"event-to-object": "^1.0.1"
15+
"event-to-object": "2.0.0"
1616
},
1717
"devDependencies": {
1818
"@eslint/js": "^9.39.1",

src/reactpy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from reactpy.utils import Ref, reactpy_to_string, string_to_reactpy
2424

2525
__author__ = "The Reactive Python Team"
26-
__version__ = "2.0.0b8"
26+
__version__ = "2.0.0b9"
2727

2828
__all__ = [
2929
"Ref",

0 commit comments

Comments
 (0)