Learn Web Components In 25 Minutes

Поделиться
HTML-код
  • Опубликовано: 5 июл 2024
  • React was the framework that really popularized component driven development, but they weren’t the first and are definitely not the only tool for creating components. JavaScript actually has its own built in way to create components called web components which have many of the same benefits of React components. In this video I show you how to create your very first web component as well as how web components work.
    🌎 Find Me Here:
    My Blog: blog.webdevsimplified.com
    My Courses: courses.webdevsimplified.com
    Patreon: / webdevsimplified
    Twitter: / devsimplified
    Discord: / discord
    GitHub: github.com/WebDevSimplified
    CodePen: codepen.io/WebDevSimplified
    ⏱️ Timestamps:
    00:00 - Introduction
    01:36 - Basic Web Component
    05:07 - Shadow DOM
    08:32 - Slots
    13:00 - Lifecycle Methods
    17:40 - Extending Existing HTML Elements
    #WebComponents #WDS #JavaScript

Комментарии • 434

  • @loogie5679
    @loogie5679 Год назад +255

    Man, you don’t need those clickbait thumbnails. You make amazing content and that’s enough for most of us to watch all of your videos

    • @ZhuJo99
      @ZhuJo99 Год назад +3

      Exactly!

    • @dannbrown
      @dannbrown Год назад +3

      I agree...

    • @MelodyBeats.
      @MelodyBeats. Год назад +2

      Agree

    • @air_kene3419
      @air_kene3419 Год назад +5

      I was looking for this exact comment!

    • @wiseman9960
      @wiseman9960 Год назад +1

      Maybe this kind of framework-agnostic, standardized tech will eventually end stuff like React.
      I mean yes the thumbnail looks like a clickbite but it could be as well close to the truth

  • @raulnoheagoodness
    @raulnoheagoodness Год назад +11

    I've watched a number of your vids, but 2/3s in, this is my fave of yours ever by far. In recent years I've tried doing web components using Angular and Svelte. But this vanilla is version is super clean!

  • @ayushkushwaha171
    @ayushkushwaha171 Год назад +26

    My company uses them heavily, they moved from angular to web components and made their own library, it's still new to many new joiners coming from react/angular background, it's like a new playground for us but its fun, we get to learn more core stuff about javascript and browsers.

    • @Ryan-mg2uv
      @Ryan-mg2uv 8 месяцев назад +3

      This is the mindset to have, it's a great opportunity to learn something new

    • @VisualArtRonny
      @VisualArtRonny 5 месяцев назад +1

      Nice, I love those things too, they're my main occupation :)

    • @switchlyrics.
      @switchlyrics. 4 месяца назад +1

      Our company also use that

    • @nix7705
      @nix7705 3 месяца назад

      ​@@Ryan-mg2uv Guys, you are annoying, i try to learn react with it's all libraries, but someone always saying "end this", "end that", "use something ${random} different", it is not about "Web Dev Simplified", it is Zoo

  • @bobdinitto
    @bobdinitto Год назад +21

    Well, Kyle, you just blew MY mind... I'll have to watch this video about 4 more times to fully absorb it but my first take is that this is incredibly powerful and somewhat fortuitously perfectly meshes with the technology that I've recently developed for my current project. I built a class-based component system from scratch which allows me to encapsulate the HTML, callbacks, and event handlers of a component into a Javascript class. (I punted on the CSS - it's all in one big file!) So all of my components are ALREADY Javascript class instances. By tweaking a few things I can perfectly integrate with web components! I'm floating on a happiness cloud right now. Thanks for this, I'm going right now to get a celebratory beer!

    • @CirTap
      @CirTap Год назад +1

      if you're already coding on that level, I'm surprised you haven't heard/played with web components earlier. They're basically supported since late 2018 and anybody who loves writing JS classes wet dream :)

    • @zyriab5797
      @zyriab5797 5 месяцев назад +1

      You can even import your CSS in JS files with "CSS Module Scripts", it's basically a ES-style import for CSS files :)

  • @chrisbolson
    @chrisbolson Год назад +1

    Great video and great timing - I have just spent the afternoon converting one of my projects into a web component.

  • @clnguye
    @clnguye 10 месяцев назад +1

    Unbelievable content! Kyle has way of making complex concepts clear.

  • @CrzyMan_Personal
    @CrzyMan_Personal Год назад +7

    I see where Svelte garnered a lot of inspiration! Svelte doesn't use web components, but I just really appreciate the abstraction it allows that work in a very similar way.

  • @403gtfo
    @403gtfo Год назад +2

    Wow that is a lot of power and awesomeness right out of the box. Awesome videos.

  • @terasss2
    @terasss2 Год назад +32

    I'm still somewhat derusting on Web Dev and sticking to more basic techniques, but I will come back to this tutorial as I can definitely see this becoming useful in the future. I can also see why it may be easier to just use a framework such as React ;) . I also wanted to say that I really love your channel and everything you show in your videos!

    • @orionh5535
      @orionh5535 Год назад +4

      If you are into Objected Oriented programming, and are working on a front end only project, it really is the way to go.
      That is, if dont want the performance and SEO issues that come with straight up using react or similar without server side rendering
      If you are building a webapp you know will be big, yeah setup next js. If you have to build a few features, like a cart for an ecommerce site, i personally dont see a point in react.

    • @subhasrini2706
      @subhasrini2706 Год назад

      Same here👋

    • @user-fr2fm3ri3w
      @user-fr2fm3ri3w Год назад

      @@orionh5535 Seo is a myth it’s not 2007 anymore

    • @nemanjatrivic9505
      @nemanjatrivic9505 Год назад

      Yeah i see this is maybe good to pair with old school backends like django where you need few dynamic components. Components are a good native way of doing frontend.

  • @Smartmetricai
    @Smartmetricai Год назад

    Great new thing I learned today now I can create my own tags ,etc it's very helpful!

  • @dazraf
    @dazraf Год назад +1

    Great video thanks! I've been using web components for the past three years and I absolutely love them.Much easier to work with than React. I'm never going back.

  • @MrVipulLal
    @MrVipulLal 9 месяцев назад

    All your videos are simply brilliant. Love your channel.

  • @faithmorante
    @faithmorante 6 месяцев назад

    I'm implementing an Infinite scroll from scratch, without any JS frameworks, thought of using native apis just like web components. Thanks for this tutorial! I get it more now :)

  • @ErickPereziChido
    @ErickPereziChido 8 месяцев назад

    Great tutorial on Web Components. Thank you!

  • @kw9ng
    @kw9ng Год назад +1

    I use this to build amazing many companents. Web components so awesome

  • @ascourter
    @ascourter 7 месяцев назад

    Great overview! I feel like I understand the shadowDOM a lot better now.

  • @LanbasaraEric
    @LanbasaraEric Год назад +6

    Great tutorial on Web Component!
    Most frontend developers have only heard of web component but have no experience with it.
    I often hear people talking about Rust and web component together, can Kyle introduce the connection between these two things? That would be so cool!

  • @068LAICEPS
    @068LAICEPS Год назад

    I know lightning web components and always wanted to learn web components. Thank you!

  • @stormybear4986
    @stormybear4986 3 месяца назад

    Kyle, I am constantly impressed by your professionalism and the scope of your knowledge. you are obviously very well-educated, you always use correct terminology and clearly understand the terminology quite profoundly. I am curious about how you developed your knowledge, are you self-taught, did you do a good bootcamp, or what?

  • @MatthewM770
    @MatthewM770 Год назад

    This guy is the Andrew Kramer of the coding world. Clear, concise and explains the things that people may commonly not know.

  • @CirTap
    @CirTap Год назад

    nice overview of how these beasts work. 👍🏻 A bit more about scoped styles would've been nice.
    The "expandable-list" however is essentially + just lacking all their native features and accessibility stuff thereby demonstrating that it's often a really bad idea to recreate any interactive native HTML element from scratch.
    It's usually the lack of keyboard support, ARIA, and the presumtion that everyone is using a "fine pointer device" (mouse) with a scroll wheel.

  • @airpancho
    @airpancho 5 месяцев назад

    Note that Safari does NOT support customized built-in elements (is="").
    Great video - love web components (which actually already exists for like 10+ years) and their reusability. I believe that this is the future. I got tired of new / changing frameworks and you don't always need a JS framework.
    Also for everyone who doesn't like to write HTML in JS, you can still wrap the HTML in your custom tag, like it is shown with the default slot. That way you can e.g. use your server side rendered translations or just put everything into a partial, to be able to reuse it.

  • @al-gassimsharafaddin7289
    @al-gassimsharafaddin7289 Год назад +3

    This is really cool! Thank you for pointing it out. I agree that it could happen that we no longer need libraries for most of these things. It's similar to how it was only through Bootstrap that you could easily make Grids and Flex but now it's something in most browsers. 👍

  • @user-ui5uu8ps4b
    @user-ui5uu8ps4b 6 месяцев назад

    This is gold. These web components are being used in Lightning Web Components in Salesforce

  • @AhmadMaartmesrini
    @AhmadMaartmesrini Год назад

    Man respect your audience feeling!
    End of react, I just started learning it 😂

  • @7heMech
    @7heMech Год назад +5

    This is awesome, thanks!

  • @jameshuggins2520
    @jameshuggins2520 Год назад +1

    Great video mate. Fairly new to web dev so possibly a silly question. could these be used a bit like handlebars templates to include global nav and footer elements etc?

  • @noipsend757
    @noipsend757 Год назад

    The best channel in youtube!

  • @niloneregato5097
    @niloneregato5097 Год назад

    Great work!

  • @abhijeetprabhu4117
    @abhijeetprabhu4117 8 месяцев назад

    Nice video. Thanks for making these.

  • @sherifbadawy8188
    @sherifbadawy8188 Год назад

    You can learn typing in 4 days of 45 mins a day, I took your great React course but typing mistakes ruins it, I think a basic typing tutor software for 4 days, and you are good for life. friendly advise to a great teacher. thank you

  • @Fanaro
    @Fanaro Год назад +3

    Another minor tip: VS Code has an extension for syntax highlighting HTML or CSS template strings.

  • @CyberTechBits
    @CyberTechBits Год назад

    @WebDevSimplified Excellent video! Can you do a deep dive on js classes for your next one?

  • @AgentZeroNine1
    @AgentZeroNine1 Год назад +20

    Web Components + CSS Module Scripts (import assertions) + CSS variables (Custom Properties) are the best modern web APIs in my opinion. They make developing large web apps a lot easier to maintain. Also, Redux and MobX work very well with Web Components.

    • @konfcyus4865
      @konfcyus4865 Год назад +2

      Can you give any examples of a large app that uses that stack?

    • @Kiev-en-3-jours
      @Kiev-en-3-jours Год назад +1

      @@konfcyus4865 Why would you need that? I don't know any big app whose architecture and code are high quality. Seriously have you ever look at Meta or Google websites?
      You have the worst possible mentality. Become an artisan, an artist coder. Don't follow the extremely bad practices of big corporate apps.

    • @AgentZeroNine1
      @AgentZeroNine1 Год назад +2

      @@konfcyus4865 Adobe Photoshop for the Web, ING bank, GitHub, some of Reddit, etc etc etc.

    • @konfcyus4865
      @konfcyus4865 Год назад

      @@Kiev-en-3-jours I would need that to have an idea and understanding of how they can be integrated to a large app , to learn. Afaik google and meta uses WC for some widgets , becoming an artisan requires you to use the most optimal tool to solve a problem , my experience with WC is that they are not optimal.

    • @trappedcat3615
      @trappedcat3615 Год назад

      @@konfcyus4865 Why does the app need to be large? What does that imply or tell you about using the web spec.

  • @MrTiulia
    @MrTiulia Год назад +1

    Great video, learned a lot, just small note, that it is a bit dirty to put a list into a list instead to put a list into a list item if you want a nested list

  • @charbelboughazale3994
    @charbelboughazale3994 Год назад +1

    web dev as usual with the best content, that can teach us about shadow dom faster than any other course, thank you for your hard work.
    If my development skills are awesome is because of this legend!
    😜

  • @allenbythesea
    @allenbythesea Год назад +4

    I've been getting into WASM a lot lately and self contained components are amazing to use with the blazor implementation. I think this is the future of web development. The concepts are tricky though and I, like others need some time to absorb it.

    • @abrotherinchrist
      @abrotherinchrist Год назад

      All the pros seem to be talking about it these days. "Don't forget Rust."

  • @ashik_moosa
    @ashik_moosa Год назад

    Certainly need a tutorial on lit element with javascript & its benefits over vanilla web components & server side rendering supports, declarative shadow dom

  • @Thassalocracy
    @Thassalocracy Год назад +4

    Thanks a lot Kyle on this video about web components. It turns out that web components can actually be shared between different frameworks (React, Vue, Angular, Svelte?) so this is one big reason to learn about them. Although TBH, this video does make me appreciate how much React has simplified building components, seeing as the class-based API for web components can be really verbose.

    • @XCanG
      @XCanG Год назад +1

      Honestly after looking at this I can say that it is better this way than too simple way. The biggest problem with react is that it do too much behind a scenes and if you don't know it too well you will make mistakes and wont understand how some things got work until you spend a lot of time with a framework and not just keep repeating mistakes, but learn new things and how better to write code with it, which becoming in the end a lot of time consuming task.

  • @chinmayghule8272
    @chinmayghule8272 Год назад +14

    I just recently learned web components, and they're really awesome. There's also Lit framework based on web components. I hope you can also make a video on it as a followup.

    • @trappedcat3615
      @trappedcat3615 Год назад +3

      Lit copied core concepts from HyperHTML and gave no credit to the dev. Is what it is, but I'd check out the original work.

    • @plopplok9461
      @plopplok9461 Год назад +2

      @@trappedcat3615 lit is based on polymer that was the prototype for the w3c for web component.

  • @Fanaro
    @Fanaro Год назад +1

    But what about your recommendations for when to choose Web Components over typical frameworks?

  • @TechInterpreter
    @TechInterpreter Год назад +3

    Thank you for this video. I've been using Vue and the various slots for is components for a while now. I don't see myself writing my own custom elements. But this did help me better understand what's going on under the hood in Vue. And that makes it easier to use and, undoubtedly, I'll make better use of what Vue can do. The slot feature won't seem like a mystery in a black box now.

  • @mohammadalaaelghamry8010
    @mohammadalaaelghamry8010 7 месяцев назад

    Great video, thank you

  • @AhmedHeb
    @AhmedHeb Год назад

    great job 👏

  • @tk4776
    @tk4776 Год назад +2

    Web components have been the future since 2015, I’m amazed people isn’t using them. WC are based on web standards which won’t change depending on the framework you use, react/angular/vue standards change from versión to version, but WC don’t.
    The learning curve is a bit more challenging. But man the re-usability is endless.
    You can have an input-core component with tons of custom features/events/attribute and simply when you need it import it, but if you need specific things but not necessary to change the input-core wc you simply extend the input-core and make a new one with the benefits of the base class and the benefits of the new implementations without losing time

    • @ibgib
      @ibgib Год назад

      Ah ty for specifically mentioning inheritance. So you have implemented this DRY approach with web components? Any gotchas or tips/vids regarding this specifically? All I seem to find is using Lit/Stencil which seems to defeat the non-framework approach.

  • @shashankbhatt6342
    @shashankbhatt6342 Год назад

    Very Nice informative video my friend.

  • @isachinj
    @isachinj 3 месяца назад

    Do you need the outer wrapping span around the slot if it is anyways going to replace the slot with span coming in?

  • @karanjamadar9370
    @karanjamadar9370 Год назад +8

    The thumbnail of this video is going get an heart attack in react developers heart'😅

  • @ryanmorris5709
    @ryanmorris5709 Год назад

    What would advance styling look like for these custom elements? For example, in the various websites where this could be used, the projects might use bootstrap, materialUi, etc.

  • @jsonkody
    @jsonkody 3 месяца назад

    This is both amazing and very cumbersome compared to something like Vue .. which is why I wont use it unless it is absolutely necessary.
    But awesome job with the video, if I ever need it I am sure I watch it again :D

  • @uplink-on-yt
    @uplink-on-yt Год назад

    I think something is missing from the video: emitting events from web components so you can addEventListener on your custom todo-item, to know when the user ticks/unticks them. Do you just bubble up the events through attributes like ... and this.addEventListener('change', (e) => this.onChange(e))... or something like that?

  • @JoshChagani
    @JoshChagani Год назад

    I’d really like to see a web component button integrated into React. Like, how would you call onClick with a custom element and would there need to be something special within the web component to register that something in the virtual dom was clicked.

  • @bmehder
    @bmehder Год назад

    I'd love to see a first reaction video to Svelte.

  • @Pluvo2for1
    @Pluvo2for1 Год назад +2

    I'm less than 2 minutes in and Shadow Dom appears. Damn, I better go and look that up.

    • @bobdinitto
      @bobdinitto Год назад +1

      I too am ready to jump on that Shadow Dom. I've heard of it but I wasn't really sure what it was...

  • @mohtashimali581
    @mohtashimali581 Год назад +1

    looks cool but it depends on whether we need to do it that way or not, else I would go for react

  • @JordanICM
    @JordanICM 7 месяцев назад

    When I was at a full-stack bootcamp, one of my teachers who was a real smart guy from MIT was basically trashing on React. He said that web components and things like the shadow DOM already make your website fast, and that React was unnecessary for this (granted he still had to teach it to us). Ever since then, I've been super curious to see if it's really true. I wonder if someone can make two identical sites with React vs. Web Components & Shadow DOm, and see which ones faster.

  • @alivenumber5
    @alivenumber5 6 месяцев назад

    Does this javascript have to be shipped out to the browser or is the underlying DOM composed finally of "standard" HTML? I ask this because it has implications on server side rendering versus sending pages as a more front-end heavy single page app.

  • @jscul
    @jscul 3 месяца назад

    Why do you do the updateStyles in the connected versus constructor? What's the difference?

  • @aselivra
    @aselivra Год назад

    I have never disliked a WDS video until this one, and it's only because of the click bait. You're better than that, Kyle.
    I'll continue upvoting all your other vids that don't resort to click bait.

  • @kshitijrangari7014
    @kshitijrangari7014 Год назад +1

    How useful is Web Components? Usually modern day in industry the challenge we face is moving away from old front end frameworks to a newer one while still supporting the legacy applications.
    It would be great if we could have web components built in react that can have their own styles which are then embedded into legacy applications which allows for seamless transition from older to new framework.

  • @shaikhyamin3464
    @shaikhyamin3464 Год назад +1

    I would like a tutorial on next js

  • @0xAndy
    @0xAndy Год назад +2

    20:22 Haven't you introduced an accessibility problem by appending a button element as a direct child of the UL? is invalid HTML.

    • @Greg8872
      @Greg8872 Год назад +2

      And also later on when doing sample of the nested list, shouldn't that whole second UL be instide a as well

    • @nullternative
      @nullternative Год назад +1

      Fellers... hope the point of the video wasn't missed.

  • @rishiraj2548
    @rishiraj2548 Год назад

    Thanks

  • @luzaw4957
    @luzaw4957 Год назад +1

    Slot is not bad. However, instead of extending UL element, I'd rather create a button with down arrow in DOM directly.

  • @user-mu4pq6ls8y
    @user-mu4pq6ls8y 5 месяцев назад

    Do you have video for advance concepts in web component

  • @felix-ve8jk
    @felix-ve8jk Год назад

    Where did you copy those styles from 19:37

  • @gm770
    @gm770 Год назад

    As a big fan of Web Components, I would like to hear from the other side, How a front-end framework might be better. And leave out the fluff about community and a few less lines. I want to know about features provided.
    In the past, I have used the pre-TS version of Angular for about a year, JQuery for longer, and Vue for a few months. Using Django now on a project, but that's a back-end framework, not a front-end framework. Looking back, I would not return to any of the 3. Learning JQuery felt like a complete waste, since it provided nothing over Vanilla JS. Both Angular and Vue left me addressing bugs that were not mine, and I felt mostly addressed issues I didn't care about.. Only thing I liked about those 2 were how templating worked, but I was easily able to make my own JS code to mimic what I liked about templates. I also liked how Vue used fewer files than something like React, but WC's also uses just 1 file.

  • @user-cl3gh9yi8f
    @user-cl3gh9yi8f Год назад

    hi is there a way to map the shadow dom using Array?

  •  День назад

    This is somewhat nice, but oh dear god I can see the next issues arise.
    Naming your components in such ways that they do not create issues with other components and technologies used.

  • @damar1967
    @damar1967 Год назад

    Is there a way to get syntax highlighter and completion on the HTML template? Passing string for the HTML and style doesn't seem scalable. I'm spoiled by typescript and vscode extension.

  • @malikpandey4896
    @malikpandey4896 Год назад

    Hi Kyle!
    Would you like to guide us about Speech to text APIs?
    Please think about it.

  • @sitedel
    @sitedel Год назад +10

    As is the custom "todo-item" checkbox will not be part of any form submit.
    Why ? Because the shadow DOM hide the checkbox from any parent form.
    To avoid this your custom element must either extend FormElement instead of HTMLElement or set the static "formAssociated" value to true.
    Like Kyle did for the "checked" style, your custom element should also mimic and propagate the behavior of the parent form element regarding state|value change, reset, validation ("pattern" property and :valid :invalid pseudoclasses for styling) and autocompletion ("list" property).
    The input may also act like a form element without extending FormElement by altering the formdata value generated on form submit. I don't like this idea because it implies that a custom component may spy formdata submits without being visible in the DOM (so could read or alter value from other fields of the formdata....).

  • @RakeMeUp
    @RakeMeUp Год назад +2

    my man cut into his own sentence in the start lmao

  • @djalexxxgr
    @djalexxxgr Год назад

    I use web components almost 2 years for building Design Systems that are agnostic of the JS framework that are going to be used. Web components are feature proof because is plain JS and CSS. To build my components I use StencilJS that is a compiler that uses Typescript and JSX and in my humble opinion is superior than Lit Html.

  • @ashwin2114
    @ashwin2114 Год назад

    Keeping shadow root closed, Will the componemt render in UI?

  • @EzequielRegaldo
    @EzequielRegaldo Год назад +1

    You can import css from external file with type assertions and use components js native constructor instead plain html with innerHTML (its a bad practice btw)

    • @Scuffy
      @Scuffy Год назад

      Explain more pls

  • @kumailn7662
    @kumailn7662 Год назад

    it would be good to write ui library that could be use in different framework, but i can't replace react or angular like frameworks

  • @ZhuJo99
    @ZhuJo99 Год назад

    I like to watch your great instructional videos. So please, so not fall into sensational titles and empty content bullshit like many other channels do (not related with web development).
    You don’t need this to grab views.
    Keep up the good work.

  • @gmd2171
    @gmd2171 Год назад +18

    Please make a one hour video on NEXT js .
    It would be a great favor Kyle 🌚

    • @mauro21523
      @mauro21523 Год назад +2

      Watch the Net Ninja

    • @gmd2171
      @gmd2171 Год назад +2

      @@mauro21523 Brother, Kyle has just another level of explaining stuff that I love. Net Ninja is a great instructor too. Thanks

  • @basil127
    @basil127 Год назад

    I am interested with web component but too lazy to explore.. thanks for this video..

  • @rodelcrisosto499
    @rodelcrisosto499 Год назад +2

    End of react? I haven't learn it yet. 🤣

  • @prateekbhardwaj9943
    @prateekbhardwaj9943 Год назад

    which keyboard you are using?

  • @shahidkhan69
    @shahidkhan69 Год назад

    It’s a bit tedious because of the imperative api. Maybe if someone creates a declarative api for this and also, what about performance?

  • @yoyopo4111
    @yoyopo4111 Год назад +1

    Is that part of under the hood of Angular?

  • @paschalokafor9043
    @paschalokafor9043 Год назад +1

    Vue also has named/custom slots

  • @ismailMerced
    @ismailMerced Год назад

    I just learned it 🐸

  • @Natrel62
    @Natrel62 Год назад +3

    I just discovered that Web Components are a thing but at the end it looks a lot like a VueJs component (with slots, scoped styling etc) except it seems to be a bit more tedious.
    I think it can be nice for smaller projects and to grasp the components usage

  • @asgharibraheem8938
    @asgharibraheem8938 Год назад

    i think this include much more js and html n CSS that is why libraries and framework come into play, but in future these web component will grow because their native behavior

  • @victorromeo949
    @victorromeo949 Год назад

    Let's do this

  • @navaneethbuilds
    @navaneethbuilds Год назад

    Please also cover alpinejs ...

  • @geforcesong
    @geforcesong Год назад

    maybe helpful for vanilla js project. if you have already adopted React or other frameworks which support component, this looks too complex to be integrated.

  • @devperatetechno8151
    @devperatetechno8151 Год назад

    finally!!!!

  • @planetchubby
    @planetchubby Год назад +2

    Many developers prefer to use frameworks like React or Vue because they provide a higher level of abstraction and a more opinionated way of building web applications. Additionally, React and Vue have large and active communities, which provides a wealth of resources and support for developers. One of the main disadvantages of web components is that they are implemented using classes, which may not align with a developer's preferred programming paradigm or style. Classes in JavaScript are a relatively new feature and some developers may be more comfortable using a functional approach. React and Vue both provide a functional approach to building web applications. React's components are implemented as functions and Vue's single-file components can be implemented either in class or functional way, so if you are more comfortable with functional approach, you can use frameworks like React or Vue, which provide a functional way of building web components.

    • @outwithrealitytoo
      @outwithrealitytoo Год назад +1

      Yes, I agree about the frameworks. I do think they handle a lot of these "behind the scenes" scenarios so I don't have to. Not all the funky ins and outs are handled by every browser and the fact that the different frameworks implement the same thing differently shows that the approach is far from obvious. Frameworks are a good way of piggy-backing on the expertise of others and to use the new features without having to rewrite the application business level code. As I was watching this video I did occasionally think "I wonder if that is how Svelte does that?". Sure, you give up a bit in terms of absolute flexibility, but even that is not necessarily a bad thing ("style guides" vs "fantastic innovation - what do you want in your UI?).
      Selecting and customising components shouldn't be an every day task. Once you have them set up devs should be using them no re-writing them for every page. The aesthetic of consistency should be paramount.
      The sparkle of OOP tarnishes when it hits the real world. With the addition of classes, Javascript is evolving from a Poor man's Lisp to Poor man's Java - not a step forward. I'd rather see the world move from OOP to Functional than the other way around. But as with evolution where Platipus and Coelacanth are still perfectly evolved for their niches, perhaps JS is destined to have some dead-end variants.

  • @abnoco
    @abnoco Год назад +1

    I'm still a novice. Just when I think I can see the bottom of the rabbit hole, I find out the bottom I thought I saw is really a turn and hole keeps going.

    • @abdelrahman6319
      @abdelrahman6319 Год назад

      Don't get distracted by clickbaits, technologies don't go and disappear in a blink of an eye. In addition, react popularity is currently increasing and hasn't reached its peak yet. So stay calm and learn what you are learning

  • @bluecaret
    @bluecaret Год назад +1

    How could we do state management across multiple web components without any libraries? Can that be the next video?

    • @gm770
      @gm770 Год назад +3

      From my experience, the best way to manage state with multiple WC's is custom events. It's really up to the developer, since you can also call methods on them or listen for attribute changes. But with custom events, you can decide if you just want to bubble up to the parent, or all the way out to the root. In addition, custom events let you carry whatever information you want.

    • @bluecaret
      @bluecaret Год назад +1

      @@gm770 Thanks! Been trying to search for this since watching the video and not a lot of people seem to be talking about it. I think I was overcomplicating it in my head, so your comment is definitely helpful.

    • @gm770
      @gm770 Год назад +2

      Glad to help. Been using Web Components for about a year now, and continue to be impressed how well they work when you start nesting components. Works exactly as you expect it to, no hassle, and great support in Chrome Dev Tools.

    • @DaviAreias
      @DaviAreias Год назад

      There are multiple ways to manage state you can even do it with pure CSS

  • @muhammadnishad.p.n1170
    @muhammadnishad.p.n1170 Год назад +12

    I started react today 😄

    • @chhavimanichoubey9437
      @chhavimanichoubey9437 Год назад +3

      Same here im at beginning stage, and we see videos like this😶 demoralizing me

    • @MahBor
      @MahBor Год назад +3

      @@chhavimanichoubey9437 same

    • @compton8301
      @compton8301 Год назад +16

      Don't fall for clickbait videos that make money off adsense- react is not going anywhere.

    • @muhammadnishad.p.n1170
      @muhammadnishad.p.n1170 Год назад +8

      Keep going…

    • @Harmxn
      @Harmxn Год назад +2

      @@chhavimanichoubey9437 Just use React

  • @yolkyhorizon
    @yolkyhorizon Год назад +4

    React is overcomplicated and this provides the control I want. this is super cool
    edit: I am never touching React again

    • @winzyl9546
      @winzyl9546 9 месяцев назад +1

      you just dont understand react

    • @yolkyhorizon
      @yolkyhorizon 9 месяцев назад +1

      @@winzyl9546 Now I am in a point in my programming career where I might never touch a front-end framework anymore. To be honest, yes. I do not understand React but now I don't have to.

  • @dpaulflavius
    @dpaulflavius Год назад +1

    come on man, don't go there please, you're one of the best guys doing tutorials about dev. end of react? react killed by web components? man you don't need clickbaits..you're better than that ;)
    and web components are shit, maybe the title should be: an easier and simplified way of creating web apps using web components..
    I'll hit the like button out of respect, but please don't go there

  • @fueledbycoffee583
    @fueledbycoffee583 Год назад +2

    I actually tried to implement web components, but when you have to deal with data heavy applications i find web components quite a pain to hydrade, pass props, share data from child components to components up the tree and so on... They are just so barebones. i ended up replacing them with Vue

    • @chrishuhn5065
      @chrishuhn5065 Год назад +1

      How to hydrade, pass props and share data is exactly what I was wondering about watching this. Any tips for good documentation or tutorials besides MDN?

    • @fueledbycoffee583
      @fueledbycoffee583 Год назад +2

      @@chrishuhn5065 actually. Nope, i had to read the MDN WC documentation and understad whats up.. the thing is that WC dont bring reactivity to the table. So you still need to use (all be it, better separated) MVC pattern. And i never could get slots to work, so i could not have custom data inside my WC.... So totally discarted them. They are waaaaayy to bare to be functional for me for a real project. Unless you take the time to write a wrapper class that give a better DX for WC... they are not ergnocomic AT ALL

    • @fueledbycoffee583
      @fueledbycoffee583 Год назад +2

      @@chrishuhn5065 also to hydrate them and pass props you have to do this ugly thing where you pass to the web component a data propert like lest say "my-data" in the web component class register that property, set up getters and setters serialiase the input of that prop. Kf you wanted to pass and object or an array. Welp, you had to serialize it as JSON then de serialize it inside the getter of that property for later use

    • @chrishuhn5065
      @chrishuhn5065 Год назад +1

      @@fueledbycoffee583 Thank you. It looks like it's as bad as I had feared it would be.

  • @hineko_
    @hineko_ Год назад

    could you make the left part of the screen larger to let people watch this on phones, and the right part dark, so it wouldn’t burn your right eye when watchinng in the evening )