@[email protected]
“Adactio: Links—Easy Toggle State”adactio.com/links/13914
I think about 90% of the JavaScript I’ve ever written was some DOM scripting to handle the situation of “when the user triggers an event on this element, do something to this other element.” Toggles, lightboxes, accordions, tabs, tooltips …they’re all basically following the same underlying pattern. So it makes sense to me to see this pattern abstracted into a little library.
“Adactio: Links—Easy Toggle State”adactio.com/links/13914
.@adactio Thanks a lot for supporting this idea that made me build this library! adactio.com/links/13914 — twikito.github.io/easy-toggle-st…
Well, this is horrifying.
This is depressing.
Every millisecond you spend executing JavaScript is a millisecond the browser can’t spend responding to a click, updating a scroll position, or acknowledging that the user did just try to type something. When your code runs long, you’re not causing “jank” in some abstract technical sense; you’re ignoring someone who’s trying to talk to you.
This is a great way to think about client-side JavaScript!
Also:
Before your application code runs a single line, your framework has already spent some of the user’s main thread budget on initialization, hydration, and virtual DOM reconciliation.
I hold this truth to be self-evident: the larger the abstraction layer a web developer uses on top of web standards, the shorter the shelf life of their codebase becomes, and the more they will feel the churn.
How I switched to high-resolution maps on The Session without degrading performance.
Try writing your HTML in HTML, your CSS in CSS, and your JavaScript in JavaScript.
You might want to use `display: contents` …maybe.
HTML web components for augmenting date inputs.
Don’t replace. Augment.