Recoil: State Management for Today's React - Dave McCabe aka @mcc_abe at

Поділитися
Вставка
  • Опубліковано 25 сер 2024

КОМЕНТАРІ • 219

  • @sumanth3036
    @sumanth3036 4 роки тому +182

    I wish everyone can present their ideas like him

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

      its step by step, no missing step, and pressume audience dont know stuffs

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

      one day, i will do the same hopefully

  • @Andy-si1pl
    @Andy-si1pl 2 роки тому +20

    I can watch this again and again.
    He is actually explaining React very well as part of explaining Recoil.

  • @rickelmonoggin
    @rickelmonoggin 3 роки тому +61

    "Do you see this as replacing Redux?" - "yes" (immediately).

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

      I'm not sure. I really like the middleware approach in redux and extensions like sagas. Though they imho messed up the naming (especially for actions) and the overall presentation of the library. I think of redux more of a event sourcing library than simple state management.

  • @chetanchaudhary1017
    @chetanchaudhary1017 7 годин тому

    I have never seen someone explaining something so good....

  • @MaximilianoTechera
    @MaximilianoTechera 4 роки тому +40

    This library looks incredibly awesome!
    I'm looking forward to trying it out.

  • @maddogshwa
    @maddogshwa 4 роки тому +115

    +1 for any state MGMT tool that doesn't require me to make reducers. :)

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

    Mate, that's amazing! Well done and thanks for sharing with the world.

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

    Recoil looks amazing. With local state it covers almost all needs.

  • @yashpandey9181
    @yashpandey9181 Місяць тому

    His presentation skills are exceptional🙌

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

    *"..even change the background color....to lets see......white colourrrr....."* hahha
    Fantastic tutorial btw. I can't wait to see what this becomes. Thank you!

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

    OMG. This is incredible! I absolutely love it (having dealt with precisely this kind of problems before). Thank you.

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

    omg, I didn't know I could fall in love with a framework presentation.
    I've just been starting to learn redux for the last week or so on a side project that's actually similar to what was presented here (lots of divs, connected with SVGs, that can be dynamically moved and stuff), and things started to look messy. but now I can't wait to start using this!

  • @JLarky
    @JLarky 4 роки тому +40

    I like how whole tone of this presentation as if Redux didn't even exist

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

      I like the tone implying creating more and more absurd libraries to "do anything" is "normal" in some way, as if the backend guys just immediately caved to every whim of their PMs instead of pushing back, calmly discussing tradeoffs, and coming to a mutual compromise. This library for example is ridiculous - you're supposed to be avoiding mutable state like the plague, bending over backwards to prefer constants, then cached values, then mutable state only as a last resort, not building more and more libraries to make it easier and easier to use it.

    • @user-sw1wq8lh2w
      @user-sw1wq8lh2w 4 роки тому

      @@gsofficial I think we argue that mutable state is redux is bad because you can't identify the changes observably via mutation. This library doesn't have that issue, but I would like to see how it handles that situation of wanting to essentially subscribe to state changes.
      In fact at the very end, he suggests you can reduce over it and use the flux pattern.

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

      @@user-sw1wq8lh2w I was a backend guy for the first 6 years of my career at Google... trust me, it has nothing to do with whether it's on a browser or not.

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

      @@gsofficial correct me if I'm wrong, but Recoil state is immutable, same as React state. And this specific framework solves a problem that Redux fails at - rerendering only parts of the app that were affected by the change.
      As for mutable state, I thought the same until I checked Mobx.

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

      @@pumbo_nv not to sound glib, but one good way to avoid that problem is to abandon frameworks that "do the re-rendering for you" and handle it yourself. Then, when things get too complex, you know your app is too big, and that you have pushed the language too far.

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

    "We're going to enter the third dimension" is the nicest way I heard someone describe global variables.

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

    Thanks for sharing! I grew used to the simplicity and flexibility of Angular's dependency-injected services with RxJS, but if you need to build in React this seems to help correct the frustrating quilt-work of redux/useContext/useState/localstorage/etc/etc that can quickly become a hairy mess of shared state management and creation of derivatives. Thanks for making React data management easier to work with and your awesome presentation & drawings to make it clear!

  • @bitzeche
    @bitzeche 4 роки тому +69

    Is there any chance that you'll release the demo app from this presentation? As you said, Recoil is not very effective in a toy setting. Thanks for releasing Recoil this early!

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

      absolutely. We need the demo app.

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

      I would like this too!

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

      I need it too

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

      I'd like to see it too

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

      Agreed - the benefits of Recoil aren't that obvious with a basic app. I'm working on a tutorial video where I build something similar to David's example app. I'll post here when the video and repo are ready. 🙌

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

    Wow I love this library already, I have fall into similar scenarios before where I just had to use whatever it was available within React's core library, and things weren't rendering or performing as smooth as I wanted to be, it was just super sluggish and we couldn't really do much... now this library could easily fix those problem we faced before and we could certainly go back to those projects and fix those quite easily!
    Thank God for bringing you guys on board to help solving quite complex uncovered scenarios from the React core team, not that they haven't been already, but this is literally the next level of state management where not everybody would come across every day!
    Anyways I just wanted to say a massive thank you to you and your team behind this great library.

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

    I am building a React application and I have never use Redux because of my phobia of complex code or any other state management. But I was able to use Recoil, and I absolutely love it!

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

      Yeah, nothing like writing 800 lines of Typescript before being able to actually use the store...

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

    really great presentation. This looks like the way to go imo. I like the api a lot and loved the comment about state management ceremony, I've always felt this way with redux...

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

      I agree, this is pretty wild stuff. Like, the amount of boilerplate and bloat you have to create with redux, especially in larger apps, seems like quite a lot compared to the simplicity required to hook recoil in

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

    This is beyond awesome. It'll be as beneficial as hooks

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

    I love this demo, I learned so much about though process and limitations of different React features. thanks

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

    The presenter is very good at presenting and explaining the subject matter.

  • @phil-l
    @phil-l 4 роки тому +21

    This was extremely impressive, this is much much more easy to reason vs redux, Recoil feels like JSX where Redux is HTML

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

    This guy is great at explaining, so much information protrayed in 30 minutes

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

    Lots to learn. Thankyou Dave!

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

    The 3D idea to represent state is genius. Kudos!

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

    Been using for a couple weeks. Crazy simple. Thank you Recoil.

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

    Solved the same problem with rxjs, but this does look a bit nicer. One thing that could be of concern is exposing all of the atoms in a global scope.

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

    16 minutes in and my mind is officially blown.

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

    Good explanation and example! It looks amazing. We need something more simple and powerful then Redux. Keep working on this and I hope we will see a production ready release soon. Good luck!

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

    You are the best teacher. Your presentation, your analogy, your explanation is synced with atom

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

    wow simply amazing how easily he explains it !!

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

    Hard to believe I'm prepared to learn yet another state management lib. But Recoil seems clear and minimalist without skipping important things like performance.

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

    God I thought it was just me thinking that the current state management tools in react ecosystem are annoying as hell in some scenarios. This looks very elegant and natural, great presentation too. Kudos.

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

    I wonder why would you want to force constraint in the selector? this may result inconsistency between what's saved in the atom and what selected from the selector, may be hard to debug.

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

    Terrific presentation, thank you

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

    How lucky am I :D This is exaclty what I need. I stripped away all the props and all the throttling I disliked. Now everything is blazing fast and easy to maintain.

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

    I have learned so much of the basics, by watching this video! Recoil looks great, and you're a great teacher. Thanks for making this video

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

    Great idea and excellent presentation. Thank you for that.

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

    I really appreciate it, thanks a lot.

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

    This is similar to Hookstate except it doesn't look like it handles nested state very well. But I do like that you can dynamically add state/atoms.

  • @wepranaga
    @wepranaga 4 роки тому +35

    here from Ben Awad 😆

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

    At 17:42, Dave McCabe suggests that no changes are required after changing his function itemWithID(id) so that it returns a selector instead of an atom, but unless I'm wrong setItemState can't be used on a selector... Did I miss something?
    Edit : After having a look at the docs, this is indeed true if the "set" property is also set in the selector which basically makes it act as a proxy.

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

    This is pretty cool. I have been using RxJS with React to solve these types of issues, but the API shown in the examples looked pretty good. Will definitely experiment with this.

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

    Looks very promising! Definitely seems less complicated and easier to use than Redux.

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

    How about using atom values outside of react world ? For example in a helper function not tied to a component

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

    What a great talk! A few of the things seemed almost too good to be true (setting state on a selector), but looking at the docs it checks out :D

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

    He works for Pied Piper, right? 😁
    Great explanation. Thank you

  • @spacelord.5
    @spacelord.5 4 роки тому +2

    Dave, you are AWESOME!
    Thanks!

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

    Incredible video, what did you use to make the drawings in the presentation ? It looks awesome and I would be happy to use it in the future :)

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

    vue3 composition api for React, yay!
    nice to see the tools converging in concepts

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

    Does anyone know if this demo code has been open-sourced yet? It'll be great to be able to experiment over this app. Thanks

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

    I looked at the dom tree of my react code , and noticed that Recoil uses Context Providers as the underlying code.

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

    Thank you, wizards 🧙‍♂
    How many projects inside facebook use this technology currently? (May 2022)

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

    driving me nuts that the debugger isn't showing width or height -.-

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

    Absolutely fantastic. Will be using it asap!

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

    This is so much better than redux!!!!!

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

    It seems that a major feature is that it doesn't need the entire tree to re-render when a high-up context changes, but I thought the Context API uses subscriptions and already only updates subscribers?

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

    Will the demo code be available?

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

    Can you provide the repo for this demo? Amazing presentation, awesome tool.

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

    Nice clean API for solving a hard problem 👏🏻👏🏻👏🏻

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

    What is the status of this project?

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

    Wow, just wow

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

    Aren't these issues already solved with MobX? Why comparing with Redux. Should have mentioned MobX atleast once here.

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

      Maybe is because Redux is the default standard to do React apps. And if a "mobX" clone comes directly from the Facebook team it will make a great addition to the community.

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

      He talks about MobX at the end

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

      I want to see performance comparisons. Last I checked MobX didn't have the speed of Redux. Maybe this could have the speed and the ease of use.

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

      You what? MobX is light-years away more performant than Redux. Everything is memorized and optimized for you out of the box

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

    React comes with useAtom next year

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

    Why not just use MobX?

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

    It is very good i use it for everything, even small things.

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

    Great presentation Dave. Thanks.

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

    Very interesting concepts! Nice Work! Very inspiring as well.

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

    why is still in an experimental ?

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

    Selector is a PURE function that can be async in case it needs to calculate based on DATA FROM SERVER.
    It's either selector semantically imposes restriction on server data prohibiting it to ever change or selector shouldn't be recklessly called a pure thing.

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

    this man is a god

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

    Great Explanation and it looks really interesting and powerfull

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

    I feel this can help me write performant forms in React since the Context API has limitations - you cant subscribe to a piece of data and adding context dynamically is not something you can achieve per field, hence rendering all fields on every keystroke was looking at using Proxy but got complicated with nested form values.
    It feels like subscribing to a slice to data in context, something React is not providing natively, those kinds of use cases where performance is laggy, this library can help.

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

      I'd look at React Final Form, I quite enjoy using it. It uses render props and handles your state and subscriptions for you.

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

      implement debounce. You dont need state managment library for forms.

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

    Hi! I'm curious to know what did you use for this demo, this drag n drop resizable components components are awesome!

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

    great work! Is there a repo where we can find the source code of the example app you show in the demo?

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

    Could you share the repository of this project?

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

    Can you give a simple example, because you can only see some analysis from the video, but you can't see a coherent process, and some steps are still incomprehensible. If there is a complete demo, it will be easier to understand.

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

    I'm just speechless!

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

    Performant, really enjoying the use of that word, it just doesn't quite get used enough...

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

    When he said Async @18:15 ! :D

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

    Not sure that moving components' logic (constraints) into selectors is a good idea or they shouldn't be names as 'selectors'.

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

    Looks cool! Thank you 👍
    Looking forward to work with it

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

    Code for this demo app available somewhere?

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

    Awesome video, really well presented

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

    Have anybody tried react-rhino?
    It is a very light state management made taking inspiration from Recoil

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

    I still dont get how to do async updates.. cant find any example that works..

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

    easy to use, but the problem here is how to structure the file & state according to the business app? This is my concern. Personally, I think that redux is doing very well :3 so I hopefully will have some example or pattern about that soon :) so excited

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

    A question about the demo at 11:36: The highlighted areas in your slide (those with a yellow outline) indicate the components that are being re-rendered by React, not DOM updates, (although in this case they will be the same). My understanding is that the entire tree of components can re-render, but only those parts of the DOM that have actually changed will be changed in the DOM.
    So the optimisation here is reducing the number of render() methods that have to be called. The number of required DOM updates would have been exactly the same had you used Redux instead, even if every component had to be re-rendered every time.
    Have I understood this correctly?

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

    He is the one

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

    React already had beautiful hooks for state controlling, necessary only sharing mechanism.
    #ReactEurope can you make API the same as the "use-between" hook? To reuse exists React hooks for state control, and don't produce new hooks.
    What do you think?

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

    wow!

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

    Is it not the same if we put a subscribe-able (rxjs Subject) in a Contenxt Provider or directly push that subscription to useState?

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

      I feel like Recoil is much more flexible though especially for interdependent state. Sure, you can achieve shared state with rxjs subjects but it isn't quite that flexible.

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

    How does this compare and contrast with two-way data binding?

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

    Where can I get the source code for your app please ?

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

    cool implementation, its a unique twist on redux + effects + selectors, probably solves for a ton of the headaches. As you need to implement a single source of truth you'd likely end up back at some form of redux state.

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

    Does any one have the source code of this ?

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

    This is the way.

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

    can you mutate parent state from child components? that's the only thing I want to be able to do

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

    #ReactEurope Can you give this project ,for testing and learning ?