Build Components in JavaScript Without a Framework

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024

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

  • @andriussokolnikovas1577
    @andriussokolnikovas1577 3 года назад +4

    Nice video, thank you.
    I've just noticed that in hightlitRating function we compare strings; which result in comparsion by lexicographical order, where if we use more than 10 star rating, 4>=10 return true. We should compare Numbers not a strings sm like Number(rating) >= Number(star.getAttribute('data-value'))

  • @Simple_Simon_UK
    @Simple_Simon_UK 3 года назад +5

    Why not create a web component?

  • @alexapostolo3329
    @alexapostolo3329 3 года назад +3

    would it not be better to create a custom element that generates the whole star-rater dynamically and then exporting that as a component?

  • @ertugrulsenceruzun9772
    @ertugrulsenceruzun9772 3 года назад +1

    Dayı yaşın başın kaç olmuş kod yazıyorsun, emekli ol sen boşver

  • @pepijn1967
    @pepijn1967 4 года назад +6

    It appears that in the world right now, one keep on choosing complex solutions like js frameworks which creates a shitload of kb's as it grows and they put even the css and html in the javascript as well and even throws some typescript on top of that (the cherry on the pie....of course), hopefully that is coming to an end....i used es6 modules in a large financial company in 2017 and the developers in the team i was taking part of were very happy with that. In the first place they were yelling for angular...but they made a U-Turn very fast, fortunately

    • @sectorx20
      @sectorx20 4 года назад +1

      You should try Vue.JS... It's Vanilla with chocolate.

  • @matthewclarke1926
    @matthewclarke1926 3 года назад +2

    Nice ending. I'm starting a new app and want to complety let go of jquery, backbone, require.js, underscore.js... all my front end dependencies. Can you recommend some content that gives an overview of the file structure for a substantial app? Was thinking of using BEM block names to organize the file structure. Thanks for the video.

    • @LeeBrandt
      @LeeBrandt 3 года назад +2

      For a "substantial" app, I would probably still use a framework (like Angular, React, or Vue). Just because they have basic standards for project structure that will make it easier to onboard new developers. You _could_ follow one of those structures without it, but there are things like state management and other plugins that will seriously speed up development.

    • @vaniad555
      @vaniad555 3 года назад

      @@LeeBrandt the one thing we should be after a speed up, too bad you stopped at that point :(

  • @Andrew-ch9wp
    @Andrew-ch9wp 2 года назад +1

    Hey Gandalf

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

    All these things you NEED that you don't need , is when the snowball starts. And it's a pretty fkd up snowball by this time

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

    Amazing!

  • @jamesmarsh3842
    @jamesmarsh3842 4 года назад +7

    this man is a reaaal wizard lol.

  • @BathingAfrican
    @BathingAfrican 2 года назад

    lol dawg you look like one of those mysical dev lords

  • @ashish21999
    @ashish21999 2 года назад

    Thanks, Please create more such videos.

  • @caribbeanman3379
    @caribbeanman3379 3 года назад +2

    Huh! You call *that* a component? A real component would be creating the elements in js, style and all!

  • @JohnStrandt
    @JohnStrandt 3 года назад

    I knew you should be able to do this, thanks for explaining.

  • @rotinaindependente
    @rotinaindependente 4 года назад

    It's simple, but works, has organized scaffold and helps with maintainance, great job!

  • @johannesvandemerwe
    @johannesvandemerwe 3 года назад

    great video, I really something here

  • @qwertt14
    @qwertt14 2 года назад

    Great video, thanks!

  • @vojtechsebo4119
    @vojtechsebo4119 4 года назад +1

    Why new Rater? Rater isnt constructor function ;)

    • @duechilidance5388
      @duechilidance5388 4 года назад +1

      the function can be used to contruct a new obj with new keyword

    • @vojtechsebo4119
      @vojtechsebo4119 4 года назад

      Ofcourse, but in your case you dont need it.

    • @rotinaindependente
      @rotinaindependente 4 года назад

      @@duechilidance5388 Yes the function can, but He don't use this keyword and any methods binded to prototype to create instances with this "constructor"

    • @rotinaindependente
      @rotinaindependente 4 года назад

      Yes isn't a constructor but the new keyword call the function the same way, sooo, whatever :)

  • @kanaillaurent526
    @kanaillaurent526 4 года назад +6

    Not a Web component neither a custom element and no unit test.

    • @LeeBrandt
      @LeeBrandt 4 года назад +3

      It is a reusable component. Because it's a sample app there are no unit tests..

    • @hellelo.5840
      @hellelo.5840 4 года назад

      its a resuable UI component

    • @rotinaindependente
      @rotinaindependente 4 года назад

      Yes just an example, you can create the component however you want, it works and pay the bills :D Now, if you want to add more quality and complexity to your app, this video isn't for you!