-
Notifications
You must be signed in to change notification settings - Fork 1
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
React + Typescript #18
Comments
easiest would be to bootstrap a new project with vite with the typescript+react preset. then, just drop the index.js file in, and adjust as necessary. also, small note but in package.json , we can remove the tsc which checks that all code is really fully typescript. otherwise the deployment will fail (if all of the types aren't defined/used) |
How would the migration work in terms of CI integration? How do I start rewriting using components/react but not break the live demo? Should I make a new branch and do the work there? |
yeah no all good I'll fix it if it stops working but it really does work pretty much out of the box. do you want me to typescript/reactify the thing? I'll just push onto main and make sure deployments still work |
Just tried and pushed but it didn't build 😔 Maybe because I did |
yeah maybe -- it looks like the package installation failed while deploying: https://github.com/Garrett-Bodley/SHAlala/actions/runs/8516167812/job/23324816515 want to retry? to create a fresh typescript/react repo with vite:
pick typescript, pick react, then you'll get a bunch of files. then you'll have to merge which is the annoying bit. overwrite the package.json with the new one you got (from vite), and overwrite most other files. don't forget to remove the "tsc && " from the package.json's build line, then try git pushing again to see if it deploys? |
Got it to build! It was a Still unsure of how the process of migrating from the existing code to React components will work. Right now the site is just ignoring the react stuff. Do I need a |
ah yeah congrats on fixing! yeah re: react -- if you |
uhhhhhhh, how do I reactify + typescript this There's a lot of state that I just throw around wherever or just hold in the DOM. Would you use a ContextProvider that has some sort of struct that holds all the state? I feel like I maybe need a hook/context provider for the synths and maybe another one for "use the short hash" boolean? Or am I overcomplicating and I should just prop drill since things aren't going to get that nested anyway. It has been a minute since I have done react |
Yeah I'd start small/easy with just props for all of the separate components and the main app containing / managing / owning all of the state using useState vars I think contextprovider mayy be overkill at this point (since you don't have like ... a login ............. yet (Shalala as a service???? Hahaha)) |
tech debt....
The text was updated successfully, but these errors were encountered: