Pete Hunt: React: Rethinking best practices -- JSConf EU

Поділитися
Вставка
  • Опубліковано 15 лип 2024
  • Slides: www.slideshare.net/floydophone...
    React, the new open-source JS library from Facebook and Instagram, is a different way to write JavaScript apps. When it was introduced at JSConf US in May, the audience was shocked by some of its design principles. One sarcastic tweet from an audience member ended up describing React's philosophy quite accurately: / 339858717451362304
    At Facebook and Instagram, we're trying to push the limits of what's possible on the web with React. My talk will start with a brief introduction to the framework, and then dive into three controversial topics: Throwing out the notion of templates and building views with JavaScript, "re-rendering" your entire application when your data changes, and a lightweight implementation of the DOM and events.
    License: For reuse of this video under a more permissive license please get in touch with us. The speakers retain the copyright for their performances.
  • Наука та технологія

КОМЕНТАРІ • 239

  • @samasama2627
    @samasama2627 3 роки тому +490

    I'm here to see if this talk might convince me otherwise.

    • @kushalupreti509
      @kushalupreti509 3 роки тому +5

      Lmao. Me too

    • @Gioeufshi
      @Gioeufshi 3 роки тому +26

      @David Smitherman heroes? Seriously? Learning react is now a heroic act?

    • @musicdev
      @musicdev 3 роки тому +4

      @@Gioeufshi Lmao my thoughts exactly

    • @muhammadasadhaider6893
      @muhammadasadhaider6893 3 роки тому

      did it?

    • @guilhermealveslopes
      @guilhermealveslopes 3 роки тому +5

      @@Gioeufshi The bane of "business talk and job culture", and the famous "hero everything" in web frontend...
      Hero section, Hero app, Hero Carrousel, Hero highlight, HERO ANYTHING WHATSOEVER.
      Annoying how a bunch of people take one word, and use it to imply only one small facet of what its meaning invoke, and overused it ad infinitum...

  • @ismailbenlaredj
    @ismailbenlaredj Рік тому +35

    who came from the react documentary ?

    • @recursion.
      @recursion. Рік тому +1

      What's the point of this comment and why does it matter?

    • @catharsis222
      @catharsis222 7 місяців тому

      What react documentary?

  • @pengwang5800
    @pengwang5800 6 років тому +762

    On the React Docs, they told me : " this talk might convince you otherwise." so Im here.......loooooool

    • @gduran3
      @gduran3 6 років тому +2

      same

    • @Saurabh2816
      @Saurabh2816 6 років тому +6

      Same. I'm fairly new to React and following it's official documentation. Can you suggest me any good resources you are following?

    • @hegdevishwa
      @hegdevishwa 5 років тому

      Me too :D

    • @ezesundayeze5159
      @ezesundayeze5159 5 років тому +7

      The doc is fine. It's four months now, I'm sure you must have gotten a hang on it by now. You can take Maximilan's free course on UA-cam if you aren't good yet with it.

    • @MenukaIshan
      @MenukaIshan 5 років тому

      Same here :D

  • @DioArsya
    @DioArsya 6 місяців тому +4

    10 years later and I still got a lot of new insights from here 🤯

  • @codenamegrant
    @codenamegrant 3 роки тому +153

    Almost 8 years later and this talk is just as relevant and informative about how React works and why we should be using it.
    Did anyone else shocking whisper "Holy shit" when you saw what React code looked like on 2013? :D

    • @benzemamumba
      @benzemamumba 2 роки тому +7

      I still don't buy into the grotesque looking code of React, that's why Angular and Vue will forever be my go to technologies.

    • @SimonLevesque
      @SimonLevesque 2 роки тому +10

      @@benzemamumba I was finding the code awful as well when I was looking at the small examples, but when looking at a real example, the JSX part in the render function pretty much looks like a template and everything else managing it is just pure JS. I wasn't sure about not using bi-directionnal binding since I am so much used to it, but that actually makes everything simpler to not have to care about how the frameworks does bi-directionnal binding (which leads to different limitations per framework). After trying the short tutorial, I was actually hooked

    • @AlexanderTrefz
      @AlexanderTrefz 2 роки тому +3

      8 Years later and you still should avoid all of these bloated and pointless frameworks that are bigger than entire well structured apps.

    • @danielvega646
      @danielvega646 11 місяців тому

      well... To be honest, I just learned React because the job asked it, because you get jobs really easy if you know React. Now, if you ask to my neerdy heart what is better? I have a long list of frameworks way better than React. For me, React is bad albeit popular.

  • @jmrossy
    @jmrossy 10 років тому +73

    "Re-render don't mutate," my biggest takeaway.

  • @tomascarignano5002
    @tomascarignano5002 2 роки тому +7

    This is amazing to watch at this point in time!

  • @Felix-un7yp
    @Felix-un7yp 8 місяців тому +3

    A talk that made it into the history books of app development. From React to SwiftUI to Flutter , the reactive frameworks have transformed the whole industry .

  • @popopome
    @popopome 10 років тому +27

    Really interesting. I felt same emotion & motivation when I watched Clojure presentation from Rich Hickey. Thanks.

  • @jamjam3448
    @jamjam3448 3 роки тому +28

    Who else is here from Reactjs docs. Lol. I'm here to be convinced!

  • @ervinsabic1104
    @ervinsabic1104 3 роки тому +4

    I'm not convinced otherwise. Handlebars is just so clean.

  • @rishacha
    @rishacha 6 років тому +5

    Watching this in 2018, came from the documentation and loving React !!

  • @user-ht6hs6io8w
    @user-ht6hs6io8w 6 років тому +2

    Thank you, Pete and React team!

  • @ginger-bread_man
    @ginger-bread_man 4 роки тому +2

    The talk that kickstarted a new way of JS & GUI dev

  • @jayyoung7577
    @jayyoung7577 19 днів тому

    great talk. As a backend engineer, I wish people showed me this when I tried to understand the design patterns for Frontend.

  • @atulpatil2289
    @atulpatil2289 2 роки тому +3

    I'm here from react docs...what a valuable video

  • @dbug64
    @dbug64 10 років тому +5

    That was a great talk Pete. I'm very exited about Reactjs. :)

  • @lightninginmyhands4878
    @lightninginmyhands4878 3 роки тому +23

    Best part of the talk, as a novice programmer, is diving into virtual DOM as 19:30

    • @yikan1107
      @yikan1107 Рік тому

      yeah, they havent explained how fibers work but it feels like they are doing depth first memoization of the app component tree.
      The fibers are compared, not the object-in-object vdom model.
      From videos, they compare fibers to a virtual call stack but i prolly need to EFF around with it.
      I think there virtual dom is a vague word to describe what the component based frameworks are doing.
      Anything that uses nested component instances represented by is going to be a virtual dom by nature of these objects in objects representing the document object model.

  • @arindam1249
    @arindam1249 4 роки тому +14

    " this talk might convince you otherwise."

  • @lazykid9167
    @lazykid9167 4 роки тому +10

    wow, at the end realised this is from 2013 !? wtf. great talk

  • @Sid2896
    @Sid2896 8 місяців тому +1

    Being a React developer coming from a Mechanical background the whole story of REACT give me goosebumps. I wished i was there in the infant stage of React back in 2013

  • @roolebo
    @roolebo 7 років тому +15

    I like how React API was designed. It's almost the same as it was 4 years ago! That can be a sign of carefully chosen abstractions that as good today as they were a while back.

    • @sfafsashfdh6589
      @sfafsashfdh6589 2 роки тому +2

      4 years later it is same

    • @spht9ng
      @spht9ng 2 роки тому +6

      @@sfafsashfdh6589 Functional components and hooks have changed things greatly though.

  • @milahu
    @milahu 4 роки тому +2

    sounds like a talk on unix philosophy ....
    modules vs monilith, bazaar vs cathedral, villages vs empire
    sounds like part of the "paradigm shift" towards an actually functional "one world" order
    conjunctio oppositorum .... mutual completion of opposites

  • @NortheastGamer
    @NortheastGamer 4 роки тому +7

    I spent this whole video thinking "Dude! Drink some water!"

  • @madhurgarg8866
    @madhurgarg8866 6 років тому +6

    Pete hunt left no stone unturned to market React, but no doubt React is awesome. Thank you team facebook!!

  • @Stevenchustudio
    @Stevenchustudio 5 років тому +15

    17:40 - React components are just idempotent functions, that describe your UI at any point in time, just like a server-rendered app. **Again, because they're just functions that take some parameters, and output a description of the UI, they are very easy to unit test.**

  • @dvdrtrgn
    @dvdrtrgn 2 роки тому +2

    This is a seminal discussion about the beauty and utility of a virtual dom. It loosened up hard notions about what separation of concerns means.

  • @avimehenwal
    @avimehenwal 3 роки тому +2

    Amazing talk, wow

  • @johndough6978
    @johndough6978 7 років тому +228

    someone give him a glass of water!

    • @louismaresca
      @louismaresca 6 років тому +6

      LoL I was thinking the same thing after watching for like 7 mins. Glad this is like the second comment in the stack.

    • @micgol
      @micgol 5 років тому +9

      Watching this video made me drink lots of water.

    • @funmeister
      @funmeister 5 років тому +3

      A defibrillator would have been important as well.

    • @nickharalampopoulos
      @nickharalampopoulos 5 років тому +1

      My thoughts exactly. Do not start a speech while being dehydrated! :-)

    • @bitsplz
      @bitsplz 5 років тому +4

      Great content but its so painful to watch!

  • @aarc2010
    @aarc2010 5 років тому +4

    The video and content is marvellous. But gosh, Pete is struggling, I need a glass of water for myself after that.

  • @m.a7473
    @m.a7473 6 років тому +20

    So JSX looks like html but it actually is function. Thank you. I have less anxiety using it.

  • @edchelstephens
    @edchelstephens 2 роки тому

    Thanks a lot man!

  • @Dehhloki
    @Dehhloki 3 роки тому

    You king of convinced me

  • @EddyVinck
    @EddyVinck 3 роки тому +1

    I have been convinced

  • @klingonprogramming3868
    @klingonprogramming3868 2 роки тому +1

    Love React...ur right frameworks shouldn't force us to code in a certain way...

  • @sabuein
    @sabuein Рік тому

    Thank you.

  • @dante_ele
    @dante_ele 4 роки тому +9

    Can someone recommend a talk or book that just speaks about the theoretical concepts, principles of React. Like this video.

  • @MiSt3300
    @MiSt3300 3 роки тому +6

    This should convince me to ditch my classical understanding of html and js being sparate... hmm I guess I should give it a try

  • @conw_y
    @conw_y 7 років тому +6

    Just re-visited this video ~4 years later for the nostalgia. Still loving React, still using it every day, still re-thinking best practices!

  • @hotmandead1
    @hotmandead1 4 роки тому +11

    The intro soundtrack ... I did react :-p

  • @rogerrodriguez9540
    @rogerrodriguez9540 4 роки тому +16

    These pretzels are making me thirsty

  • @yfzhangphonn
    @yfzhangphonn 8 років тому +10

    I felt like this brings us back to the age of web form but who knows, having html in js and having a middle layer between js and dom gives react supreme advantage over angular.
    Overall, in terms of Template: Angular > React
    but in terms of speed, debugging, available UI options... : React > Angular

    • @JuanPablodelaTorre
      @JuanPablodelaTorre 5 років тому +4

      Two years later: "in terms of speed, debugging, available UI options" Angular > React

    • @rutiancoren
      @rutiancoren 5 років тому

      @@JuanPablodelaTorre lol wrong.

    • @benzemamumba
      @benzemamumba 2 роки тому +1

      React is in NO way, shape, or form better than Angular!

  • @catharsis222
    @catharsis222 7 місяців тому

    This should be mandatory for every JavaScript developer in a bootcamp who is now learning about react

  • @muhammadnabeelasif1235
    @muhammadnabeelasif1235 2 роки тому

    Ahhhhhhhhhhhh. I'm convinced :)

  • @swyxTV
    @swyxTV 6 років тому +6

    amazing to watch this in 2017 when react is now the framework to beat!

  • @-cj-
    @-cj- 3 роки тому +4

    I will always serve static html that works without any dependencies whenever possible. Because css and js can always fail to download. And I love that I can still do this with React!

    • @-cj-
      @-cj- 2 роки тому +1

      @@carldrogo9492 I've come across several occurrences where files fail to load, hardly unrealistic. Going by your other comments, you just seem to hate programming in general.

  • @niteshsetin
    @niteshsetin Рік тому +1

    I am thinking to LEARN React

  • @zooroish
    @zooroish 3 роки тому +3

    I'm also here to be convinced otherwise!

  • @nitsanbh
    @nitsanbh 7 місяців тому

    Crazy to see how it started. No JSX. The ‘var’ keyword

  • @IAmIndraTheGod
    @IAmIndraTheGod 4 роки тому +4

    At ua-cam.com/video/x7cQ3mrcKaY/v-deo.html
    Instead of calling it composition, it should be called association. Because react can have components which can work/reused independently regardless of the parent type.
    Sometimes there can be aggregation as well as composition relationships between components. So should have been callled association

  • @sharabiani
    @sharabiani 3 роки тому +1

    this talk did NOT quite convinced me otherwise...

  • @boredhead
    @boredhead 2 роки тому +1

    Here to just check why it all started

  • @mahdi914
    @mahdi914 2 роки тому

    Oh yes, it convinced me

  • @nescau2.0silva88
    @nescau2.0silva88 5 років тому

    best video !!!

  • @colinren9692
    @colinren9692 4 роки тому +2

    Suggest to subtitle video,thanks

  • @soumadip_skyy_banerjee
    @soumadip_skyy_banerjee 3 роки тому +1

    Here to convince myself ;)

  • @andriiyurchuk3299
    @andriiyurchuk3299 3 роки тому +3

    From React Docs?))

  • @SebLeFrenchie
    @SebLeFrenchie 6 років тому

    Good video, I’m surprised there are only 30~ comments on it though

  • @xcatliu9191
    @xcatliu9191 9 років тому +4

    React is amazing

  • @GomesNia
    @GomesNia 3 роки тому +7

    8 years late to the party, but I have to point out the fact that the entire premise of his argument arises from him putting presentation logic inside the controller? Putting a "tableRowColor" in the view model is such a glaring violation of separation of concern. Presentation is style. It concerns the style sheet and nothing else. If you absolutely have to put it somewhere else, it belongs in your template, but in the example uses it's inserted into the view model (i.e. by the controller/component logic) which seems like such a textbook example of violation of SoC to me.

  • @franklinokolie8322
    @franklinokolie8322 Рік тому

    Amaziing....

  • @depiction
    @depiction 6 років тому +10

    The debate of whether it's best to add JS to HTML or add HTML to JS is merely a preference. I'm not convinced after watching this that adding JS to HTML is any better.
    This video and React's documentation claim that doing so separates concerns.
    Per this video, separation of concerns occurs by reducing coupling and increasing cohesion. Creating small reusable components reduces coupling. How a developer chooses to organize code that make up layers of a component (presentation, data, etc) does not affect coupling. I could create a single file component or a folder with separate files for each layer.
    Grouping components into modules increases cohesion, but again, the organization of the various code layers within the components that make up the module doesn't really matter.
    Therefore, I'd argue that adding JS to HTML doesn't separate concerns. It has nothing do to with separating concerns.

    • @JuanPablodelaTorre
      @JuanPablodelaTorre 5 років тому +1

      You shouldn't mix languages. It's more difficult for the entire tool chain to work with multiple languages in a single document. You should only use dependencies.
      Also, I agree.

    • @lazykid9167
      @lazykid9167 4 роки тому +1

      IMHO - There shouldnt be HTML and JS together in the first place. HTML was meant for mainly static stuff and to be amended a little by JS. These days we have superpower-ewwb-apps. If you ask me , there should be only JS + CSS.

    • @tstcikhthys
      @tstcikhthys 3 роки тому +3

      Agree mostly, except for the point about it being a preference. The web is fundamentally about documents: information being served and retrieved. JS had essentially nothing to do with this (unless you're running it on the server). It seems like these days, most people get lost in the shininess of JS and the technology du jour and don't seem to understand the fundamental purpose of the web. That's how you get incredibly misguided comments like the one above mine, where this person is claiming that the web should not have HTML because it's redundant.

  • @user-kx6ym6zs4e
    @user-kx6ym6zs4e 2 роки тому +1

    I'm not convinced otherwise

  • @barboshaa
    @barboshaa 6 років тому +29

    "Just don't write spaghetti code"... One could say the same about PHP

    • @dinocajic
      @dinocajic 4 роки тому +1

      Thank you!

    • @superharryboy
      @superharryboy 4 роки тому +9

      One could say the same about every programming language.

    • @kxmode
      @kxmode 3 роки тому +2

      ASP.NET code behinds are lasagna code 😬

  • @jeremymurray-wakefield8011
    @jeremymurray-wakefield8011 2 роки тому

    I wish I knew what the @cowboy tweet said. The account is suspended. Anyone know the contents of this fabled tweet?

  • @dulcisfate6060
    @dulcisfate6060 3 роки тому +2

    I hope this talk might convince me otherwise.

  • @siyangren6623
    @siyangren6623 4 роки тому +1

    Nobody can refuse tasty food ... 7:30

  • @JuanPablodelaTorre
    @JuanPablodelaTorre 5 років тому +15

    Dude made me thirsty.

  • @saliabbasraza
    @saliabbasraza 4 роки тому +3

    Why people are not REACTing to presenter.

  • @catharsis222
    @catharsis222 7 місяців тому

    Pete hunt is the senior team lead I wish I had so I can be one to my team

  • @rishabhgusai96
    @rishabhgusai96 2 роки тому

    Does react still work the same way? rerender, don't mutate

  • @brendonblaze
    @brendonblaze 3 роки тому +2

    This has convinced me otherwise

  • @thejimmylin
    @thejimmylin 2 роки тому

    What did the @cowboy twitter say? Does anyone know?

  • @SpaceGaia4Life
    @SpaceGaia4Life 8 років тому

    "child"... "partial" 7:20 ... react lapsus. Love it!

  • @julianzaltron9774
    @julianzaltron9774 5 років тому +2

    idempotent
    Mathematics
    1.
    denoting an element of a set which is unchanged in value when multiplied or otherwise operated on by itself.

  • @pongtime
    @pongtime 2 місяці тому +1

    Give him some water Jesus

  • @ElectricChaplain
    @ElectricChaplain 4 роки тому +2

    Phantomjs, phonegap lol. It says something at least that React has survived while these other technologies haven't.

  • @Kirshach
    @Kirshach 2 роки тому +4

    Watching this in 2021 feels exactly like Steve Jobs presenting the first iPhone

    • @andrewmelnikov292
      @andrewmelnikov292 2 роки тому +1

      Or every next iPhone.
      There are useful bits but you still feel like you've been fed a pile of shit.

  • @arunaveerappan4749
    @arunaveerappan4749 3 роки тому +8

    I don't think this convinced me as stated. I still support separating the presentation logic from data and its manipulation.

    • @rodwinpieterse1950
      @rodwinpieterse1950 3 роки тому +3

      Me too. i cringe whenever using React or anything else that has to deal with a hundred dependencies.

    • @benzemamumba
      @benzemamumba 2 роки тому +1

      It's a very mediocre and grotesque Framework that every shitdev pretends to love.

  • @gi66itz
    @gi66itz 7 років тому +11

    The row color example couldn't be a worse argument for coupled code. It can be a strong argument for RTFM. nth child has been handling this in 80%+ of browser marketshare for how many years? Styling logic doesn't belong in your templates, it's not 1999, those problems are solved. If you want to argue that this reduces HTTP calls that's fine, but when HTTP2 is up and running there wouldn't be as strong a need for this IMO.
    Less about the video at hand and more about the industry... As a developer who was working on the web at the turn of the century, I fear the future of using a framework instead of learning the underlying technology. Though web properties turn over every few years (or even months) these days, some don't and maintaining sites is "a thing". With each new framework turning the conventions of the technology on it's ear and then fading away when some new shiny framework comes around, this is just going to get harder...

    • @tstcikhthys
      @tstcikhthys 3 роки тому +1

      This. Every bit of this. I've seen this "let me make a completely controversial statement that throws decades of best practices out the window because _we_ are different and think we have something better" schtick far too many times. A few years down the line, they go, "Oops..." I mean even Facebook's original motto was "Move fast and break things", and now that they've actually grown up, it's "Move fast with stable infra"

    • @bigmistqke
      @bigmistqke Рік тому

      We are now almost 10 years later and frameworks are more relevant then ever. Those decades of best practices describe a www that just isn't anymore. Ur talking about the internet of the 90s and the 00s, lol.

  • @tamonanjester
    @tamonanjester Місяць тому +1

    anybody from Honeypot documentary? :)

  • @dennistel734
    @dennistel734 10 років тому +7

    Curious to see how React handles updating of millions of rows.

    • @NathanJohnson815
      @NathanJohnson815 5 років тому +24

      better than Angular?
      you also shouldn't be displaying millions of rows at once ;)

    • @caseymorris2937
      @caseymorris2937 4 роки тому +6

      Is there some reason you want to show millions of rows on a Web page?

  • @mayson12381
    @mayson12381 2 роки тому +2

    All I hear is is "we do the same what vue.js does now, except our syntax is ugly as hell"

    • @baldcoder_
      @baldcoder_ Рік тому

      You realize which one inspired the other, right? Also, as someone who worked with Vue well before touching React, JSX is only ugly in the hands of bad developers.

  • @alexgabriel5877
    @alexgabriel5877 6 років тому +1

    is it outdated?

  • @frdomirlo3361
    @frdomirlo3361 3 роки тому +2

    Not convinced... Why to keep it simple when you could do it complex... Native web components is a better alternative.

  • @fwd79
    @fwd79 4 роки тому +5

    So, React is basically VBScript for modern era. Fair enough.

  • @r3gum
    @r3gum 2 роки тому

    rethink stablished best practices

  • @abdelrahmannour3450
    @abdelrahmannour3450 3 роки тому

    Well, I'm not convinced

  • @connerjensen8170
    @connerjensen8170 5 років тому +2

    React is saweeet!

  • @kjellrasmundson4538
    @kjellrasmundson4538 3 роки тому +1

    same, funny they show a 7 years old video

  • @rewazilol
    @rewazilol 3 роки тому +1

    Great content. But someone please get this man a water, he's dying up there

  • @aroodt
    @aroodt 9 років тому +2

    Those generated sub-titles are kind of useless. At exactly 12:00 they get downright obscene.

    • @jsconf_
      @jsconf_  9 років тому +2

      Andre Roodt Just switched the flag, so you can fix them!
      The 2014 videos have sub titles from live captions created during the original talk.

  • @romankostelnyy6033
    @romankostelnyy6033 4 роки тому

    Is that still valid? Pete talked it 7 years ago

  • @leibaalex6641
    @leibaalex6641 2 місяці тому

    For god sake someone give him some water

  • @mtssvnsn
    @mtssvnsn 6 років тому +2

    Gulp...

  • @kisanpakhreen
    @kisanpakhreen 4 роки тому +1

    I like his laptop sticker :)

  • @mauritzswanepoel7985
    @mauritzswanepoel7985 3 роки тому

    Jeez someone should have just given the guy a bottle of water

  • @w0mblemania
    @w0mblemania 3 роки тому +7

    Question: if React is so good, why is the Facebook page so appallingly slow and resource-intensive?
    It's one of the worst offenders out there. It's a showcase for how NOT to make a web page.

  • @user-hc7vz8on4e
    @user-hc7vz8on4e 4 роки тому +1

  • @jez9999
    @jez9999 Рік тому

    No matter what else you make of React, the best thing about it IMHO is React Router. Declarative routing is so much more intuitive than having to go to a separate router config like in Vue. It's almost worth using React for that alone.

    • @alexgalays910
      @alexgalays910 Рік тому +2

      Weird, I find routing to be a tiny part of the app and it being declarative doesn't buy me anything at all.