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

Use redux and redux-react to handle our state in our Notebook Editor/Interactive Window #2929

Closed
rchiodo opened this issue Oct 11, 2019 · 3 comments
Assignees

Comments

@rchiodo
Copy link
Contributor

rchiodo commented Oct 11, 2019

Our state is getting rather complex (and large).

Redux gives us the following benefits

  • Potentially easier state updates
  • Better logging about state transitions
  • Better separation of state modifications
@rchiodo
Copy link
Contributor Author

rchiodo commented Oct 11, 2019

My first idea would be to

  • Potentially rework our state to have something like (why are we maintaining the Cell structure?)
    • Inputs [] of some object
    • Outputs [] of cell output types
    • View Props [] of cell view states (selected, focused, markdown/code)
  • Move all state modifications into a set of reducers
    • Could have reducers for different parts of state (input/output/selection)
  • Change mainStateController to just be a MailBox or something like that simply listens to messages from the extension side
  • Change the UI to dispatch to redux instead of having to go through the main state controller
  • Change UI updates to be controlled by redux-react.

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Oct 12, 2019

Woohoo.
I'd also suggest using mapStateToProps and mapDispatchToProps.., simplifies how we pass state around ... And invoke actions
Also might want to look at redux thunk (as most of the actions will be async).

Change mainStateController to just be a MailBox or something like that simply listens to messages from the extension side

Agreed... Basically it should be treated like an endpoint (rest + websocket)... It's just a bidirectional communication layer..

@rchiodo
Copy link
Contributor Author

rchiodo commented Oct 22, 2019

Moving this back to triage. This is going to make a lot of the bugs we have to fix easier. I'd like to do this now, rather than wait (and have those bug fixes get progressively harder and harder to implement)

@rchiodo rchiodo self-assigned this Oct 29, 2019
@greazer greazer closed this as completed Dec 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 13, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants