Repository navigation
fix: isolate request state and complete HTMX todo CRUD - #16
Closed
WilliamRagstad wants to merge 1 commit into
Closed
WilliamRagstad wants to merge 1 commit into
WilliamRagstad wants to merge 1 commit into
Conversation
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.
Superseded by #15, which now contains the HTMX todo example and is rebased onto main.
The todo example now uses HTMX for every client/server interaction:
hx-getloads the list and edit forms,hx-postcreates,hx-putupdates, andhx-deletedeletes. Synchronous server functions return escaped HTML fragments forhx-target/hx-swap, including validation messages. The page loads pinned HTMX 2.0.8 with an integrity hash. A smallhtmx:configRequesthook places form values in URL segments, andhx-params="none"avoids relying on unsupported body decoding.This completes the runtime/example stage after the harness, routing, and reload changes now on main, replacing closed #15. Refs #4. It also includes request-local function bindings, handler-chain fixes, graceful error handling, concurrency coverage, and the documented runtime contract. Module globals intentionally remain shared application state; JavaScript execution remains serialized.
Validation:
cargo fmt --check,cargo build --locked, andcargo test --locked: 12 tests passed, including the HTTP CRUD lifecycle, HTML fragment controls, title escaping, rejected mutations, and concurrent requests in dev/prod.HX-Request: true; write requests had empty form bodies. HTML-like, quoted, slash-containing, and Unicode titles rendered correctly without HTML injection.Request/body behavior, the CDN dependency, in-memory state, and remaining runtime limitations are documented in
examples/todo/README.mdanddocs/runtime.md.