Build Components in JavaScript Without a Framework

  Рет қаралды 26,794

OktaDev

OktaDev

Күн бұрын

Most JavaScript developers have a favorite framework. But what if you just want a simple component on a regular HTML website? Bringing in a whole framework is totally unnecessary. In this screencast, I'll show you how to build a component with plain-old, vanilla, JavaScript!
Okta is a developer API service that stores user accounts for your web apps, mobile apps, and APIs.
* Sign up for Okta for free at developer.okta.com/signup/
* For more info visit us at developer.okta.com/
* Developer Blog: developer.okta.com/blog/
* Follow us on Twitter: / oktadev
* Follow us on FB: / oktadevelopers
* Follow us on LinkedIn: / oktadev

Пікірлер: 30
@rotinaindependente
@rotinaindependente 4 жыл бұрын
It's simple, but works, has organized scaffold and helps with maintainance, great job!
@andriussokolnikovas1577
@andriussokolnikovas1577 3 жыл бұрын
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'))
@JohnStrandt
@JohnStrandt 3 жыл бұрын
I knew you should be able to do this, thanks for explaining.
@alexapostolo3329
@alexapostolo3329 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?
@jamesmarsh3842
@jamesmarsh3842 4 жыл бұрын
this man is a reaaal wizard lol.
@justlutfi2890
@justlutfi2890 3 жыл бұрын
gandarf
@matthewclarke1926
@matthewclarke1926 3 жыл бұрын
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 жыл бұрын
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 :(
@ashish21999
@ashish21999 2 жыл бұрын
Thanks, Please create more such videos.
@qwertt14
@qwertt14 2 жыл бұрын
Great video, thanks!
@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
@Simple_Simon_UK
@Simple_Simon_UK 3 жыл бұрын
Why not create a web component?
@johannesvandemerwe
@johannesvandemerwe 3 жыл бұрын
great video, I really something here
@cristian702
@cristian702 2 ай бұрын
Amazing!
@pepijn1967
@pepijn1967 4 жыл бұрын
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 3 жыл бұрын
You should try Vue.JS... It's Vanilla with chocolate.
@Andrew-ch9wp
@Andrew-ch9wp 2 жыл бұрын
Hey Gandalf
@vojtechsebo4119
@vojtechsebo4119 4 жыл бұрын
Why new Rater? Rater isnt constructor function ;)
@duechilidance5388
@duechilidance5388 4 жыл бұрын
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 :)
@ertugrulsenceruzun9772
@ertugrulsenceruzun9772 3 жыл бұрын
Dayı yaşın başın kaç olmuş kod yazıyorsun, emekli ol sen boşver
@BathingAfrican
@BathingAfrican 2 жыл бұрын
lol dawg you look like one of those mysical dev lords
@kanaillaurent526
@kanaillaurent526 4 жыл бұрын
Not a Web component neither a custom element and no unit test.
@LeeBrandt
@LeeBrandt 4 жыл бұрын
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!
@caribbeanman3379
@caribbeanman3379 3 жыл бұрын
Huh! You call *that* a component? A real component would be creating the elements in js, style and all!
Intro to Web Components - Full Walkthrough
33:31
Before Semicolon
Рет қаралды 23 М.
Шокирующая Речь Выпускника 😳📽️@CarrolltonTexas
00:43
Глеб Рандалайнен
Рет қаралды 11 МЛН
WHY THROW CHIPS IN THE TRASH?🤪
00:18
JULI_PROETO
Рет қаралды 8 МЛН
When Steve And His Dog Don'T Give Away To Each Other 😂️
00:21
BigSchool
Рет қаралды 15 МЛН
Build an app with WebComponents in 9 minutes
8:48
vaadinofficial
Рет қаралды 82 М.
How are devs logging in? #security #programming
0:51
OktaDev
Рет қаралды 747
Introduction to Building Custom Web Components
13:02
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 27 М.
Build Your First Javascript Library (Like jQuery!)
13:55
DevSage
Рет қаралды 59 М.
How to Do 90% of What Plugins Do (With Just Vim)
1:14:03
thoughtbot
Рет қаралды 867 М.
The Story of Next.js
12:13
uidotdev
Рет қаралды 537 М.
Где раздвижные смартфоны ?
0:49
Не шарю!
Рет қаралды 744 М.
Дени против умной колонки😁
0:40
Deni & Mani
Рет қаралды 11 МЛН
iPhone 15 Unboxing Paper diy
0:57
Cute Fay
Рет қаралды 3,1 МЛН
wireless switch without wires part 6
0:49
DailyTech
Рет қаралды 2,6 МЛН
сюрприз
1:00
Capex0
Рет қаралды 1,1 МЛН
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 3,4 МЛН