Hacker News new | ask | show | jobs
by CMay 13 hours ago
We already have iframe and the srcdoc attribute which you can set directly to the document contents without pointing to an external url. So there's nothing new about that. This is primarily about serializing page content more efficiently than the naive approaches.

Advertisements are also generally content in iframes. The only difference here really is that you want the content to be blobs and embedded in the page rather than needing to be loaded from a URL.

You can design websites to be modular even without iframes or without this and many are. One thing to note is that looking at your website, you basically can't tell it apart from any other website. Because websites already effectively manage essentially the same result, but with assets shared across more of the page usually.

The point seems to be, a push to increase the adoption of a combined modularized serialized content approach beyond any scenarios where it's already used, to more closely tie the rich behaviors and the media itself into a single file.

Trust me, I get it. Macromedia Flash was neat. It was nice to have these modular little animation machines you could plop anywhere in a page and it was its own little world. An encapsulation that stood apart, but played nicely together with the rest of it. You also see something similar with the javascript flash players, or with the javascript decoders for image formats that web browser didn't support yet, they have to read the raw bytes and feed the image to the browser.

It's also similar to the difference between local variables and global variables in code. Yes, global variables can be reused a lot and there is some efficiency to be gained there in cases, but you can also simplify side effects by using local variables where you know exactly what can and cannot happen.

I don't think you need to present it as a new paradigm that defines the future on top of what already exists, because this isn't exactly new.

There are a few obvious issues, though. One is that you'll still have to do something about the content security headers and make sure any code inside the blob is allowed to run or even if its safe to run. The fact that it's harder to inspect in its serialized form can increase the amount of effort involved in evaluating whether you want to use it. It's also more effort to swap the content inside of it out, which is actually a cost you pay in making your content less modular at a lower granularity. That makes it less mindlessly plug and play compared to a regular image or video, but it might not be too much extra trouble.

Another is that it does not degrade nicely if javascript is disabled entirely and probably doesn't help search engines find your content. Having to support a fallback would negate a lot of the purpose of doing it at all outside of offline self contained simplicity scenarios.

Trust is a bigger issue now than before and this still comes across as an unnecessary hack that has specific use cases (which can be great), but it's being branded as if it should be generally applied as widely as images. I disagree with that.

I like modularity, so if this gets some people to pick it up as a tool to solve their modular problems that's great. Not sure this would be good for the web if it scaled up, though. For offline scenarios however, things like this are great, but the base64 savings there matter less anyway.

1 comments

Yeah yeah, tbh even though I branded it like that in the website, packing strategy & overall, its pretty much an apparent technology/library. I realy wanted some such technology 2 years ago, while genai text layouts were lame ash, and I questioned why noone does something like this (diffusion does not play well, or we havent figure it out yet, who knows? https://blog.google/innovation-and-ai/technology/developers-... )

And overall one of the exciting part for me is, to be able to have composable & editable images, hopefuly generated by future genAI models.

And finally, I just realy wanted to rant over what a 'digital image' is

That's one of the blessings and the curses of the flexibility of web technologies. They're easy to abuse, or repurpose and see the everyday normal things from new perspectives. That can be good, or it can be bad. There are often many ways to achieve the same thing.

Decades ago there were cool ideas that I loved that simply never took off. They faded away into obscurity. The technology isn't always that important to keep, but the love is. Keep feeling excited about things even if people don't buy into them, because nurturing that feeling of excitement for possibilities is usually more important than today's thing. It's something that can pull you forward to keep trying things. You'll cover a lot of ground that other people already did decades ago, but eventually you'll hit things nobody else did and that becomes important.