HumanOnlyWeb

🍁 writer of code. drinker of coffee. human on the web.

Do You Really Need That Module?

By HumanOnlyWeb

Every time a new major version of Nuxt drops, the same thing happens. GitHub issues, Reddit threads, Discord messages. "Module X doesn't work", "I can't upgrade because of package Y". Same thing in Laravel, same thing in Rails. The framework changes, the pattern doesn't.

Upgrades

I've seen Daniel Roe open dozens of PRs across community modules to make sure they work with new Nuxt releases. That sounds awesome, but also kind of crazy. One person going around fixing other people's packages so the rest of us can upgrade smoothly.

Module authors are volunteers: they have jobs and lives, outside writing code for free. Nobody's sitting around waiting for the next major release so they can spend their weekend updating a package. That's fair.

Nuxt does help here with compatibility flags. You can opt into breaking changes early, test against the next major, and report issues before it ships. More frameworks should do this TBH.

But the real issue is somewhere else.

Too Many Packages

I think most of us (myself included) reach for npm install way too quickly. I've seen projects where a whole module gets installed for something you could write in 20 lines. Now that project depends on someone else's release schedule.

Furthermore, third-party deps are one of the most common attack vectors out there. Apps get compromised through packages the developers didn't even know were in their dependency tree.

What I Do Instead

Before adding any dependency, I ask: do I actually need this? Most of the time, no.

  • If it's less than ~50 lines to write myself, I just write it. I'll understand it better and I'm not waiting on anyone to update it.
  • When I do need a package, I check the official Nuxt modules first. Core team maintains them, so they're guaranteed compatible on day one.
  • I look at who maintains it. Someone like Harlan Wilton (Nuxt core team) maintains a bunch of modules (SEO, OG Image, etc.) and keeps them up to date. That matters.

This isn't a dig at community contributors. The ecosystem wouldn't exist without them. I just try to be deliberate about what I bring into my projects.

You Learn More This Way

This is the part people skip over. When you write that composable yourself instead of installing a package, you actually learn how the framework works.

Nuxt gives you modules, plugins, composables, server utilities, and solid docs on how to build all of them. So next time something breaks, you're not staring at a module's source code trying to figure out what it does. You already know, because you've written similar stuff yourself.

That's It

TLDR: use as few packages as possible. Nuxt gives you the tools to build most of what you need yourself.

Next time you're about to install something, read the source first. Check how many lines it actually is. Look at how many dependencies it pulls in. You'd be surprised how often you can just write it yourself.

All Comments 0

Be the first to comment.