Repository navigation
fix: isolate request state and complete HTMX todo CRUD - #15
Merged
Merged
Conversation
WilliamRagstad
changed the base branch from
codex/html-reload-20261025
to
main
October 26, 2026 07:48
WilliamRagstad
force-pushed
the
codex/runtime-isolation-todo-20261025
branch
from
October 26, 2026 07:48
baffecf to
46f01fb
Compare
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.
The todo example defines CRUD logic directly in inline endpoint blocks and uses HTMX for all client/server interaction. PUT now uses
put /todos/(id: String) form(title: String, completed: Boolean): the edit form submits named fields in anapplication/x-www-form-urlencodedbody to/todos/{id}. It no longer rewrites PUT values into URL segments. Unchecked completion binds as false. POST retains its existing URL-based creation route.The form declaration follows the parser's documented syntax, and HTMX submission follows its official form-parameter documentation. HTTP tasks collect bounded bodies asynchronously before dispatch, including chunked uploads, so slow uploads do not block the JavaScript actor. Declared String and Boolean/Bool fields become request-local bindings before pre-handlers and inline endpoint execution. Malformed, duplicate, missing, or conflicting inputs return 400; unsupported media types return 415. Bodies are capped at 64 KiB and ten seconds (413/408). JSON, multipart uploads, models, and other form field types remain unsupported and are documented.
globalcontains shared todo state and three reusable rendering/escaping helpers. Endpoint return values become responses or post-handlerout; locals never become persistent globals. HTMX swaps escaped HTML fragments and application validation messages. Module globals remain intentional shared state, and JavaScript execution remains serialized. Refs #4.Validation:
cargo fmt --check,cargo build --locked --offline, andcargo test --locked --offline: 15 tests passed./todos/1, including omission of the unchecked checkbox. Clean shutdown verified.The example README includes the PUT declaration and curl body examples;
docs/runtime.mddescribes supported request behavior and runtime limitations.