Peter Kröner

@sir_pepe
840 Followers
278 Following
4.4K Posts

Developer ✨ edutainment ✨ Shitposting about #javascript and vanilla #webdev. Also there's cat pictures and bursts of travel. Reading web technology specs and doing training/consulting on said web technologies.

Also at sirpepe.bsky.social on bluesky

LocationKiel, Germany
Webhttps://www.peterkroener.de/
Main side projecthttps://code.movie/

Want to dominate the DOM? Ditch appendChild() in favor of append()! The latter is variadic, automatically turns strings into text nodes, and has a shorter name to boot!

#webdev #javascript #dom

"Axios npm Packages Compromised in Supply Chain Attack"

👉 https://thecybersecguru.com/news/axios-npm-package-compromised-supply-chain-attack/

Maybe you should have less dependencies in your project and lean more on established web standards. Maybe, IDK.

Axios NPM Packages Compromised: Active Supply Chain Attack Alert | The CyberSec Guru

Axios NPM packages v1.14.1 and v0.30.4 compromised. Malicious [email protected] dependency injected. Full technical breakdown

The CyberSec Guru

🚩✊️️️️️ Friday is Dependency Deletion Day! If you're still using a JS library to scroll to elements, you not only need to change that for the usual reasons, but also because native scroll functions integrate with the CSS property scroll-behavior[0]. This makes it trivial to respect the user's prefers-reduced-motion preferences.

[0] https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/scroll-behavior

#javscript #css #webdev

This is a very normal #JavaScript program, and it's great that this just works without complaint.

#webdev #wtfjs

☝️ #JavaScript PSA: events are just objects. You can just stick random properties on them; it's fine. Don't declare entire classes for one-off custom events, just use Object.assign()

#webdev

Wait, what? There is a way to disable certain web component features via a static class field? Just randomly stumbled upon this in the specs. Can't find much documentation, but it works in Chrome and Firefox at least.

👉 https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-define

#webcomponents #webdev #javascript

Wait, what? There is a way to disable certain web component features via a static class field? Just randomly stumbled upon this in the specs. Can't find much documentation, but it works in Chrome and Firefox at least.

👉 https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-define

#webcomponents #webdev #javascript

When you use ChatGPT to pick your parking spot #bancars

🚩✊️️️️️ Friday is Dependency Deletion Day! If you're still using a JS library to scroll to elements, you not only need to change that for the usual reasons, but also because native scroll functions integrate with the CSS property scroll-behavior[0]. This makes it trivial to respect the user's prefers-reduced-motion preferences.

[0] https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/scroll-behavior

#javscript #css #webdev