I have a love-hate relationship with ESBuild. Sometimes, when working with it, it makes me want to bang my head against the wall in annoyance. This is one such occasion.
How to Generate Dynamic Pages for Docusaurus
Generating pages dynamically instead of relying on a 1-1 relationship of files to web pages seems to be an often overlooked aspect of static site generators, and Docusaurus is no exception. However, with some prowess and tinkering with the plugin system, we can definitely make the "impossible" possible, and generate pages from whatever data source we want.
Interested? Read on...
Using supabase-js Auth Features on Node.js
Supabase Auth features are like a God's gift from heaven for having a record-speed authentication system ready to go for your side projects whenever you need.
However, since @supabase/supabase-js up to v2 (at time of writing) is meant for JAMstack developers, it does take some additional configuration to use it for the Node.js environment.
You will need to some additional configuration:
// ANON_KEY and ANON_URL are string constants from your project
createClient(ANON_URL, ANON_KEY, {
auth: { persistSession: false, autoRefreshToken: false },
})
This will disable attempts by the client to store and refresh session, as there is no localStorage in server/scripting environments.
Your API calls will now work flawlessly 🔥.
Shoutout to Kang Ming and Alaister for this, my awesome colleagues at Supabase, whose deep knowledge of the client during a discussion in Bali Nov 2022 led to the above snippet.
Taking Control of the Browser Dark Mode with Ant Design and TailwindCSS for Dark Mode Wizardry
Everyone loves a well executed dark mode, me included. I think that having a full blast of white light in the middle of the night should be considered as bad as a slap in the face — you're most definitely awake after getting it.
Combining TailwindCSS with Ant Design for Super Fast (And Simple) UI Development
I really enjoy developing with Ant Design. Yes, I know that it is a rather enterprise-y component library to work with when developing UIs in React, but I think that it has one of the fastest time-to-value as compared to any other component library, due to the sheer.
In this blog post, I will give you a quick walkthrough of how to combine the two tools together, and also give some opinionated tips on working with them.
