anki
anki copied to clipboard
Your dependency graph is crazy!
Also known as dependency hell I think we should really warn beginners about this!
Stumbling on a portfolio website that seems to be quite simple (see the repo), but had a LOT of dependencies. I have some thoughts:
923dependencies is far too many for a portfolio site!- Some books I've read are essentially broken due to outdated dependencies (for tutorial files).
- The javascript ecosystem (in terms of dependencies) seems to go stale at warp-speed!
Some bits of the portfolio site are cool, such as his talks section with a slideshow and transcript. But. I'm fairly sure you could handle that in a much simpler way: why not YouTube slides and an Ai Markdown transcript? If absolutely necessary, handle slides with Pandoc? If you want fancy animations, why not Prezi?
- For some things, such as a blog, all you need is a static website generator. Plain html/css.
- As a comparison, this single-page-app (SPA) with Elm has zero dependencies (and only
14packages)- For the really pedantic, simply copy those package files into a
/libraryfolder. No dependencies! - Elm packages are pretty stable, although 5 years without updates is a grandpa for javascript devs.
- For the really pedantic, simply copy those package files into a
I'm a big fan of future-proofing, simplicity, and boring technology. Print first CSS might not have all the bells and whistles, but it depends on very little — and even that's too much, as it could be plain CSS or use a simpler compiler.
I'm guilty of it too
Full disclosure, my
elm-playgroundrepository has lots of dependencies too ...
Most of these are from tutorials, using npm packages such as json-server. Really useful packages, so long as they're self-contained and easy to update. However, you could've used plain json files and elm reactor if all you're doing is a GET. Sometimes there's no getting around it. Anyway, you get the idea.
Here's an excerpt from an interesting book "Simplicity" all about cutting the fat with dependencies: know what a dependency does, and if you really need it.
Some useful examples
- Daisy UI (zero dependencies)
- A bash script to concatenate files (rather than using Less)
- Lightning CSS which seems to only have a single dependency in NPM.
- But actually has 35 (dev dependencies), so unless you need a fancy setup, a bash script reduces overhead.