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 and Styled components #30

Open
Algram opened this issue Sep 25, 2019 · 7 comments
Open

Move to Typescript and Styled components #30

Algram opened this issue Sep 25, 2019 · 7 comments

Comments

@Algram
Copy link
Owner

Algram commented Sep 25, 2019

I'd like to move this project to Typescript and Styled components. Feel free to contribute! The linting should be done with eslint.

@murbar
Copy link

murbar commented Sep 25, 2019

I can help with styled components.

@emanuelmd
Copy link

I can port it to TypeScript

@emanuelmd
Copy link

emanuelmd commented Sep 25, 2019

The frontend is fairly doable since it runs through webpack and we can easily add a ts-loader in there.

The server will be a bit trickier, I'm afraid you have to move it out of src/ or somehow compile it differently because node won't be able to run .ts files.

You have two options here

  • Use ts-node that just runs .ts files. Although I'm not a big fan of this, last time I tried it, it was buggy
  • Separate the server to it's own folder along with it's own package.json and tsconfig.json. But this implies you need to modify your Dockerfile in order to build both server & frontend and put them together.

@emanuelmd
Copy link

Also, it'd be a great idea to move everything to async/await since you're doing TypeScript. No need to resort to callbacks.

@Algram
Copy link
Owner Author

Algram commented Sep 25, 2019

Yeah I figured this would be a problem. We could also do server side rendering and then compile the project all at once with a single tsconfig.json.

For the refactoring: I wanted to do that for a long time now but haven't found the time for it yet, feel free to do this. As long as you adhere to proper linting and keep the core functionality I will approve of it.

@wilsonj806
Copy link

Just as a quick heads up, Babel handles transpiling TypeScript now as well, although I haven't handled transpiling both .ts and .tsx before but it should be fine.

@Algram
Copy link
Owner Author

Algram commented Sep 25, 2019

Yep this works, I am doing this at work already in a prod environment.

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

No branches or pull requests

4 participants