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

0007 proposal: to adapt Typescript in backend. #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dadiorchen
Copy link
Contributor

No description provided.


Developer need to learn Typescript.

But, I suggest we just use the most basic features of Typescript. Because a over-typed System goes to a wrong direction, actually it makes the code less readable.

Choose a reason for hiding this comment

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

I'd suggest splitting this out into a separate option:

  • Option 1: Fully adopt TypeScript.
  • Option 2: Use basic TypeScript features (list suggestions of features to use)
  • Option 3: Use vanilla JavaScript


But, I suggest we just use the most basic features of Typescript. Because a over-typed System goes to a wrong direction, actually it makes the code less readable.

So I suggest we just use TS in a simple way, and if we set up the codebase with Typescript correctly, then a newcoming developer shouldn't need to take a long time to learn Typescript to start coding.

Choose a reason for hiding this comment

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

I agree with this. Basic TypeScript features can bring a lot of benefits.
We should try to define a style guide to help developers decide how much to use, with a corresponding linter configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, maybe a good eslint config, TS config and template repo is helpful

* The code quality.

## Considered Options

Copy link

Choose a reason for hiding this comment

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

We could consider compiled languages too like Kotlin, but I understand Typescript is a natural progression from javascript.


Developer need to learn Typescript.

But, I suggest we just use the most basic features of Typescript. Because a over-typed System goes to a wrong direction, actually it makes the code less readable.
Copy link

Choose a reason for hiding this comment

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

My knowledge of Typescript is basic, but any typed language gives good tools to model the domain, but modeling it right is an ongoing process regardless of the language.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arunbakt that's a book to discuss it :D

Copy link

@arunbakt arunbakt left a comment

Choose a reason for hiding this comment

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

I support and agree using a typed language is a good thing for a code base that is large or expected to grow large and with rich domain complexity. Domain driven design practical patterns that are available publicly use typed languages like C#/Java. It will be a considerable advantage to use typed language where we could learn and apply those patterns in modeling the Wallet API.

@dadiorchen
Copy link
Contributor Author

I support and agree using a typed language is a good thing for a code base that is large or expected to grow large and with rich domain complexity. Domain driven design practical patterns that are available publicly use typed languages like C#/Java. It will be a considerable advantage to use typed language where we could learn and apply those patterns in modeling the Wallet API.

My major consideration on this proposal is the productivity, to code easier, to fix problem easier, and protect and maintain the code easier

Copy link
Contributor

@ZavenArra ZavenArra left a comment

Choose a reason for hiding this comment

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

We need to address how we decide which microservices use javascript vs typescript

@dadiorchen
Copy link
Contributor Author

@ZavenArra I prefer to make typescript a default setting for all microservice, I think for new coming developers, projects with Typescript seems don't bring too much burden for them, by setting up all the TS configs correctly, it's easy to get started, I tried on the treetracker-query-api which using TS, junior dev starts the work easily IMO, with TS, it's easy to navigate in code, and give them more accurate warning, error messages, and the auto-fix function works well, all of them make the coding more comfortable.

For the current situation, I suggest by the changes of refactoring, we can bring TS to wallet-api, for other existing ones, no need to add it, for new coming repo, we can use a TS based template.

@Kpoke
Copy link

Kpoke commented Jun 9, 2022

I think I might be a bit conflicted with adopting typescript for all microservices. I think we could just bring in typescript for the very complicated APIs like the wallet-api, especially given the fact that some or most of the microservices just have to do with basic CRUD endpoints. We could also start by coming up with a microservices typescript template, see how that looks and decide per each new repo whether to use it or not.

@dadiorchen
Copy link
Contributor Author

I think I might be a bit conflicted with adopting typescript for all microservices. I think we could just bring in typescript for the very complicated APIs like the wallet-api, especially given the fact that some or most of the microservices just have to do with basic CRUD endpoints. We could also start by coming up with a microservices typescript template, see how that looks and decide per each new repo whether to use it or not.

Yes, @Kpoke no need to refactor all existing ones. just for new repo I think

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.

5 participants