News for hackers. Stuff that matters.
Re:Breaking up with JavaScript front ends by thex10 on Saturday December 10, 2022 @09:01PM (#33939250)
> Talking layer of DOM nodes, I actually did a few samples of this the other day.

Is there a tool for this? I’m kind of wanting to check my site now…

Re:Breaking up with JavaScript front ends by nicoburns on Monday December 12, 2022 @08:53AM (#33954602)
You can run the following snippet in the console:

    function getMaxNestLevel() {
        var i = 1, sel = '* > *'; /* html > body is always present */
        while(document.querySelector(sel)) {
            sel += ' > *';
            i++;
        }
        return i;
    }
    
    console.log('total nodes', document.getElementsByTagName('*').length);
    console.log('max nest level', getMaxNestLevel());