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

[dev] [discussion] think outside the MST box #4889

Open
southerneer opened this issue Mar 10, 2020 · 1 comment
Open

[dev] [discussion] think outside the MST box #4889

southerneer opened this issue Mar 10, 2020 · 1 comment

Comments

@southerneer
Copy link
Contributor

Spurred by discussion here: #4854. I believe we're overusing MST and it makes our codebase overly complicated.

MST is perfectly adequate for our base data structures (bot, profile, chat, etc) since these structures can change often in the lifecycle of a user session, are very inter-dependent, and need to be persisted across app reloads. MST's features give us solutions to those problems more or less "for free".

There are other pieces of state (permissions for example) that don't change often, don't require persistence, and don't depend on other parts of the state tree. Using MST for this "simpler" state has side-effects and requires hacks that we should seek to eliminate.

It is this "simpler" state that I propose to move out of MST and into either vanilla mobx or React state (or whatever else makes sense). Some candidates for this change:

  • PermissionStore
  • HomeStore
  • NavStore
  • SearchStore

We already have some stores (like ReportStore) that are written with vanilla Mobx that are good examples of how we can convert the stores I mentioned above.

cc @aksonov @bengtan

@bengtan
Copy link
Contributor

bengtan commented Mar 11, 2020

We talked about this in a meeting last night.

Does this ticket still need to be open?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants