Technology News

Tonic (Component Framework)

I enjoy little frameworks like Tonic. It’s essentially syntactic sugar over <web-components /> to make them feel easier to use. Define a Class, template literal an HTML template, probably some other fancy helpers, and you’ve got a component that doesn’t feel terribly different to something like a React component, except you need no build process or other exotic tooling.

Here’s a Hello World + Counter example:

They have a whole bunch of examples (in a separate repo). You can snag and use them, and they are pretty nice! So that makes Tonic a bit like a design system as well as a web component framework.

To be fair, it’s not that different from Lit, which Google is behind and pushing pretty actively.

Here’s a Hello, World + Counter with Lit:

And Dave was just showing me petite-vue the other day, so I figured I might as well do that one, too:

I’d say that petite-vue example wins for just how super easy that is to pull of in just declarative HTML. But of course, there are a bunch of other considerations from specific features, syntax, philosophy, and size. Just looking at size, if I pop open the Network tab in DevTools and see the over-the-wire JavaScript for each demo…

  • Tonic = 5.1 KB
  • Lit = 12.6 KB
  • petite-vue = 8.1 KB

They are all basically the same: tiny.

I’ve never actually built anything real in any of them, so I’m not the best to judge one from the other. But they all seem pretty neat to me, particularly because they require no build step.

Best Email Marketing Practices to Increase Sales
All You Need To Know About GST Amendment Process

Related Articles

Scaling Up The Outreach Through Swiggy

scaling-up-the-outreach-through-swiggy
Scaling Up The Outreach Through Swiggy As the world is evolving, we are moving to more digitized options. Amidst such a hectic life schedule, we don’t have time to sit…

Why Disney didn’t buy Twitter

Why Disney didn’t buy Twitter
Elon Musk wanted to buy Twitter. Then he decided he didn’t. Bob Iger can relate. In 2016, Iger, then the CEO of Disney, had convinced himself that his company should…