HN user

typedef_struct

71 karma

https://umfer.us

Posts2
Comments64
View on HN

Some good patterns here. An Event with a callback (what you're calling [context protocol](https://github.com/webcomponents-cg/community-protocols/blob...)) I think will prove useful.

My main gripe with web components is that while they expose the first half of the tree traversal (from the outside in, via connectedCallback), they don't provide access to the second half, after child elements have been created. (akin to Initialize and Load events from ye olde .NET)

You could start with something like this:

    customElements.define('html-import', class extends HTMLElement {
        connectedCallback() {
            const href = this.getAttribute('href')
            const fetch = new XMLHttpRequest()
            fetch.responseType = 'document'
            fetch.addEventListener('readystatechange', (function onfetch(e) {
                if (fetch.readyState !== XMLHttpRequest.DONE) return
                const document = fetch.response.querySelector('body') ?? fetch.response
                this.replaceWith(document)
            }).bind(this))
            fetch.open('GET', href)
            fetch.send()
        }
    })
Pipe Syntax in SQL 2 years ago

You can tell the authors realized this was a bad idea when they had to add the 'OVER' keyword, which isn't documented and hardly mentioned in the paper.

You can't build a "for-real native desktop app" without building half of a browser anyway. Can't use a font without FreeType or HarfBuzz, can't use a secure socket without OpenSSL. Can't afford to redraw the entire screen each frame, so you need a DOM of some kind to cache rendered boxes. The OS doesn't do anything it didn't do 20 years ago. Stack's a mess rn. imo

"The Federal government will not allow depositors at too-big-to-fail banks such as Bank of America, Citigroup, and JPMorgan to lose money."

Alternatively, the Federal government provides a free-of-charge insurance product to banks who then drop ship it to me for profit.