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/

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

Remember to periodically verify that you've opted out of GitHub's Copilot data collection bullshit.

I thought I had done that, but nope...

👉 https://github.com/settings/copilot/features

Build software better, together

GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

GitHub
You can't subclass Proxy because it does not have a prototype property. But since this is #JavaScript and there are no rules…

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

#webdev #wtfnjs

☝️🤓 MDN says[0] about Iterator.zip: "To zip strings, convert them to iterators using Iterator.from()”, but what Iterator.zip() _really_ wants is iterable _objects_… and this TECHNICALLY includes string objects, just in case you're looking for a use case for these guys. Too bad this means you can't slap Symbol.Iterator onto Number.prototype and zip 42 or something. Today's #JavaScript features are way too reasonable for my taste!

[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/zip

So, #WebComponents. If we want to share stylesheets between the document and components and we have CSS module scripts... is there any reason to use <link rel="stylesheet"> anymore? Requesting a CSS module script from a blocking script in <head> (and then sharing the sheet between shadow roots and the main document) should be plenty fast, right?

#webdev

gotta pay for that subsidised slop somehow

stop being the product - GitHub is not your friend

https://github.blog/news-insights/company-news/updates-to-github-copilot-interaction-data-usage-policy/

Updates to GitHub Copilot interaction data usage policy

From April 24 onward, interaction data from Copilot Free, Pro, and Pro+ users will be used to train and improve our AI models unless they opt out.

The GitHub Blog
Time to tackle Temporal @workingdraft 🤓