This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
Jim Nielsen did what he always does and shared some thoughts on the web platform. And he hit the nail on the head with "Browsers, JSON, and FormData".
So what's the current state of the web?
It's bloated with truckloads of JavaScript, and APIs power everything. APIs won't go anywhere, but we're all working on reducing JavaScript.
To drop some code while still relying on APIs, there are two options:
We need either 1) more APIs that speak FormData, or 2) browsers that speak JSON.
On point, Jim! On point. 💯
Think of it: isn't it wild that JSON APIs only work with JavaScript and Ajax because JSON requests aren't supported in HTML?
To put it bluntly: there’s no progressive enhancement if all your APIs only accept JSON payloads directly from the browser.
With the rise of all these APIs, we either have to rely on client-side JavaScript to talk to APIs directly or pipe everything through a serverless function. And we're so used to doing this that we don't even question it anymore.
The web platform is entirely broken in that sense if you ask me. And it's funny, because Jim dug up a spec that aimed to bring JSON into HTML. 😲
<form enctype='application/json'>
<input name='name' value='Bender'>
<select name='hind'>
<option selected>Bitable</option>
<option>Kickable</option>
</select>
<input type='checkbox' name='shiny' checked>
</form>
Unfortunately, the spec went nowhere...
But think of it: with JSON built into HTML forms, and View transitions coming up (formerly known as Shared Element Transistions), the web could really catch up and become the platform it needs to be these days.
Anyways, head over to Jim's blog; it's a good one, I promise!
Reply to Stefan
This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
Stefan Judis | Sciencx (2022-11-15T23:00:00+00:00) The missing bridge in web development – JSON forms (#note). Retrieved from https://www.scien.cx/2022/11/15/the-missing-bridge-in-web-development-json-forms-note/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.