3 ms·
Yeah, a core idea of intercooler is to take the original web architecture seriously and not try to shoe-horn 90's style client/server architecture into the web:
by carsongross 10y ago
Yeah, a core idea of intercooler is to take the original web architecture seriously and not try to shoe-horn 90's style client/server architecture into the web:
http://intercoolerjs.org/docs.html#philosophy http://intercoolerjs.org/docs.html#philosophy
I'm looking to add server-side event support in the next month or so, which would give us a nice way to implement push-based updates:
https://github.com/LeadDyno/intercooler-js/issues/131 https://github.com/LeadDyno/intercooler-js/issues/131
I'm working on a demo chat UI myself, so I will be motivated to add it soon. :)
- david-given 10y agoWith the addition of server push this would be an ideal tool for a web game I've been vaguely working on --- I keep getting lost in a maze of client/server code. With intercooler it may just all go away. (I was unaware of EventSource. It looks so, so much nicer to use than raw WebSockets...) As an aside: Intercooler obviously requires Javascript to work; is there any fallback if Javascript's not available? It sounds like, at least for interactions on things like form buttons, it ought to be possible to send an old fashioned POST to the server which rerenders the entire page.
- zackmorris 10y agoCool 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-boundary-in-multipart-form-data 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.
- jkarneges 10y agoThe 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.