Live data from Hacker News

API proposed by Chrome: Declarative partial updates

developer.chrome.com

41–48 of 48 posts

Re: API proposed by Chrome: Declarative partial updates

#41

Earlier quoted context omitted.

The Content-Encoding header allows any page to be a literal zip-bomb. That's how early versions of Tailwind worked; you'd deliver a 50KB Brotli payload that exploded into 2MB of CSS ( https://v1.tailwindcss.com/docs/controlling-file-size ). So pages potentially being zip-bombs is already a well-accepted part of the Web platform.

Sure, but how is this related to out of order streaming?

Here is some HTML content!

Before you couldn't make this dangerous (without JS) because there was no way to auto expand the templates

Re: API proposed by Chrome: Declarative partial updates

#42

Earlier quoted context omitted.

Sure, but how is this related to out of order streaming?

Here is some HTML content ! Before you couldn't make this dangerous (without JS) because there was no way to auto expand the templates

This would end up as:

Here is some HTML content!

(only the first matching marker set is replaced.

Re: API proposed by Chrome: Declarative partial updates

#43

Earlier quoted context omitted.

Here is some HTML content ! Before you couldn't make this dangerous (without JS) because there was no way to auto expand the templates

This would end up as: Here is some HTML content ! (only the first matching marker set is replaced.

So... you'll have to write Javascript that goes and replaces the additional markers with the stuff they're supposed to expand to? Because what I see there is just a state of partial evaluation, and that leads me to ask (and would lead anyone to ask) how evaluation of all substitutions can be completed...

Re: API proposed by Chrome: Declarative partial updates

#44

Earlier quoted context omitted.

This would end up as: Here is some HTML content ! (only the first matching marker set is replaced.

So... you'll have to write Javascript that goes and replaces the additional markers with the stuff they're supposed to expand to? Because what I see there is just a state of partial evaluation, and that leads me to ask (and would lead anyone to ask) how evaluation of all substitutions can be completed...

At the moment - you can treat it as a single "search & replace", and not as a replace all. And yes JS can do the rest atm. Hopefully introducing this (and processing instructions in general) can lead to additional enhancements in the future. But it would have to be gradual, kind of like how modern CSS evolved.

Re: API proposed by Chrome: Declarative partial updates

#45

Earlier quoted context omitted.

So... you'll have to write Javascript that goes and replaces the additional markers with the stuff they're supposed to expand to? Because what I see there is just a state of partial evaluation, and that leads me to ask (and would lead anyone to ask) how evaluation of all substitutions can be completed...

At the moment - you can treat it as a single "search & replace", and not as a replace all. And yes JS can do the rest atm. Hopefully introducing this (and processing instructions in general) can lead to additional enhancements in the future. But it would have to be gradual, kind of like how modern CSS evolved.

It just feels half-done. This seems to be a loose end left hanging because this is all rooted in theory and not in practice. In theory it doesn't matter if you have to polyfill half the builtin feature with JS because otherwise it doesn't work. In practice, yes it matters.

Re: API proposed by Chrome: Declarative partial updates

#46

Earlier quoted context omitted.

At the moment - you can treat it as a single "search & replace", and not as a replace all. And yes JS can do the rest atm. Hopefully introducing this (and processing instructions in general) can lead to additional enhancements in the future. But it would have to be gradual, kind of like how modern CSS evolved.

It just feels half-done. This seems to be a loose end left hanging because this is all rooted in theory and not in practice. In theory it doesn't matter if you have to polyfill half the builtin feature with JS because otherwise it doesn't work. In practice , yes it matters.

That's a valid opinion!

Re: API proposed by Chrome: Declarative partial updates

#47
Actually, declarative partial updates (HTML patching) have long been possible in every modern web browser without JS by using my Pure HTML Out-Of-Order Streaming (PHOOOS) technique based on Declarative Shadow DOM. You don't need another syntax with processing instructions. Demo: https://kraksped.pl/phooos/
Post reply on HN