Native Web components as an alternative solution #74
richardeschloss
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi 👋 all, I know I've been somewhat missing in action from this project, but over the past few months, I've started going framework-less and more VanillaJS because...I think I end up with an insanely faster dev experience, with code that I have much more control over. Specifically, I've gotten quite deep with native web components and I find that when developing these custom elements on Vite's dev server, I can move faster. Many modern browsers have come a long way in terms of what they can support. The beauty is, these elements are just extended HTMLElements that the browser will understand, just like it understands
<div>
and<p>
, for example. This means that if you already have a Nuxt project or React or whatever framework, these custom elements will work everywhere!Specifically, here's how I now use highcharts with a simple custom element:
Then it can be used simply like this:
It can also be used in an HTML file
<my-highchart></my-highchart>
and whenever you set/change the "options" attribute, you'll see the chart updated. This is a simplified example, but the key is you'll have complete control over your custom highchart component.Beta Was this translation helpful? Give feedback.
All reactions