Can I add state-based UI to a Web Component?

preview_player
Показать описание


⏳ Timestamps

00:00 - Intro
01:32 - Recap of Project
02:15 - What is state-based UI?
05:04 - Converting the Component
32:38 - Debugging Jump-To-Move
41:00 - Wrapping Up
Рекомендации по теме
Комментарии
Автор

Really enjoying these Web Component videos Chris

zephyr
Автор

Your library looks very cool! I will definitely be using it

terrencemoore
Автор

Hi,

I'm new to your channel and i would like to thankyou for covering about web component since i was really interested about it

CLeovison
Автор

Love your content... I wish I had found it 12years ago... It would have saved me lot of time on my VaJS journey...

cloudpuncher
Автор

Wow glad I inspired u haha. Or maybe not. Let's watch this.... If I understood well, line 118 will act like each time u change the object square it will trigger a rendering.

kanaillaurent
Автор

What's your typical threshold for when to use state-based UI? When traditional DOM manipulation is becoming too much?

I have a project that might be at this threshold. The project involves an iframe and a UI that modifies content inside the iframe. When the user interacts with the UI, we dispatch a custom event to update the iframe, update it, then dispatch a custom event to update the UI. This was fine for a while but some updates to the UI were getting quite complex.

For now, I switched to simply re-rendering the UI and managing keyboard focus for accessibility. It doesn't seem to harm performance at this scale, but it's a potential future issue.

With a state-based UI approach, I guess I would maintain a central data object that represents the shared state of both the iframe and the UI? Reef may be a good fit for my needs in this case.

davidluhr
Автор

Hey, just a little thing but a few times (e.g. 12:15) your coding was covered up by your picture. Might want to scroll a bit in future to keep the code visible :)

svivian