Typescript logo, white letters TS on square, blue background with rounded corners

Fixing Comments

So, for anyone following along at home, I mentioned I was having problems with the comments at the bottom of the post pages. Basically, the comments would get loaded the first time you visited a post, but comments wouldn’t load for any other posts you visited or if you returned to the original post. Refreshing the page fixed it.

I did a little troubleshooting. I’m using Giscus for the comments. Turns out, the script to call it was only being called the one time. Well, I was using Solid for that Astro island. I don’t know it. I don’t really know TypeScript. I’m pretty sure this used to work, but maybe I’m wrong. Maybe it never really worked. I’d been using Solid’s onMount in conjunction with Astro’s client:visible directive to try to be slick, but that was overkill. I’ve gotten rid of onMount and migrated to client:idle. I think that’s probably good enough.

So, all of that is to say I don’t know what I’m doing when it comes to TypeScript, or Astro, or Solid. It might be time for me to go write a full project in TypeScript. I have a project in mind I’ve tried to start a few times. Originally, it was going to be a Go backend (I owe a post about why I’m moving away from Rust) with a React frontend. I then tossed it out and was going to go with Go, templ, and HTMX. Now, I’ve been considering going with Next.js so I can use TypeScript all the way through. Hmm… More to come. Happy hacking!