Max Karlsson's Avatar

Max Karlsson

@headlessheretic.com

Headless heretic ๐Ÿ”ฑ Writer. Freelance developer (ecommerce). Sci-fi and whiskey. I talk about headless development, e-commerce and freelancing

29
Followers
46
Following
78
Posts
30.10.2023
Joined
Posts Following

Latest posts by Max Karlsson @headlessheretic.com

0 days since I last took down production

02.06.2025 04:05 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Maybe I'm weird, but I've always preferred learning by doing over learning by watching a tutorial video.

I don't think I've ever followed a tutorial from start to finish.

23.05.2025 01:50 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Apparently a hot take: If you're already paying an agency a lot of money to do custom development on your theme, you're better off with Hydrogen.

06.05.2025 01:05 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Bernie should have run against Trump first time around

30.04.2025 01:03 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Date strikes again. Though I was surprised by this one because it was using a historical timestamp. But the `toLocaleDateString` apparently behaved differently in server/client even though the locale was defined.

30.04.2025 01:01 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

It's the only option the Democrats have if they want to remain relevant. There are voices within the Democratic party that can lead the way, and they have been ever since inauguration day.

30.04.2025 00:55 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

My electorate is a safe electorate, so I already know where my preference will flow in the end. But I'll put some other candidates above just to show discontent I guess.

Hoping for a continued rise in independents to challenge the current status quo.

30.04.2025 00:51 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

We use preferential voting here, so you number the candidates in your electorate from 1 - Last. If your 1 doesn't make it past the ballot, they check your 2 and so on.

This has put a lot of independents in parliament in the past decade. A way to show the major parties they need to change.

30.04.2025 00:51 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

The Democrats lost the election more than the Republicans won it.

From a European's perspective, the Democrats are far from left. They have a few left-leaning policies, but they're still a party for the rich. They just slow down the rising wealth disparity, but do nothing to fix it.

30.04.2025 00:45 ๐Ÿ‘ 8 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

Invoicing day! ๐Ÿ’ฐ

30.04.2025 00:42 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

We have our own Trump-lite, a.k.a Lord Voldemort, a.k.a. Mr Potato Head. He tried to run on a similar campaign (DOGE etc), but it's backfired and he's been forced to spend most of the campaign backtracking. We'll see how this translates when echo chambers fail to report it, or make up excuses.

30.04.2025 00:41 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

100%! Somewhat similar over here as well (our election is coming up this weekend). Neither of the major parties mention who's been getting richer while everyone else has been getting poorer.

All the talk about inflation forgets to mention that someone reaps the rewards of higher prices.

30.04.2025 00:41 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Head on the nail there, mate. A big problem with echo chambers is that people get trapped and bombarded with distractions designed to make them not realise the real issues.

"People can't afford housing or food, and I lost my job to AI."
...
"Look, a trans person in the women's bathroom!"

30.04.2025 00:17 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

I worry about echo chambers sometimes. I used to feel hopeful about humanity's future. Then I realised the algorithms weren't showing me the nonsense when a certain orange clown got elected across the pond.

At the same time, I'm happy I don't see too much of that rubbish, I'd go mad.

30.04.2025 00:08 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Debugging Hydration mismatch errors and having fun

Or not

11.04.2025 22:36 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

did you ask it to list what it's done in the past week?

27.02.2025 21:06 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Wow, nearly one in three OT games goes to shootout. That's more than I thought

13.02.2025 08:45 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

And a lot more entertaining! Yeah, I'm torn on the loser point. Going with a 3-2-1 point system like the Swedish league does is an option, but it can really make the top teams run away with it, killing off the playoff race too early

13.02.2025 05:06 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

I've been having too much fun with Hydrogen and Sanity to post in a while

13.02.2025 04:55 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Agree! I'd rather the game ends on a tie after 10 mins OT than let the extra point be awarded to the winner of a skills comp

13.02.2025 04:52 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Figured out a solution to this. In the GROQ query, you can concatenate the string with an empty string, seems to throw stega off so it doesn't get appended.

E.g. 'alignment': '' + alignment

26.01.2025 02:39 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

The poor DX in theme dev leads to high attrition. Talented devs stay clear of ecom, or get out as soon as they can.

Talk to recruiters for other dev fields and you'll soon find out how the industry sees ecom.

This needs to change.

2/2

25.01.2025 00:52 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I split my weeks between headless and theme development, and let me tell you, they're polar opposites. One has a great DX and allows for modern dev practices, while the other is extremely error-prone and leads to many headaches.

I would quit ecom if I had to work in themes exclusively

1/2

25.01.2025 00:52 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Could you opt out of stega encoding on subfields? This value never needs to be mapped to the studio. Or should I just not use a string in the first place and work out a different solution?

23.01.2025 08:58 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 1

So now I'm stuck with either adding a dependency to stegaClean from @sanity/client/stega or hoping that this regex covers all possible issues: /[\u200B-\u200D\uFEFF]/g

Inspecting the source for stegaClean, it in turn has a dependency to a vercel package with a much more complex regex

23.01.2025 08:56 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
Issue with Sanity GROQ fetch returning string data with zero width spaces... Hello, Does anyone know why all of a sudden Sanity GROQ fetch is returning string data with a lot of zero width spaces?

Found out why: www.sanity.io/answers/issu...

Stega adds zero width space characters for mapping in preview sessions. That wouldn't be an issue if I wasn't using this value for placement, which needs to work properly in preview sessions too

23.01.2025 08:53 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

So turns out it's because the alignment value has *a lot* of zero-width-space characters appended to it.

I thought maybe copilot was playing tricks on me. So I deleted the values from the Sanity schema and entered it manually.

Nope, still getting it.

23.01.2025 08:38 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Console logs showing JS not able to match a string with the value center to another string with the value center

Console logs showing JS not able to match a string with the value center to another string with the value center

What is going on here? JavaScript, you're drunk!

22.01.2025 10:26 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Having lots of fun doing it and getting to try all the latest Sanity features in the process.

Presenting the proof of concept on Tuesday to sell the full project. Wish me luck!

Worst case scenario I've wasted a week and a half. Best case I walk out of there with some more $$$ and a happy client

22.01.2025 10:17 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Trying to see how fast I can rebuild a site with Hydrogen using my recipe collection. The site is already headless, so I can reuse a fair bit. But it uses Chakra and Gatsby on the frontend, and I'm all in on Tailwind. Plus the Sanity schema is a mess and the Studio is V2, so an upgrade is in order

22.01.2025 10:15 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0