toad.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server operated by David Troy, a tech pioneer and investigative journalist addressing threats to democracy. Thoughtful participation and discussion welcome.

Administered by:

Server stats:

274
active users

#js

6 posts5 participants0 posts today

Lazywebsite says:

If you navigate away your changes will be lost, really lose changes?
[Cancel][Ok]

... So you wrote the #js to detect that I'm losing changes... And my draft was important enough to throw an 80s-style confirm modal... But you didn't think the draft was important enough to stash it some place like in a cookie, or local storage, or a post it to a server-side draft?

Just "really lose your changes?" #ux

I've been using TS for almost two years now. I hoped it would make my code more robust. I think it does. But the whole system seems so brittle. I just wasted half an hour trying to fix "JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists".

Then I decided to just restart VS Code and poof: all errors gone!

This was after restarting the TS server and the dev server. Only using recommended packages and extensions in an Astro project. 🤷

Any browser extension gurus able to help me figure this out?

I have an extension and I'm creating two context menu items via two separate calls to the 'chrome.contextMenus.create' method and by default it will stick those two items under a top level menu and I have not been able to find an easy way to say "don't do that" and keep both items as top level choices in the context menu.

I'm doing this in Firefox but using chrome to be cross-browser compatible.

I also have a silly web components question...

If I choose a helper library like #LitHtml and make some component. Say like a button. And I want to make it portable to different projects / contexts.

Is it possible with some tool to "compile" it back to a vanilla web-component again? Or would it only be "portable" to some other context if you also handed over the dependency on Lit?

Replied in thread

@SimpleProgrammer well, #JavaScript does artifically make #Websites slower and require unnecessary amounts of resources.

Anywhere else we'd not accept that #bloat [except with #Windows and #MicrosoftOffice but I'm not gonna deal with digital zombie - malware] but with the #Web it's okay to do so.

Sorry if I'm ranting, but the fact that 2007 slower mobile internet (or even WAP) in #Germany aka. #EDGEland felt faster than modern web on a 128x faster machine that has 1024x bandwith than is not excuseable!

#JS quiz time!

Without trying it out, what do you think the following will print?

async function foo () {
console.log(1);
let v = 2;
await v;
console.log(2);
}
function bar() {
console.log('bar');
}

foo();
bar();

Oh, great, the EPA's grand masterplan to save the environment: cut out the pesky "science" part entirely! Because who needs expert research when you can just guess? 🙄🔮 Now, back to enabling #JS like it's 1995. 🕹️
nytimes.com/2025/07/18/climate #EPA #science #environment #expertresearch #HackerNews #ngated

The New York Times · E.P.A. Says It Will Eliminate Its Scientific Research ArmBy Lisa Friedman