Useful patterns for building HTML tools

31 points by simonw


bakkot

A lot of neat stuff on this list! One small addition is that if you're producing a bunch of files, the tar format is very simple to work with and you can easily create a tarball on the client. You can use a library like JSZip too, but tar is doable without a library.

Sidebar:

ffmpeg-crop lets you open and preview a video file in your browser, drag a crop box within it and then copy out the ffmpeg command needed to produce a cropped copy on your own machine.

I was expecting it to use ffmpeg.wasm to do the cropping for you!

skatkov

Great article.

Personally, I usually build TUI apps for things like these and distribute them from personal homebrew cask.

I packaged all dev utilities into a single tui app https://github.com/skatkov/devtui.

hoistbypetard

CDNs like these have been around for long enough that I’ve grown to trust them, especially for URLs that include the package version.

The alternative to CDNs is to use npm and have a build step for your projects. I find this reduces my productivity at hacking on individual tools and makes it harder to self-host them.

I still don't trust other people's CDNs, for all the well trod reasons, though I don't mind using them for early exploratory programming. Once I've decided to build out a tool, I find that using vite to handle the build step removes very nearly all of the friction I associate with NPM during development.

And having gitlab or sourcehut CI run the bundler when I push to main, then publish to their "pages" host once it's done, reduces my involvement in publishing an update to git push. I'm sure github ci can do the same thing, but I've never personally set that up.

Thanks for publishing this. I learned a lot reading it.