WhatsApp-Clone-Tutorial
WhatsApp-Clone-Tutorial copied to clipboard
[Server Step 1.1] - use ts-node-dev instead of ts-node
with ts-node-dev, you get a watch mode that restarts the server when a file is changed
I second that! It works great, but by default it shows a notification in the OS window which can be really annoying. The flag --notify=false disables that however. My start script: "start": "ts-node-dev --notify=false index.ts"
Thank you both for the suggestion!
It's actually something @kamilkisiela is in the process of doing!
He created a deep analysis of all the different ways to run GraphQL and Node on the backend together with performance benchmarks across all of our clients, which some of them have really huge codebases.
He will create a blog post about that and upgrade as the same time the tutorial together with all of our clients. He is now on a well needed and deserved vacation and will get to doing that after he will return.
Hey! Seems like the official documentation hasn't yet added scripts for hot-reloading. Here's something that I did on my end:
I installed nodemon
. Then, I added the following nodemon.json
file
{
"watch": ["."],
"ext": "ts",
"ignore": ["node_modules"],
"exec": "ts-node ./index.ts"
}
along with a new script
"scripts": {
...
"start:dev": "nodemon",
}
This basically enables server-side hot reloading without changing much of the libraries present in the guide. Also, I wasn't sure how to contribute to the guide itself on this. Perhaps a contribution guide would help make this course more maintainable.