Online since 1990 Yes! I started with Gopher. I do modern Web Component Development with technologies supported by **all** WHATWG partners (Apple, Google, Microsoft & Mozilla)
The final GZip size for this Web Component is 296 Bytes, What does using a Library add?
"state" is just a location in memory
Like everyone who has ever done Assembly programming knows
Using the DOM (just a location in memory) as "state" not only shortens the code,
but also make count updates by changing the DOM directly possible.
Something that never works when using Frameworks or Libraries.
You can do a simple experiment with your 5 year old daughter. All you need is a pen and paper.
She is the "Web Component", have her write a number on the paper.
Now you "Global script" take the pen, strike through her number and write 42 on the paper.
Ask her what the number on the paper is.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
When making a comparison between Web Component Libraries and Native code; then at least make it a fair comparison:
I do like the code-golf examples in this thread; I am sticking with readable Web Component code for the comparison:
this.onclick
allows a Component user to overload the click event.bind
stuffconnectedCallback
, if you only work with shadowDOM (or already parsed global DOM)disconnectedCallback
, any handlers attached to elements inside our Custom Element will be garbage collectedthis.shadowRoot.querySelector("b").textContent
repetition.<count>
is an UnknownElement, perfectly valid to use for better semantic code"state" is just a location in memory
Like everyone who has ever done Assembly programming knows
Using the DOM (just a location in memory) as "state" not only shortens the code,
but also make
count
updates by changing the DOM directly possible.Something that never works when using Frameworks or Libraries.
You can do a simple experiment with your 5 year old daughter. All you need is a pen and paper.