Skip to content

Commit 3286b99

Browse files
committed
docs: align the changelog with the live event proxy
1 parent 3fec485 commit 3286b99

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Don't forget to remove deprecated code on each major release!
1919
- Added type hints to `reactpy.html` attributes.
2020
- Added support for nested components in web modules
2121
- 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`).
22+
- Event functions can now call `event.preventDefault()`, `event.stopPropagation()`, and `event.stopImmediatePropagation()` methods directly on the event data object, rather than using the `@event` decorator.
23+
- Event data now supports accessing properties via dot notation (ex. `await event.target.value`).
2424
- Added support for partial functions in EventHandler
2525
- Added `reactpy.types.Event` to provide type hints for the standard `data` function argument (for example `async def on_click(event: Event): ...`).
2626
- Added `asgi` and `jinja` installation extras (for example `pip install reactpy[asgi, jinja]`).
@@ -40,10 +40,10 @@ Don't forget to remove deprecated code on each major release!
4040
- Events now support `debounce` and `throttle`, configurable per event via `event.debounce = <milliseconds>` and `EventHandler(fn, throttle=<milliseconds>)` respectively.
4141
- `debounce` waits until activity stops, then fires once. Default is 200 ms on `input`/`select`/`textarea`, 0 ms elsewhere.
4242
- `throttle` caps the rate how often an event is allowed to execute. No default; opt in per event.
43-
- Added a live event proxy which lets event handlers read properties from, and call methods on, the browser objects which triggered them rather than being limited to the snapshot sent along with the event.
44-
- A handler awaits what it needs (`await event.target.value`, `await event.target.focus()`).
45-
- The initial event is a snapshot of serializable event data; whatever the handler reaches past is an `EventProxy` describing where in the browser to look for it.
46-
- Live access is on unless a handler turns it off by assigning `event.eventProxy = False` inside its own body.
43+
- Added a live event proxy which lets event handlers read properties from, and call methods on, the browser objects which triggered them (ex. `await event.target.value`, `await event.target.focus()`) rather than being limited to whatever was serializable at the moment the event was dispatched.
44+
- Only an id and the event's `type` travel with the event. Whatever a handler reaches past is fetched from the browser on demand, one round trip at a time, and resolved against the object itself.
45+
- Properties which are in flight at the same moment go out as a single message, and `await event.read("target.value", "key")` reads several at once.
46+
- A read belongs to the moment it is awaited: it reports the current state of the browser object, not the state it held when the event was dispatched.
4747
- Unanswered requests are bounded by `reactpy.config.REACTPY_EVENT_PROXY_TIMEOUT`, `reactpy.config.REACTPY_EVENT_PROXY_MAX_TIMEOUTS`, and `reactpy.config.REACTPY_EVENT_PROXY_MAX_DEPTH`.
4848

4949
### Changed
@@ -88,7 +88,7 @@ Don't forget to remove deprecated code on each major release!
8888
- Removed deprecated function `module_from_template`.
8989
- Removed deprecated exception type `reactpy.core.serve.Stop`.
9090
- Removed deprecated component `reactpy.widgets.hotswap`.
91-
- Removed the `event-to-object` package. The serializable snapshot it produced is now produced by the client's own serializer, and is what a handler is handed unless it has asked for the live object behind the event (see the live event proxy above).
91+
- Removed the `event-to-object` package. The client no longer serializes an event when it dispatches one, so nothing was producing that snapshot any more (see the live event proxy above).
9292
- Removed `reactpy.sample` module.
9393
- Removed `reactpy.svg` module. Contents previously within `reactpy.svg.*` can now be accessed via `reactpy.html.svg.*`.
9494
- Removed `reactpy.html._` function. Use `reactpy.html(...)` or `reactpy.html.fragment(...)` instead.
@@ -113,6 +113,9 @@ Don't forget to remove deprecated code on each major release!
113113
- Fixed a bug where the `key` property provided within server-side ReactPy code was failing to propagate to the front-end JavaScript components.
114114
- Fixed a bug where `RuntimeError("Hook stack is in an invalid state")` errors could be generated when using a webserver that reuses threads.
115115
- Fixed a bug where events on controlled inputs (e.g. `html.input({"onChange": ...})`) could be lost during rapid actions.
116+
- Fixed a bug where a render which happened while an event handler was still running could write a stale value back over a controlled input, because the event which prompted it had been acknowledged before the handler was out of the way.
117+
- Fixed a bug where `event-proxy-response` messages were dropped by `reactpy.executors.asgi.ReactPyMiddleware` rather than being routed to the layout which asked for them, leaving every live event read to hang until it timed out.
118+
- Fixed a bug where a component could stop re-rendering for the rest of its life after a scheduled render was cancelled, since the internal 'a render is already scheduled' latch was never released.
116119
- Allow for ReactPy and ReactJS components to be arbitrarily inserted onto the page with any possible hierarchy.
117120

118121
## [1.1.0] - 2024-11-24

0 commit comments

Comments
 (0)