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

chore: add mapeo core react and state manager #59

Closed
wants to merge 20 commits into from

Conversation

ErikSin
Copy link
Contributor

@ErikSin ErikSin commented Dec 13, 2024

  • Adds CoMapeo-Core/React
  • Adds Zustand and hook to persist state to local storage through zustand. Follows the pattern of creating a persisted store and injecting it into React Context. This will allow for easier testing
  • Adds a RouterContext to the router. The context injects the device name and the persisted project id so the appropriate routing can take place. This required a rearrange of the context and providers to be outside of the RouterProvider
  • Created an ActiveProjectId store. This is injected deeper into the Router after the user has created an active project. This provider guarantees a projectId saved in persisted state. Otherwise the projectId in persisted state could have been undefined. This simply takes the persisted state, and throws an error if there is no id. otherwise it just propogates to the app

There seems to be alot of touched files, but many of them are just moving files around

@ErikSin ErikSin requested a review from cimigree December 13, 2024 07:20
@ErikSin
Copy link
Contributor Author

ErikSin commented Dec 13, 2024

@cimigree the tests are broken, which ill fix tomorrow. I just dont want you to double the work into trying to integrate the new react hooks (not that you need them to for the invite work). But i just thought it would be good for you to see the structure of the hooks to inform your work.

Copy link
Contributor

@cimigree cimigree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for setting this up! Looks like you were able to get rid of the hacky start to the app that you figured out yesterday.
There is one weird thing and it isn't related to this PR but maybe your previous one...
After I do npm install, I get a change in my package-lock.json
It shows this as deleted:
"@testing-library/user-event": "14.5.2",
Screenshot 2024-12-13 at 2 22 36 PM
This doesn't need to hold up this PR, but I wanted to mention it before I forget.

@ErikSin
Copy link
Contributor Author

ErikSin commented Dec 13, 2024

Thanks for setting this up! Looks like you were able to get rid of the hacky start to the app that you figured out yesterday. There is one weird thing and it isn't related to this PR but maybe your previous one... After I do npm install, I get a change in my package-lock.json It shows this as deleted: "@testing-library/user-event": "14.5.2", Screenshot 2024-12-13 at 2 22 36 PM This doesn't need to hold up this PR, but I wanted to mention it before I forget.

oh yeah, i forgot to update my package json after i merged from main. But it should be good now

@ErikSin
Copy link
Contributor Author

ErikSin commented Dec 15, 2024

I added a bunch of things that were related but out of scope. So I decided to break up this PR into 3 smaller PRs. The code is generally the same but I just wanted to introduce things in seperate prs. Mainly because they all required a bit of configuration, and they introduced some new practices that i wanted to get more than 1 opinion on!

@ErikSin ErikSin closed this Dec 18, 2024
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

Successfully merging this pull request may close these issues.

2 participants