Friday, August 09, 2024

Why Vite? Optionality Versatility & The Vibes.

+

Vite is the frontend world's ultimate improv partner! It's not Vite vs React or Vite vs Vue or Vite vs anything else. It's Vite AND React or Vite AND Vue or Vite AND raw js or ts!

If you're going to build a client-side app for the web today, you're probably going to reach for React or Vue or Svelte or Solid or any one of the various JavaScript meta-frameworks we have today. Or even just good ol' vanilla JavaScript or TypeScript.

And if you're going to build with any of these meta-frameworks, it's best to have the "engine" that powers them be Vite.

Why? Simply put:

optionality, versatility and the vibes.

What do I mean by that?

Optionality

The ecosystem is filthy and I mean filthy with solutions to all your JavaScript needs. Teeming! You have so much choice. It can be intimidating if you're new to it and the voices are loud and opinionated but you can stay nimble and experiment at your own pace and comfort level with Vite.

You wanna try X? There's probably a framework-agnostic Vite plugin for that. Install it, add it to the Vite config, determine if it solves your problem. If not, remove it. Test another.

You wanna try out Lit and Web Components? Install the deps, get to building!

I'm talking purely about client-side JS dev here but if you start to wade deeper in the waters, and want to go SSR, there are Vite plugins for that as well. The Vite ecosystem is quite broad.

Versatility

I want to say something like, “it might seem trivial but it's important…" but really this is a huge part of why Vite is great. It's not trivial. The fact that it lifts quite a bit of that mental overhead is a huge selling point. You can of course get as granular as you'd like with fine tuning its performance but that's what the core team does best. You are the end user with Vite. They take good care of you. So unless that's where you derive your programming satisfaction, you can get down to the business of crafting your product in the language and framework you already know and love.

While Browser Extension Development (B.E.D) is technically just a sub-category of web development, it is nice that with Vite, I can just build these things the same way I build web apps. If I can, I want to avoid having to learning new DSLs that slow down shipping product.

The Vibes™

The buffet that is the interaction of minds in the JS ecosystem can be a bit… loud and upsetting, to say the least. Even for mere observers. The thing is, what makes the tech landscape so attractive IS just that: the exchange of seemingly disparate ideas that should, in theory, when they come in contact with your own, enrich, broaden, and deepen your understanding of things. Trigger a lateral thought that wouldn't otherwise have materialized. Steel sharpening steel. You know, the whole promise of The Web™!

Sometimes though, especially in online discourse (bird app 👀) tact often falls by the wayside and you might find yourself wondering: must I wade through the muck to get some answers; connect with some fellow humans? The answer is no! You mustn't. At least, you shouldn't have to.

The Vite community “feels" welcoming. Calm. I'm finding I value that more than whatever the opposite is, strong as the promise of its solution might be 🤷.

So, that's why Vite for Bedframe.

And another thing...

Vite for clients. Not clients, but "clients"

I am not a hacker by any stretch of the imagination. Far from it, actually. My foray thus far has been largely led by attempts to bring otherwise static design to life. That requires programming and so over the years one learns to wrangle a lil html here, a lil javascript there until eventually you're making React hum the melodies you concoct. Throw in a lil shadcn/ui and some Framer Motion and slowly your skill starts to catch up to your taste.

I don't usually care for or get enamored by the things your prototypical CS-degreed hacker / programmer / engineer might. I eat it up though, don't get me wrong. Much the same as I do business podcasts, popsci, pop psych and Malcom Gladwell, it's wildly entertaining. However, I come from design and from freelancing / consulting / contracting aka delivering real small business humans real solutions. They speak a very different language. They're pragmatic; practical. They'll look you in the eye and say no.

I come at programing through the design > product > engineering ingress.

You'll think the Stripe payments DX is so amazing until you mention the 2.9% + 30c transaction fee to your local business trying to go online. You won't understand why they suck their teeth and so quickly brush away your, you thought, airtight solution and tell you to find another. These are the kinds of people I built stuff for and it's difficult to lose that ethos. You meet them face to face at the corner coffee shop and the discussions are capital Real! It's not theory. Nothing's proverbial here. You'll think Hacker News and the blogs have been lying to you all this time. These are the people about whom they say, "talk to your customers". Bruh!

client --> me --> you (with the solution you're hawking)

All that to say, when I'm the one between you and a client (client being anything from a client in the traditional sense to an employer/team for whom I'm evaluating a solution), don't get fancy on me. Give me sturdy tooling, and go easy on the abstractions. Keep me as close to The Platform™ as possible. I'll handle the flair and the fancy. Or, if you're going to give me magic, tell me: throw your design and code in this here magic box and out the other side will come your glorious vision realized; predictable, replicaple.

That's kinda how I see Vite.

Vite says to me, Aye! Throw your spaghetti in the vite.config and everytime it'll come out the other side properly chunked, split, tree shook, and optimized for the modern browser.

Now, that's a sales pitch I can buy!

I don't know that I want to have a discussion about a solution purely on the merits of what's going on under the hood. I'll have done my research and I'll think it far removed from the actual discussion I'd be wanting to have vis à vis: can this thing help me ship or what?!

Put another way: Vite is like Apple, sans the walled garden-ness of it all. You're gonna want to tell me that Android is better, actually and that they did this cool thing first — and you'll be right — but you'll be missing the point entirely. We won't even agree to disagree; I'll agree with you completely! I'll just go on about my prior business promptly after.

When you find something you can lean on, in the ever and quickly evolving frontend landscape, you hold onto it and tightly! Until you're proven wrong, anyway. Strong opinions, loosely held and whatnot.

Nb:

  1. First, let's be clear: Vite is super fast and forward thinking and offers all the things one looks for in a frontend solution. If it didn't solve the obvious needs first, we wouldn't even be having this slightly more nuanced convo!
  2. I like what the roadmap looks like. The release cycle is predictable, the milestones are accessible... Once a tool is stable enough to start porting functionality to faster languages (Rolldown wen?) you know you've got good shephards and captain at the helm.
  3. I need to be able to articulately justify my tech stack decisions properly without being too hand-wavy. Vite lets me do that.
  4. I think Vite and solutions like Vite is where things are going to converge, if they haven't already. With first class support for meta-frameworks and a standardized approach to config and build tooling for frameworks that opt in, it makes navigating from one framework to another much more efficient! I don't want to get locked in too early to one framework or another! I must assume this increases the adoption / reach / surface area for frameworks that opt to participate. Win:win.

News + updates Dispatch

Get occasional updates & helpful tips about making BEDs with Vite