impact icon indicating copy to clipboard operation
impact copied to clipboard

Suggestion: use Impact to propose an example solution for "scalable frontend" challenge

Open IdacraBackup opened this issue 1 year ago • 7 comments

Hi Christian, thanks for sharing your 3rd new state management library ^^ I like where you are going with Impact, especially being able to manage the scope and instanciation of reactive hooks providers. I think it should be a good fit for the application challenge that was popular some years ago but I believe is still relevant today: https://github.com/slorber/scalable-frontend-with-elm-or-redux

IdacraBackup avatar Sep 14 '23 14:09 IdacraBackup

Hi @IdacraBackup!

Haha, yeah, I just can not seem to help myself 😂

Though it is really interesting how at CodeSandbox we chose to completely embrace React to solve certain issues we had with global state management. We did to some extent solve these issues, but we also painfully realised what makes global state management great in the first place 😄 Through iterations we developed some abstractions at CodeSandbox that has a similar API surface to Impact, though the hooks was still tied to React and its reconciliation loop.

So Impact is really trying to grab the essence of what makes global/scoped state management great, and what makes React hook/component composition great.

I am super excited to the next video, I actually just finished the example. It will be the first video showing actual code and what Impact solves from a practical perspective 😄

Thanks for the link, I will make sure to implement a version with Impact 👍

christianalfoni avatar Sep 15 '23 15:09 christianalfoni

I checked the repo and last update was 5 years ago and there is a pending PR there. Just know if it is still used? 🤔

christianalfoni avatar Sep 17 '23 11:09 christianalfoni

Sorry for not replying I didn't get a notification for your reply.. Congrats on the release candidate!

Yes the repository I linked is old and I was not suggesting to make a PR there. The interesting part is the application challenge they describe which was made to show how complex it is to solve with all available state management libraries. When I saw what your are doing with Impact I figured that it could actually be able to solve that application challenge pretty well.

So my suggestion was to try to make an application corresponding to that challenge using Impact. Maybe it will confirm that the Impact API works well even in this challenging situation or maybe you will discover something missing :)

IdacraBackup avatar Jan 24 '24 15:01 IdacraBackup

Oooooh, I see! Yeah, that would be fun! I'll create a little somethin' somethin' and share it here 😄

christianalfoni avatar Jan 25 '24 08:01 christianalfoni

Cool! If you wanna make a stream on YouTube as you do sometimes I'll definitely watch!

IdacraBackup avatar Jan 28 '24 07:01 IdacraBackup

So I have been looking at the examples here, and I am a bit confused by it 😅

So from what I understand there is a:

  • global GIF fetcher which increases a global count of fetching GIF images
  • global enable state which multiplies the global count if enabled
  • a local component which takes a GIF image as prop
  • a local enable button component which takes an onClick as prop
  • a local counter component which takes a count as prop

The example is of course artificial, but I am not sure what it tries to highlight. Cause the way you could connect this things is:

  1. I create create a wrapper component for the single, double etc. GIF images and just use the wrapper component state to keep the state of the nested GIF images
  2. The GIF image component itself could rather take a fetcher as a prop and manage all the state on its own, where the passed fetcher just increases its count when used
  3. I could artificially create a "context" around these single, double etc. GIF images, though that feels very much overkill... but maybe that is the idea 🤔

Anyways... I could do a stream with the premise I set up and dive into these three solutions, just to talk around it? 🤔

christianalfoni avatar Feb 12 '24 07:02 christianalfoni

I'll try to write here this week a better explanation

IdacraBackup avatar Feb 13 '24 09:02 IdacraBackup