4 ms·
Ajax without JavaScript. Ability to send a response from server updating only part of DOM. Basically, react with virtual DOM on the server pushing diffs to user
by gcoda 9y ago
Ajax without JavaScript.
Ability to send a response from server updating only part of DOM.
Basically, react with virtual DOM on the server pushing diffs to user with http2 awesomness.
There will be no need for JS on most sites, can be adapted to current frameworks, and with preload/prefetch it might be very fast.
* U can prefetch progress bar / loading state for example, and redirect to partial url of a real content
- Untit1ed 9y agoThat sounds awesome, but how could you do it without either: - Client sends the entirety of what it has to the server so the server can do the diff - Server sends the entirety of the new page to the client so it can do the diff - Server is constantly keeping track of the last thing that the user looked at so it can send the diff for the next page ?
- gcoda 9y agoAssuming: 1. Everything user sees is from server 2. Templates/Views is function of state Server can generate UI with baked changes to state. URL parameters. Generate html from received state by calling render function of clicked component and send just that components html. If we had http header for that we can leverage http2 push and replace even components which state were changed as side effect. React-Redux, Elm, Vuex doing this already. Just bake actions to urls and keep store on server.
- jlaporte 9y agoYou may be interested in intercooler.js (http://intercoolerjs.org/ http://intercoolerjs.org/). It allows you to perform a host of AJAX + DOM manipulation flows using only HTML attributes. intercooler also supports something similar to the server pushed DOM diff flow you envision: Server Sent Events BETA (http://intercoolerjs.org/docs.html#sse http://intercoolerjs.org/docs.html#sse) "Server Sent Events are an HTML5 technology allowing for a server to push content to an HTML client. They are simpler than WebSockets but are unidirectional, allowing a server to send push content to a browser only." http://intercoolerjs.org/docs.html#sse http://intercoolerjs.org/docs.html#sse
- gcoda 9y agoThats awesome, I was only aware of turbolinks. Sadly, I will never use it for real. I, like many other, spending some time to ensure server side rendering works, and web site can function without JS. If intercooler were part of browser, and not separate code it will be possible to adapt any SSR ready app to work with this.
- mvindahl 9y ago<iframe> already does something like that, although admittedly in a clunky fashion
- tdeck 9y agoCuriously half of what you're describing has already existed on the web for more than 20 years, in the form of server side push using the obscure `multipart/mixed` HTTP content type [1]. This technology was added to Netscape in 1995 and I believe it's still supported by modern browsers, but it seems to have hardly gotten much traction beyond those early webcam sites that an image every N seconds. I am not sure if interaction is possible as part of the mix using some tricks, though. It seems like we just have turbolinks for that. [1]: https://docstore.mik.ua/orelly/web2/xhtml/ch13_03.htm https://docstore.mik.ua/orelly/web2/xhtml/ch13_03.htm
- gcoda 9y agoWow! They got a x-mixed-replace. That's totally it. From quick googling - looks like it is not working for html since chrome 36 Edit: It works only with svg and only in Firefox, or am I doing something wrong?
- tdeck 9y agoGuess I was wrong about the support still being there. I think because nobody used it they must have taken out a lot of that functionality.