Anoesj

Anoesj

@anoesj.dev

Vue, Nuxt, CSS & TypeScript maestro, usually over-caffeinated, cat lover, leftfield electronic enthusiast, something something

66 followers115 following246 posts

Yesterday my uncle passed away. He was a funny, studious man that first introduced me to Linux, open source, privacy and security. His daughter inspired me to code, I never knew humans created websites before then. My life would not be the same without him. Eternally grateful 💔

@bsky.app Please, please, just get rid of the "scroll to top" button. It's exactly where my left thumb is at when trying to scroll. Just make the home tab button inherit its behavior, just like on every other app. At least make a setting?

Anoesj reposted

I can't stress enough how important it is to make an example here. Take all the money from these companies. Find alternatives. Vote with your pockets because fundamentally money and power is everything to these insufferable pricks.

Andy Bell@bell.bz

There’s never been a better time to switch from Next.js to Astro nitter.net/rauchg/statu...

If you don't feel like collaborating with AI by implementing background runners, does that make you: A) einzelganger B) boomer C) metathesiophobe D) all of the above ❓

I do not like promoting AI or writing AI related content, but Codex caught me off guard. Had to write 700 lines of validation schemas yesterday and while tools like Copilot seem to go for speed, Codex took a while longer but got it right in one go 😯

It confuses me that so many people are involved in user land projects, but so few are interested in specs. I wrote this proposal a few weeks ago and I kind of expected to start a conversation with it, but instead... silence 😕

Forgot to mention that the transition is done with Vue's <Transition> component (adds active + from/to classes, listens to transitionend events). I hoped transform-origin would work in the @position-try clause, but it doesn't seem to. Or transform-origin: anchor(top) anchor(left); Any ideas?

Anoesj reposted

#CSS has evolved SO much in the past couple of years, and SO fast... I wonder: how many of the new features do you use in your day-to-day work? How many would you say you use out of 10?

Been working on multi-variant frontend apps the whole year. Should I write about my findings, failures and techniques for maintaining apps that have multiple variants?

Everyday I wish there was a PHP "match" equivalent for JS, preferably with superpowers, like: const foo = match(props.project.user.age) { < 21 => '⚽', 21, 22, 23 => '🥳', > 23 && < 30 => '📚', >= 30 && < 66 => '👨‍👩‍👧' default => '🫖' }

Oh 😄? Oh... 😦

github.comGitHub - tc39/proposal-pattern-matching: Pattern matching syntax for ECMAScriptPattern matching syntax for ECMAScript. Contribute to tc39/proposal-pattern-matching development by creating an account on GitHub.
Anoesj@anoesj.dev

Everyday I wish there was a PHP "match" equivalent for JS, preferably with superpowers, like: const foo = match(props.project.user.age) { < 21 => '⚽', 21, 22, 23 => '🥳', > 23 && < 30 => '📚', >= 30 && < 66 => '👨‍👩‍👧' default => '🫖' }

Note to future self: when multiple tsconfigs all include the same folders, you can create tsconfig.json files inside of those folders extending one of the root tsconfigs explicitly to force VS Code to type check using that particular tsconfig. No need to go down that TS rabbit hole again 🫶

Still waiting for the day TypeScript adds a built-in way to specify arrays/Sets with obligatory values and Maps with required keys. Yes, you can do it with some type gymnastics and helper functions, but doing all kinds of juggling with tuple types in every possible order is way too heavy.

All AI related news worries me a lot lately. Geoffery Hinton: “This [AI] is a very different kind of technology. If it can do all mundane human intellectual labor, then what new jobs is it going to create?” Hinton said. “You’d have to be very skilled to have a job that it couldn’t just do.”

Fortune about Geoffery Hinton, “The Godfather of AI”: “He concluded that AI will likely lead to companies needing far fewer workers and that the new technology’s impact can’t be compared to previous technological advances that created an explosion of new jobs.” We need world wide regulation 😟

Everyday I wish there was a PHP "match" equivalent for JS, preferably with superpowers, like: const foo = match(props.project.user.age) { < 21 => '⚽', 21, 22, 23 => '🥳', > 23 && < 30 => '📚', >= 30 && < 66 => '👨‍👩‍👧' default => '🫖' }

Pretty cool to find out @rolldown.rs already simplifies calculations during bundling. Like when you run "export const foo = 0.1 + 0.2;" it simplifies that compile-time, which saves some time doing runtime calculations. Rollup doesn't do that (tested in REPL) 😄

Ah, it's that time of the month again where I'm frustrated about some open source package behaviour and want to completely overhaul it 😅

Scary days. A large part of my Iranian family lives in Tehran and reported rockets landing within 10m of their apartment. I can't wrap my head around the news coverage. How can it still be so pro-Israel and framing Iran as the perpetrator. All the while millions are being starved to death in Gaza 😭

@vite.dev Tried rolldown-vite on a large Nuxt project, but builds now take 70s instead of 20s? Confused 😕. I feel like lightningcss is the culprit. I get a lot of warnings regarding "@position-try" usage and maybe that's causing the extra build time?

Marked types 🎯 are awesome! Lots of folks know about branded types already, but what if we change the mechanism a bit to loosen it up a little. No idea if somebody has already named this pattern before, but I like the term “marked types”, which is kind of like “soft branding”. Examples in replies...

View full thread

Using marked types does not require you to type cast values before assigning. So they are way less strict than branded types, but they serve a different purpose. We could use it to hide some User properties in forms with a defineForm() helper that disallows hidden properties in form definitions.

Another use case is to create a big descriptor object for a certain entity. With labels and defaults for all public fields and form field options for properties with multiple possible values. I use this pattern quite a lot in my recent projects. What other use cases can you think of? Let me know! 🔥

Marked types 🎯 are awesome! Lots of folks know about branded types already, but what if we change the mechanism a bit to loosen it up a little. No idea if somebody has already named this pattern before, but I like the term “marked types”, which is kind of like “soft branding”. Examples in replies...

What if we want to mark some properties as “hidden properties”? Let‘s create a User type and explore some nice use cases.

@mattpocock.com Do you know why TypeScript does not understand the relation between the sibling objects and narrow down the type properly? Why does it not use the same logic as Extract under the hood? What am I missing and is there a way to fix this shortcoming without writing a ton of typeguards?