delightful icon and arrow pointing to obsidian icon

Building Delightful for Obsidian

A whole new scaffolding was built, to convert plain JavaScript into TypeScript with a modular JSX style, because it's more inline with how plugins are commonly built for Obsidian, but mostly because things have changed.

Converting to typescript with Obsidian functions

The browser extension was built in plain JavaScript, and converting it to TypeScript with Obsidian functions was more work than I was expecting. It didn't take long though. I used AI for a first round to speed up the scaffolding of the new TypeScript project (AI is actually useful for some things).

I thoroughly reviewed the output and changed a bunch of things it got wrong and other things where it didn't follow my brand of beautiful code structures which is obviously the best way :)... then I built the rest of it.

There were quite a lot of performance improvements made during that work. I put more effort into testing and improvements than I'd usually do for a small project like this. I changed how it preloads assets, and how they're stored, added and removed from the screen. I did lots of testing to make sure it doesn't affect anything else as you go about your business, while being ready to delight you within milliseconds at the click of a checkbox (depending on how lucky you are to be delighted that time - unless you set it to ALL OF THE THINGS, which means every time).

Copying performance improvements to the browser extension

The two codebases are quite different, except for where most of the performance improvements were made. That conveniently made it easy to copy them to the browser extension.

I thought through having it all in one codebase, but it turned out to be more trouble than it's worth unless I convert the original browser extension to TypeScript. Without that, the only benefit would be a single copy of the delights, which is not enough. Maybe if I build a third version as a plugin for another system, I'll have a better reason to move it all into a single codebase/monorepo and take advantage of shared functions and assets.

JavaScript has significantly increased its capabilities in recent years, making it easier to write code for more ambitious functionality without the great effort (or external libraries) it used to require. So I'm considering converting the older-style code to TypeScript/JSX for the browser extension too. So it might get to a single codebase yet.

Popularity on Obsidian

As of writing this, it's been two months since I published the plugin, and it's already outperformed the browser extension, with 650 downloads. That momentum has spilled back into the browser extension, which has had a very small but noticeable influx of new users.

It makes me feel good to know people are adding the odd bit of joy to their day, and I helped them make that happen.

About the author

Paul Groth

Software engineer. Interested in privacy, safety, ethics, security, and psychology in tech.