Repository navigation
Rewrite the docs - #1052
Open
Archmonger wants to merge 178 commits into
Open
Rewrite the docs#1052Archmonger wants to merge 178 commits into
Archmonger wants to merge 178 commits into
Conversation
rmorshea
reviewed
Jun 15, 2023
Handlers must be coroutines now, so each example hoists its one-liner into a named 'async def' (or a factory), reads event data with 'await event.<path>', and batches sibling reads through 'event.read(...)' or asyncio.gather so the round trip is paid once.
The event your handler receives is a live proxy, not a payload, so the pages which still described a serialized snapshot are rewritten around it: - handlers are coroutines, and the failure shapes are separated (coroutine object -> attribute fall-through -> orjson TypeError on send, vs. a real None from a non-handler); 'synchronous handler' and 'may be async def' leftovers in the state pages are gone - reads are awaited, batched with read()/gather, never subscripted; a missing await yields a truthy proxy rather than None, and hasattr() on a proxy always lies - debounce coalesces client->server events (it never paced server values), the server echo is the per-event _reactpy_ack_seq mapping, the target prefix is a key path and not the patch path, and the six model keys come from types.ALLOWED_VDOM_KEYS rather than the wire schema - partial with a bound leading argument defeats bytecode detection and changes the handler's arity - corrected in the handler page and the tutorial - client-api covers how handleIncoming answers event-proxy-request itself, and the stopImmediatePropagation wire key is documented
Archmonger
marked this pull request as ready for review
October 18, 2026 19:34
Scoped to projects that depend on the reactpy package: dropped the docs house-style section, PR/commit provenance, test-file and docs/examples citations, and the docs-authoring framing. Added the deployment and integration layer that was absent: install and extras, ASGI serving, all three executors with real signatures, Jinja tags, reactpy.reactjs npm components, custom ASGI wiring, config, debugging symptoms, and Layout-based testing. Corrected claims inherited from the previous revision against src/: no tuple handler-option form, handler bytecode is inspected for preventDefault/stopPropagation/debounce, debounce is client->server and input-only, attribute values are unvalidated in v2, Layout takes a component instance, and bare @use_effect does not infer dependencies.
The affected pages now teach the rules by what actually happens at runtime — shifted state slots, a silent stale dependency, an Effect that re-runs — and point at the Layout-based test that proves them, rather than at anything outside ReactPy.
Adds the deployment surface an external project needs (install and extras, ASGI serving, the three executors, Jinja, npm components, config, testing) and keeps only what a dependent project has to know. Corrects details against src/, several of them measured: no tuple handler-option form, preventDefault/stopPropagation/debounce are detected in handler bytecode, debounce is client-side and input-only, attribute values are unvalidated, Layout takes a component instance, and a bare @use_effect infers dependencies rather than pinning them.
- @use_effect: the decorator infers dependencies; it is not dependencies=[], and @use_effect() with empty parentheses re-runs every render (measured) - the async-def rejection message keeps its backticks, and its text reaches the model only under REACTPY_DEBUG; an effect-body error is logged at unmount, not at mount - use_async_effect does not validate that the effect is a coroutine - Location.query_string keeps the leading "?" the client forwards - the path_prefix ValueError quotes `path_prefix` with backticks - a component returns one value: return [a, b] renders the list repr
- Changed image URLs in various Python and HTML files to point to local assets instead of external links. - Updated paths in examples related to sculptures, components, and demos to ensure they reference the correct local image files. - Added a check in the build process to validate asset paths, preventing broken images due to incorrect relative paths.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Live preview: https://reactive-python.github.io/reactpy/
This PR is a rewrite of our documentation to imitate React's documentation. Additionally, this switches us from
sphinxtomkdocsas a documentation tool.Sections titles with a 🚧 symbol are still undeveloped.
Issues
use_contextdocs #845Potentially will cover