Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer Experience: Time Travel #188

Open
bryphe opened this issue Jan 4, 2019 · 0 comments
Open

Developer Experience: Time Travel #188

bryphe opened this issue Jan 4, 2019 · 0 comments
Labels
A-infrastructure Area: Project infrastructure, build system, Ci, website etc. enhancement New feature or request

Comments

@bryphe
Copy link
Member

bryphe commented Jan 4, 2019

One thing that got me really hooked on the Redux/React ecosystem was the idea of time-travel - via Dan's talk: https://www.youtube.com/watch?v=xsSnOQynTHs

It was a really impressive concept to me - treating state as just an axis independent of time. However, in practice, I've never actually been able to use it with much success - I've introduced it in multiple apps, and either there were side-effectful things happening in the redux store, or state was tracked in other places, or the app was too big so it was slow to remove/add actions.

However - I believe that, in a fully-functional world, we're better equipped to handle these challenges, and perhaps introduce a more robust 'time travel' concept into Revery (or reason-reactify).

A couple of key points:

  • Reason/OCaml guide you towards a functional model - you have to go out of your way for mutability, refs, etc.
  • Core State Management - Revery manages state in two places - one is in the component model (which has some really neat ideas happening in [WIP] BUG: 'Long-lived' setState function fails to persist updates reason-reactify#44), and the other is in the app's 'store' (which is like a redux store). And only those two places (maybe the global store can go away eventually, too!).

OCaml / js_of_ocaml also has a really powerful Marshal module - https://caml.inria.fr/pub/docs/manual-ocaml/libref/Marshal.html - which can serialize arbitrary data structures to disk / across network / etc. It's much more powerful than something like JSON serialization in JavaScript, because it can actually serializes closures too with the Closures flag.

I believe that this combination of characteristics could give us the ability to implement 'time travel' in a more robust and usable way, out-of-the-box for revery or more generally reason-reactify.

It'd be neat to have an integrated dev tool available for this that is available in debug mode.

@bryphe bryphe added the enhancement New feature or request label Jan 4, 2019
@glennsl glennsl added the A-infrastructure Area: Project infrastructure, build system, Ci, website etc. label Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-infrastructure Area: Project infrastructure, build system, Ci, website etc. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants