@nolan@toot.cafe
@nolan@toot.cafe avatar

nolan

@nolan@toot.cafe

toot.cafe admin, web dev at Salesforce. Creator of https://pinafore.social. Former browser perf guy at Microsoft. #javascript #web #pinafore

This profile is from a federated server and may be incomplete. Browse more on the original instance.

nolan, to random
@nolan@toot.cafe avatar

Learning Rust after using JavaScript almost exclusively for 10 years is a humbling experience. I feel stupid and unproductive in a way I haven't felt in years.

But it's good! Learning new things is good. Gaining empathy for newer programmers is good. I like the challenge.

nolan,
@nolan@toot.cafe avatar

It also helps that Rust has really good error messages. Although most of the time I read it as "You forgot to florp the flamp, did you mean to add &mut here?" And I'm just like, "Oh yeah man, I totally meant to do that," and then I copy-paste it in. (Although if Rust knows what I want… can't it just do it for me?)

nolan,
@nolan@toot.cafe avatar

I'm also probably disadvantaging myself by explicitly not using ChatGPT/Copilot for things like "how to join a Vector of strings with a comma." I'm using the actual dead-tree Rust book and StackOverflow like a caveman. But my hope is that it will stick in my brain better if I avoid the AI shortcut.

nolan,
@nolan@toot.cafe avatar

@matt I'm not at the point yet where I'm advanced enough to really make that decision. I'm just trying to get something to work; I can fine-tune it later.

(Again, this is giving me empathy for beginner JS devs who can't decide whether to use Promises vs async/await or whatever.)

nolan, to random
@nolan@toot.cafe avatar

"How Do Chrome Extensions Impact Website Performance In 2024?" by Matt Zeunert https://www.debugbear.com/blog/chrome-extensions-website-performance

Once again, one of the most reliable ways to speed up your browser is to uninstall extensions. (Except ad blockers.)

nolan, to random
@nolan@toot.cafe avatar

"Why Patching Globals Is Harmful" by Artem Zakharchenko https://kettanaito.com/blog/why-patching-globals-is-harmful

One of those classic lessons that apparently needs to be learned over and over again.

nolan, to random
@nolan@toot.cafe avatar

"Optimizing WebKit & Safari for Speedometer 3.0" https://webkit.org/blog/15249/optimizing-webkit-safari-for-speedometer-3-0/

Love all the little details here. Improving 60% by stacking a lot of small 1%-ish improvements is impressive.

nolan, to random
@nolan@toot.cafe avatar

"Node.js: The Documentary" https://youtu.be/LB8KwiiUGy0?si=fn3Qeaykl1KdUTR9

Great documentary. I still remember a lot of that early hacker spirit of Node.

nolan,
@nolan@toot.cafe avatar

I think you can get an idea of the cultural mindset of those early Node days by comparing the Browserify website to a more modern equivalent:

Nobody cared if your website was polished, or if it had crude cartoon characters or whatever – everyone just wanted to hack on cool stuff.

Semicolons were thrown away like neckties. Callbacks were cool. Nobody cared what crazy postinstall scripts you ran. It was a different time.

nolan, to random
@nolan@toot.cafe avatar

"My Shifting Open Source Priorities" by Gregory Szorc https://gregoryszorc.com/blog/2024/03/17/my-shifting-open-source-priorities

The details differ, but I identify a lot with this. Being the "random person in Nebraska" takes a lot of time and mental energy.

nolan, to random
@nolan@toot.cafe avatar

Vitest is pretty nice compared to Jest. I'm still not sold on testing a fake browser (jsdom, happy-dom), but at least it runs fast, has a nice UI, and no more CommonJS vs ESM zaniness.

nolan, to random
@nolan@toot.cafe avatar

New blog post: "Bugs I’ve filed on browsers" https://nolanlawson.com/2024/03/03/bugs-ive-filed-on-browsers/

Kind of a navel-gazey post, but I thought it'd be interesting to look back on the bugs I've filed on browsers over the past ~10 years.

nolan, to random
@nolan@toot.cafe avatar

Publishing npm packages as ESM-only and with no TypeScript is such a breath of fresh air. The published files are the same as the source files, just like we used to do with npm back in 2012

nikitonsky, to random
@nikitonsky@mastodon.online avatar

New post: JavaScript Bloat in 2024 https://tonsky.me/blog/js-bloat/

nolan,
@nolan@toot.cafe avatar

@nikitonsky Great post! Unfortunately though I think "disable cache" may be over-reporting. For react.dev for example, it looks like it is continually re-downloading the same resources as you scroll.

My workaround is usually to use a fresh private window rather than "disable cache," FWIW.

matt, to random

@nolan Any chance we can get a spam mute/block list set up on this instance, like this one: https://mastodon.de/@ErikUden/111954222362376457 Thanks for any time you can spare on this.

nolan,
@nolan@toot.cafe avatar

@matt Yeah I noticed that the spammer problem has been really bad recently. I've been getting like dozens of reports in a few days. I'll look into this.

nolan, to random
@nolan@toot.cafe avatar

"Write code for the web" by Manav Rathi https://mrmr.io/apple

This is from an iOS developer, but as an Android developer, I came to basically the same conclusion 10 years ago. The web isn't perfect, but it's a near-universal platform not owned by anybody.

nolan,
@nolan@toot.cafe avatar

Personally, I got tired of Google's constant breaking changes with every Android version, and all the hoops I had to jump through just to keep my apps listed. Whereas whatever garbage I put on the web 20 years ago still works today.

An investment in learning the web (even dumb stuff like document.all or document.write) still pays dividends decades later. Whereas all my old Android API knowledge is just gone, like tears in the rain.

nolan,
@nolan@toot.cafe avatar

The biggest danger to the web IMO is the emerging Google-Apple duopoloy, and the fact that whatever bugs existed in WebKit at the time of the Blink split will just be "how the web works." This is why projects like Servo, Ladybird, and Flow are so important – they prove you can still build a browser from scratch, just based on the spec. (And thank heavens for the spec writers who made this possible.)

nolan, to random
@nolan@toot.cafe avatar

New blog post: "Web component gotcha: constructor vs connectedCallback" https://nolanlawson.com/2024/01/13/web-component-gotcha-constructor-vs-connectedcallback/

This is just a quick post on a anti-pattern that I've seen countless times.

nolan,
@nolan@toot.cafe avatar

@hawkticehurst @DavidDarnes @andrew_chou This makes a pretty similar point to my article! I like the distinction you draw between global and local event listeners.

nolan,
@nolan@toot.cafe avatar

@hawkticehurst @DavidDarnes @andrew_chou Honestly it feels like we need a generic test suite that tests that a web component can be inserted/removed multiple times without blowing up, and that it doesn't leak (ala https://www.npmjs.com/package/fuite or https://www.npmjs.com/package/memlab or similar).

Realistically, I think a lot of devs are not going to grok the subtle difference between global vs local event listeners. Things like Resize/Intersection/Mutation Observer also vary across browsers w.r.t. memory cleanup.

nolan,
@nolan@toot.cafe avatar

@hawkticehurst @DavidDarnes @andrew_chou Actually scratch that last comment, looks like Jake Archibald went on a tear filing Resize/Intersection Observer leak bugs on browsers; seems they are all fixed now. https://bugs.webkit.org/show_bug.cgi?id=227194

So effectively *Observers should clean up memory when the element is removed. So same issue as event listeners.

matt, to random

@nolan Just in case you don't know, toot.cafe seems to be under heavy load right now.

nolan,
@nolan@toot.cafe avatar

@matt Just checked and everything looks normal… not sure what happened.

nolan, to random
@nolan@toot.cafe avatar

Trying to find good guitar tools online really feels like a statement on the degradation of the web:

  • Can't find a decent guitar tuner or metronome that isn't plagued with ads or junk, so I use random PWAs written by web devs as software demos: https://guitar-tuner.appspot.com/ https://rx-metronome.web.app/
  • Searching for chords/tabs for popular songs gives you text files on shady-looking sites that prevent you from copying the text… and the text files look like they were written decades ago
nolan,
@nolan@toot.cafe avatar

Maybe I'm just an old curmudgeon or maybe there are still flourishing communities I'm unaware of, but as an old 'net citizen it just grosses me out how much of the modern web is mediated by platforms that only care about wringing out every penny they possibly can. This stuff used to be run by hobbyists on a shoestring budget with bubblegum and twine but care and love (Mastodon still has some of this vibe)

bkardell, to random
@bkardell@toot.cafe avatar

New Post about some Web Components stuff and styling

https://bkardell.com/blog/LovelyTrees.html

nolan,
@nolan@toot.cafe avatar

@bkardell I totally missed this post when you published it. I agree that we need more userland ideation before agreeing on standards.

One analogy I thought of recently: it's like we have BASIC with its "modules" that only have global variables and GOTOs. And people spent years getting very comfortable using GOTOs. Now we have encapsulation but… people miss the GOTOs. Which makes me wonder if we have the right encapsulation boundaries.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • rosin
  • everett
  • khanakhh
  • mdbf
  • thenastyranch
  • DreamBathrooms
  • Durango
  • magazineikmin
  • cubers
  • cisconetworking
  • Youngstown
  • slotface
  • kavyap
  • JUstTest
  • tacticalgear
  • normalnudes
  • osvaldo12
  • ethstaker
  • GTA5RPClips
  • tester
  • ngwrru68w68
  • InstantRegret
  • megavids
  • anitta
  • Leos
  • modclub
  • lostlight
  • All magazines