Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

server.js -> server.ts #18

Closed
kentcdodds opened this issue Mar 31, 2021 · 3 comments
Closed

server.js -> server.ts #18

kentcdodds opened this issue Mar 31, 2021 · 3 comments

Comments

@kentcdodds
Copy link
Member

Most folks will want to write all their code in TypeScript. Especially if there's more going on than just configuring remix. In my case, I use HTTP mocks in dev mode and I want that code in TypeScript. I'd love it if remix could help me with this since it's compiling everything else for me. Just feels like a poor DX experience to have to do something extra to get this working when none of my other code needs extra tooling figured out.

@cassidoo
Copy link

cassidoo commented Mar 31, 2021

I'd personally like the option and not the mandate, because... I would not want TS to be the default 😅

@kentcdodds
Copy link
Member Author

kentcdodds commented Mar 31, 2021

Oh yeah, for sure, I agree it should be an option not a mandate. 👍 Having TS be the default seems fine to me though. I agree that a mandate wouldn't be good.

@mjackson
Copy link
Member

Thanks for the issue, but we are archiving this repo. We have a new npm init remix command that we are recommending people use to get started instead of the starter repos, so I'm closing all the issues here.

For now, the server.js file is outside the scope of our responsibilities. Remix takes care of the app folder, everything else is your job. This is consistent with our philosophy of letting you own your entry points, except this one feels different because it's your server entry point. If you want to call it server.ts, I think you can go ahead and do that and maybe use something like ts-node to run your app, but I've never done it. I usually just plop a few JSDoc comments in my .js files these days to get some nice type hints, so you might try that too.

Good luck!

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

No branches or pull requests

3 participants