Danny Engelman 🌷🏍️🛥️
@engelman.nl
60 followers 54 following 450 posts
I do modern Web Component Development with technologies supported by **all** WHATWG partners (Apple, Google, Microsoft & Mozilla) 👨🏻‍💻TRS-80 Scriptkiddie '79+ 🎓 Computer Science '87 - '92 ❤️ Online since 1990 yes! 1990 I started with Email and Gopher
Posts Media Videos Starter Packs
attachShadow sets ands return this.shadowRoot

and append( ) (not available in IE) is a whole lot more versatile than oldskool appendChild( )

If you then add a 1 line framework
You end up with vanilla code:
And how would that help to make the distiction between user-agent HTML tags and user HTML tags (Custom Elements)?

<h1> and <my@h1> ?
Great example, I stole it 😇
then refactored it to fit my lesson style, because you get
this.shadowRoot for free and don't need a container DIV inside shadowDOM... and I prefer to log to the screen instead of console

jsfiddle.net/WebComponent...
connectedCallback runs for every DOM insertion AND mutation - JSFiddle - Code Playground
JSFiddle - Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle.
jsfiddle.net
shadowDOM is older than React

But us mortal Web Component developers couldn't use it till years later

𝙨𝙞𝙣𝙘𝙚 𝙬𝙝𝙚𝙣 𝙙𝙤𝙚𝙨 𝙪𝙨𝙚𝙧-𝙖𝙜𝙚𝙣𝙩 𝙨𝙝𝙖𝙙𝙤𝙬𝙍𝙤𝙤𝙩 𝙚𝙭𝙞𝙨𝙩 𝙞𝙣 𝙩𝙝𝙚 𝙗𝙧𝙤𝙬𝙨𝙚𝙧𝙨?

#webcomponents
> Any tag name even without a dash is valid too!

You can use it, but will always be a HTMLUnknownElement

is HTMLElement,
a UNdefined Custom Element at first, which CAN (but doesn't have to) become a Defined Custom Element.

I blogged about this in 2021

dev.to/dannyengelma...
Web Components using UnknownHTMLElements for better semantic HTML
Using Web Components to draw Pie Charts with semantic HTML
dev.to
> party like it's 2006

TBL his WebBrowser did this... in 1991
You can replace the DIVs-soup with undefined Custom Elements too:

without using JavaScript, only HTML and CSS styling
You don't get more functionality, only readable HTML,
no more hunting for that closing DIV

dashed-html.github.io
I would choose Svelte too.

All is fine if you are happy with that Build step,
you don't care what the code in the browser looks like,
never debug vanilla in the Browser,
never continue with components from project A into project B.
> How did I not know this?

Do you think there are people who know everything?

Josh didn't know 𝘱𝘢𝘵𝘩𝘓𝘦𝘯𝘨𝘵𝘩 until multiple people sent him an email he was doing 𝘴𝘵𝘳𝘰𝘬𝘦-𝘥𝘢𝘴𝘩𝘢𝘳𝘳𝘢𝘺 a bit complex.

I learned 𝘤𝘲𝘸 units today.

Never stop being curious.

I love Web Components because you can disect them
and this.localName === "gutter-editor-pick" ?
Welcome on the Learning Path.

There are 2 paths, you either publish your own 𝘐-𝘤𝘢𝘯-𝘥𝘰-𝘞𝘦𝘣-𝘊𝘰𝘮𝘱𝘰𝘯𝘦𝘯𝘵𝘴-𝘣𝘦𝘵𝘵𝘦𝘳 BaseClass by the end of the year,
or you don't
september 25th 2025, a young man's superintelligent AI system tells him that he must go on a date or face certain suicide from loneliness.

It's a tall order for a guy who hasn't left his apartment in 42 days and is more than happy to stay at home with technology.

www.youtube.com/watch?v=NZ8G...
Sci-Fi Short Film “A Date in 2025" | DUST
YouTube video by DUST
www.youtube.com
What word is spelled?

ChatGPT thought for 7 minutes and 17 seconds, and said:

𝙋𝘼𝙒𝙉𝙎𝙏𝘼𝙍

Wrong word, because AI is great at logic, but can't think...

What word do you see?
Just remember to set

𝙙𝙞𝙨𝙥𝙡𝙖𝙮 : 𝙞𝙣𝙡𝙞𝙣𝙚-𝙗𝙡𝙤𝙘𝙠
or
𝙙𝙞𝙨𝙥𝙡𝙖𝙮: 𝙗𝙡𝙤𝙘𝙠

yourself on elements / web components

dev.to/dannyengelma...
Not a DIV inside/in sight/site
You can replace all &lt;div&gt;&lt;/div&gt; with...
dev.to
> a bit reminiscent to the old days where you just drop in
> a bunch of js scripts to tinker your toy projects

You can even have fun WITHOUT JavaScript,
because all browsers support Custom Elements since 2018,
and EVERY tagname with a dash IS a VALID HTMLElement.
Thus you can replace every DIV
You can not do: 𝘤𝘭𝘢𝘴𝘴 𝘦𝘹𝘵𝘦𝘯𝘥𝘴 𝘚𝘝𝘎𝘌𝘭𝘦𝘮𝘦𝘯𝘵

But you *can* create SVG with a Web Component

I have answered 193 Stack Overflow questions
with a 𝙒𝙚𝙗-𝘾𝙤𝙢𝙥𝙤𝙣𝙚𝙣𝙩-𝙘𝙧𝙚𝙖𝙩𝙚𝙨-𝙎𝙑𝙂 answer thus far

stackoverflow.com/search?q=use...

Like using HTMLUnknownElements to create a
dev.to/dannyengelma...
Web Components using UnknownHTMLElements for better semantic HTML
Using Web Components to draw Pie Charts with semantic HTML
dev.to
Dear AI,

You were trained on blog-posts that do not show the chaining of super in:

super().attachShadow({mode:"open"})

That does not make your statement below right.

super() DOES return the this scope
Dat ligt eraan, als je React kent is dat de beste optie, wil je standaard bestendig de komende 5 jaar zonder veel upgrade issues werken, dan is Lit beter
Cool! Reminds me of ZebraZapps by dr. Michael Allen
who also did the infamous Macromedia Authorware in the 90s
We happily paid $999 a year for it
(in 2007 deleted from existence by Adobe)

en.wikipedia.org/wiki/Adobe_A...
flowline based authoring

www.zebrazapps.info/features
wiring based authoring
> never seen the execution of inline functions
> in a tagged template (pls correct me)

My Web Component (2021) creates
animated SVGs from a Template Literal
using (pre-defined) functions

innerHTML String ► Template Literal String ► SVG

BLOG: dev.to/dannyengelma...
That site cuts some corners. The biggest error:

► You can't access attributes in the constructor;

Simply tested with a
𝘥𝘰𝘤𝘶𝘮𝘦𝘯𝘵.𝘤𝘳𝘦𝘢𝘵𝘦𝘌𝘭𝘦𝘮𝘦𝘯𝘵("x-header")
in the Dev console
Its not the "standard" path into Web Components.

Most experiment with Web Components, deem them too verbose or just plain stupid to write.

Then write their own I-can-do-better framework around Web Components, and publish to NPM for all the world to use.

webcomponents.dev/blog/all-the...
All the Ways to Make a Web Component - Feb 2022 Update
Compare coding style, bundle size and performance of 61 different ways to make a Web Component.
webcomponents.dev