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

all: add typescript to backend #202

Merged
merged 8 commits into from
Dec 21, 2021
Merged

all: add typescript to backend #202

merged 8 commits into from
Dec 21, 2021

Conversation

acharb
Copy link
Contributor

@acharb acharb commented Dec 17, 2021

WHAT
add typescript support to the backend. For this PR just adding the initial typescript infra changes needed, following PRs will refactor the backend/*.js files to typescript.

part of #197

WHY
using typescript with the typescript compiler will notify devs at compile time of type errors + reduce bugs. Also SDF js projects are primarily using typescript, so brings this project inline with our other ones.

note: for running the backend locally I chose to use ts-node, so that you can run it with one command and not have to create new files. But for production using the tsc compiler + node because ts-node is advised not for production use.

@stellar-jenkins
Copy link

Preview deployed to development environment: https://dashboard.prototypes.kube001.services.stellar-ops.com

1 similar comment
@stellar-jenkins
Copy link

Preview deployed to development environment: https://dashboard.prototypes.kube001.services.stellar-ops.com

@stellar-jenkins
Copy link

Preview deployed to development environment: https://dashboard.prototypes.kube001.services.stellar-ops.com

1 similar comment
@stellar-jenkins
Copy link

Preview deployed to development environment: https://dashboard.prototypes.kube001.services.stellar-ops.com

@stellar-jenkins
Copy link

Preview deployed to development environment: https://dashboard.prototypes.kube001.services.stellar-ops.com

@stellar-jenkins
Copy link

Preview deployed to development environment: https://dashboard.prototypes.kube001.services.stellar-ops.com

@acharb
Copy link
Contributor Author

acharb commented Dec 17, 2021

@piyalbasu @quietbits (who I think may have an opinion on this)

I played around with @babel/preset-typescript (which I'm guessing the frontend may use when it adds typescript) to compile the backend using webpack , but it wasn't trivial refactoring webpack to compile the backend too, so I decided to stick with tsc (which seems much easier and we may want to use instead of babel on the frontend anyways). lmk if you have thoughts against this approach

@acharb acharb marked this pull request as ready for review December 17, 2021 02:34
@acharb acharb requested a review from a team December 17, 2021 02:34
@acharb acharb changed the title (wip) add typescript to backend backend: add typescript to backend Dec 17, 2021
@acharb acharb changed the title backend: add typescript to backend all: add typescript to backend Dec 17, 2021
package.json Outdated Show resolved Hide resolved
@piyalbasu
Copy link

@piyalbasu @quietbits (who I think may have an opinion on this)

I played around with @babel/preset-typescript (which I'm guessing the frontend may use when it adds typescript) to compile the backend using webpack , but it wasn't trivial refactoring webpack to compile the backend too, so I decided to stick with tsc (which seems much easier and we may want to use instead of babel on the frontend anyways). lmk if you have thoughts against this approach

This makes sense. Totally favor a simpler tsc script. Webpack stuff can get pretty hairy pretty fast. We'll prob eliminate Webpack altogether when we refactor the FE anyway

@stellar-jenkins
Copy link

Preview deployed to development environment: https://dashboard.prototypes.kube001.services.stellar-ops.com

@stellar-jenkins
Copy link

Preview deployed to development environment: https://dashboard.prototypes.kube001.services.stellar-ops.com

@acharb acharb merged commit 6ec7ac5 into master Dec 21, 2021
@acharb acharb deleted the acharb-typescript branch December 21, 2021 22:03
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.

3 participants