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

Move to Typescript #89

Open
lil5 opened this issue Apr 22, 2024 · 8 comments
Open

Move to Typescript #89

lil5 opened this issue Apr 22, 2024 · 8 comments

Comments

@lil5
Copy link
Contributor

lil5 commented Apr 22, 2024

I'd like to use this project in a different project, I'd need to build an sdk based off the app/mobile/src/api files. Even then I'd be coding in the dark without types. A good first step would be to move to Typescript.

@balzack
Copy link
Owner

balzack commented Apr 22, 2024

yes, I have some regret not starting off with typescript and have been postponing the refactor effort. I've added it to my backlog list for tracking, but I have a few features I've committed to first.

@lil5
Copy link
Contributor Author

lil5 commented Apr 22, 2024

If it's alright with you I'd like to move to strict = false first, this makes most JavaScript okay for TypeScript.
It allows for untyped code and missing types.

That way the types can follow organically.

I'd like to help out with this change.

Are your unmerged branches very different from main?

@balzack
Copy link
Owner

balzack commented Apr 22, 2024

I currently only have two relevant branches:
fdroid: the release branch for fdroid. almost identical to main, but with firebase removed since it's not opensource.
webrtc: very old and has a stalled effort of embedding a stun/turn server

I appreciate any help with the migration towards typescript. thank you.

@lil5 lil5 mentioned this issue Apr 23, 2024
@lil5
Copy link
Contributor Author

lil5 commented Apr 23, 2024

rnr -rf '(.*)\.jsx$' '$1.tsx' ./src ./test

rnr has been a huge help

@lil5
Copy link
Contributor Author

lil5 commented May 12, 2024

  1. You've made it impossible to separate the frontend from the backend an /api prefix would have been great. This would allow for a Vite dev server + live reload and a reverse proxy to the backend.

Thus I'm unable to debug what is going wrong, currently running the frontend requires debugging minimized code.

  1. The absolute paths are a nightmare to work with in typescript/babel/jest/vite at the least use a ~

This where my participation ends, I hope I've given you some helpful advice

@balzack
Copy link
Owner

balzack commented May 12, 2024

Yes, I understand. For my reference can you point me to an example of your point 2 and what you would have expected to see instead. Thanks for your advice.

@lil5
Copy link
Contributor Author

lil5 commented May 13, 2024

Instead of using absolute imports like "components/card.tsx" use "src/components/card.tsx" or "~/src/components/card.tsx"
simpler still "./../card.tsx"

I attempted to add each dir in src as a base in my configs but it just becomes a buggy mess.

@balzack
Copy link
Owner

balzack commented May 14, 2024

Okay I see what you mean. I appreciate all of your advice and will incorporate it as I go forward.

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