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

How to Migrate Your App From Express to Fastify

Exploring the Potential of the Metaverse: A New World Awaits
Express has long been the most popular framework for developing web applications with Node.js. Unfortunately, this framework hasn’t seen much active development in recent years. This means that it doesn’t…

Using Google Drive as a CMS

using-google-drive-as-a-cms
We’re going to walk through the technical process of hooking into Google Drive’s API to source content on a website. We’ll examine the step-by-step implementation, as well as how to…

Design of Healthcare App

design-of-healthcare-app
Health is one of the major concerns of today’s world. We are living in a fast-paced world where going to the gym every day seems a challenge. But tracking one’s…

Managing Operational Challenges in Retail Shops

managing-operational-challenges-in-retail-shops
Managing Operational Challenges in Retail Shops Retail Shops are places where we all visit to buy our favorite shirt, to shop for groceries, to buy medicines, to purchase the trending…