Conform action utils
Run locally for transcripts
๐จโ๐ผ Great! I'm already feeling safer.
๐ฆ Did you look at the
submission
object? Here's an example:{
"status": "error",
"submission": {
"intent": "submit",
"payload": {
"title": "Basic Koala Facts",
"content": ""
},
"error": {
"content": "Required"
}
}
}
Why do you suppose it needs to include the
intent
and payload
? Don't we
already have that information? Yes, we do. But if we're thinking about
progressive enhancement, then we need to consider the fact that when the user
submits their form, they're sending some data to our server. Because there's no
JS on the page to handle the submission, this will be a full-page reload. If
there's an error, we want to render the same page again and we want to render
the error with the data they submitted. The only way we can do this is if we
include the data in our response.It is possible we could optimize this a bit
(here's an idea), but it's
really cool that we don't have to worry about this. Before bringing in Conform,
this didn't work at all. Now it works out of the box... Or at least it will once
we implement the UI side of conform.
๐จโ๐ผ Yeah! Let's get to that.