logoalt Hacker News

daylily • today at 12:38 AM • 1 reply • view on HN

JSON is much easier to directly access and manipulate in JS compared to XML, so I think you'd just fetch() it directly and then plug the data into something like lit-html. Which probably doesn't need bundling either since it's just template functions.


Replies

pmarreck • today at 12:53 AM

> JSON is much easier to directly access and manipulate in JS compared to XML

and yet a single newline in a text field will shatter its validity or force you to enter escaping-hell.

(I tamed that entire general problem by making https://github.com/pmarreck/printable_binary, and it will permit you to pack all binary data into a string, without any escaping issues, while retaining ascii legibility, although that requires a decoding step.)

➕ show 1 reply