News for hackers. Stuff that matters.
Re:Intercooler.js – Making AJAX as easy as anchor tags by zackmorris on Monday November 07, 2016 @11:48AM (#12892467)
Cool I hadn't heard about server-sent events. They look straightforward enough, my main concern is that the separator between messages is two newlines. It would have been better if they used an arbitrary boundary string like in multipart/form-data to be symmetric with traditional form data, so that a pseudorandom string/md5/sha could be used to separate binary data segments (especially when the contents and their length were not known in advance):

http://stackoverflow.com/questions/3508338/what-is-the-bound...

Now unfortunately there will be a requirement client-side to decode binary data or strings with escaped newlines. We'll get the benefit of deterministic behavior at the cost of escaping payloads, and I'm not certain it's worth it.

This seems like an opportunity lost to me. Big enough that this may be one of the basic building blocks we skipped over in the rush to javascript. Maybe the community could wrap this to look like a client-side form until there is a standard.

Re:Intercooler.js – Making AJAX as easy as anchor tags by jkarneges on Monday November 07, 2016 @12:23PM (#12892811)
The browser EventSource API handles decoding, so there shouldn't be a need for browser client code to worry about it if that's the concern.