Sponsored updates

2021 Week 404 min read

giscus 💎

Vercel approved my sponsorship application for giscus. It's now upgraded to the Pro plan, which lets me move the repo to a GitHub organization. It also means I get a 10x upgrade on the limits. For free. They're awesome.

And that means one less thing to worry about.

I also made some updates.

Discussions API is only available through GraphQL. It also uses cursor-based pagination, and comments and replies are both paginated. Thus, the pagination for replies is nested within the pagination for comments.

Nested, cursor-based pagination with a GraphQL API is tricky to do, especially with the library I'm using that does not have built-in GraphQL support. I haven't figured it out.

So, I've just been fetching the first 100 replies. Anything beyond that won't be shown on giscus, and I've made an issue for that.

GitHub recently updated the comment replies initial view to show the last five replies instead of the first five. This effectively means that comment replies pagination starts from the back instead of the front.

Now, instead of the first 100, I fetch the last 100 replies. And instead of hiding the rest, giscus will now show a "Show the previous X replies on GitHub" link, which should at least indicate that there's more.

It's a rather rare case because I personally haven't seen an actual comment on GitHub that gets more than 100 replies. Well, just in case.

GitHub recently released footnotes support in its markdown renderer. Because giscus uses GitHub's markdown renderer API, the feature came for "free" to giscus. However, I had to adjust the styling to match how the footnotes look like on GitHub.

In addition, because giscus is loaded within an <iframe>, clicking the anchor links for the footnotes would take the viewer to the embedded page instead of scrolling to the correct anchor. I've fixed this by lifting the anchor links to the parent page. However, I haven't figured out a way to scroll the parent page to where the anchor exists in the <iframe>. I don't think there's a way, at least not without some nasty JavaScript.

GitHub also recently released colorblind themes beta. I wanted to add them to giscus, but it turns out they also recently updated their @primer/primitives color system. They've removed duplicate colors and made the CSS variables simpler. I had to do some refactoring to follow the new system. It's done now and the themes have also been added to giscus.

Two days ago, giscus had an unusually high traffic. This post is written so late, so technically this incident should not be included in this post. I spent my time trying to fix the issue and wrote about it on Twitter, which is also why this post is written so late. I will write more about it in the next post.


I've done most of my tasks at work for our new project. Still waiting for the backend to be completed so I can integrate more stuff. This wouldn't be necessary if we didn't split the frontend and backend, but oh well.

I was still busy with my TA duties on the weekend. I'm starting to think applying for TA again wasn't the best decision. Just gotta make it through the end of the year...

Entertainment & Friends

Sam and I resumed our weekly catch-up on Friday, and my other friend (the one who went to medical school) also joined. Sam has been learning Django but he was busy with a competition last week, so he hasn't got back at it again. Meanwhile, I've just been practicing some stuff with my instrument without following the course I'm taking.

We were a bit tired so we didn't do the sharing stuff and just had some friendly chat instead. Next week, we should be able to share more about the things we've been learning.

After the quick chat, Sam and I played some Resident Evil 6 until midnight. Some other friends were playing Valorant and we were in the same Discord voice channel, so it was a bit chaotic. It was good to hear some familiar voices, though.

On Sunday, I played Final Fantasy XIV again for about three hours. I really like the music. So far, the game is a bit slow-paced. But I find that and the music to be relaxing, so it's good.