Replies: 2 comments
-
Another way of writing it: <form>
<textarea name="code" class="code"></textarea>
<div class="reply"></div>
<button hx-include="previous .code" hx-get="/evaluator" hx-target="previous .reply" class="">Run</button>
</form> This fixes the |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think below is where we could pay attention to the Lines 49 to 55 in 6180ad2 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Example
Here's a simple "put in some code and see the reply below" form. The evaluator is pure (for a subset of Haskell), and therefore a POST/PUT is not correct, a GET is, and the result should be cached (because it will never change). That's all good. I can achieve that with
hx-include
, as seen below.Current behavior
As it stands, I can only specify
preload="mousedown"
, but two things happen:hx-include
is ignored (presumably because nobody expected I'd be trying to preload a form!)Desired behavior
It's not super important to me that when a user clicks "Run" that it immediately shows a result, it just adds to an overall feeling of snappiness. But, it seems worth discussing.
Evaluation is cheap and quick, but the latency hit can only be mitigated by preloading.
What would be nice is to specify, e.g.
What do you think?
Related links
As it happens, there is an RFC to add a
QUERY
method which would effectively be aGET
that lets you submit a body to it, which would be a lovely use-case for this kind of end-point. However, it's only an RFC.Beta Was this translation helpful? Give feedback.
All reactions