by bob1029 · 2y ago · 0 comments
A little bit of javascript/AJAX/etc is perfectly acceptable. We didn't get 100% of the way there with multipart/form because iOS/Safari exists and will crash hard if you try to post big forms.
You don't need ReactJS to submit a user input and avoid a page load. This is ~20 lines of vanilla javascript.
I find things like https://stackoverflow.com/questions/10195459/ios-safari-cras... and https://bugs.webkit.org/show_bug.cgi?id=84168, from 2012. Is that still an issue? I find it difficult to imagine you could have a bug that prevents you from submitting a form with even half a megabyte of data being allowed to last for long.
Yes. It is 100% still an issue. That is the exact bug I was looking at. I can get Safari on my latest gen iPad to crash hard after only 3 submissions pretty much every time. We are sending large images in our forms but it's only like 1-5 megabytes.
(I guess the size threshold has increased as device memory has increased.)
This tells me that very few developers are doing things "the old" way or otherwise questioning mainstream technology narratives.
I sometimes find myself wondering if multipart/form is going to be deprecated soon. If you look at the latest Azure Function isolated worker stack, this hasn't even been dealt with yet. I had to grab a 3rd party library to parse these submissions out of my request bodies.
If you have a fancy web socket use case, no problem - we got your back. Want to build a boring LOB business app? Better be ready to start shimming those HTTP post mechanisms.
There'd be a lot of "just a little bit of vanilla Javascript and CSS" sprinkled all over that'd all need to have state managed in a manual way that wouldn't be a meaningful improvement over React.
Like I said, I'm working on something where seemingly minute UI/UX details matter to the target user. So I can't just say "CSS and Vanilla JS don't support that without pulling teeth, it's a small thing, so I'm going to ignore it". Sometimes that's going to be a valid strategy and sometimes it's not.