Live data from Hacker News

Ask HN: What do you use to start your dev environment faster?

news.ycombinator.com

11–20 of 23 posts

Re: Ask HN: What do you use to start your dev environment faster?

#11
post #10

The "trick" that saved me a lot of time, and my laptop from overheating, is to work on one project at a time. Need to change the API? Do that and deploy it. Need to change a React app that uses the API? run it locally and call a private instance of the server instead of running both in parallel..

I get what you mean, but my question is more about how you can run your dev environment when your "project" requires you to have multiple things running (a react spa, a rails backend, three microservices, two databases, ...). Understand "do you have one single command to run all of your resources or do you start them one by one?".

Thanks for your reply though ! Your solution might fit people who have dedicated instances for projects.

Re: Ask HN: What do you use to start your dev environment faster?

#12

I'm using Visual Studio Code dev containers. https://code.visualstudio.com/docs/remote/containers I have to move across a hand full of languages so having my environments all configured with docker files is pretty neat.

Interesting! I don't use vscode that much, but I might have a look at this!

Re: Ask HN: What do you use to start your dev environment faster?

#14
I'm a big fan of the idea that a build should be done with one command line. Mine is 'npm run d' for dev, 'npm run p' for production.

This is a nice chart: https://xkcd.com/1205/

If you're doing it daily and it takes half an hour, you could probably dedicate 5 weeks to optimizing this.

If you're doing builds like me, it's more like 20 builds a day, each taking an extra minute. That's about a month worth of optimizing.

Re: Ask HN: What do you use to start your dev environment faster?

#16

Aren’t node projects just npm i; npm start? Maybe clearer documentation would help. Like step by step what commands to run to build and run. It's weird I see some projects that expect contributors to figure that out themselves. Or maybe they don't want contributors.

I'm more asking about how you start an entire dev environment, like when you have your front 1, front 2, api 1, microservice 1-2-3-4, ... that all need to be running in order for you to start working. For example: using pm2 to start your entire stack in one command (only when it's all nodejs obviously) It's not really related to the tech you use for every project :)

We use docker compose to stand up our micro services. If there's an order you really need, and you can't get around it, try netcat (nc) to knock on the port in a loop until it gets a successful response.

Re: Ask HN: What do you use to start your dev environment faster?

#19
I am currently using the following combination:

- https://github.com/DarthSim/overmind for running whatever is needed inside a project which has multiple things (like rails and webpacker). It is great because it uses tmux.

- A custom file (.dev-start) I put in my parent folder /project which describes what to execute in child folders (like /project/fe and /project/backend). Possible what this files does could be done with overmind but this is a setup I had before discovering overmind

- A bashrc script (a combination of bash script and bash aliases) which is executed on “cd” command and searches for .dev-start and if exists will execute. In the same script I also search for .browser-wip which is just a simple file with all the URLs I think I need to be open in browser while working on current project. If this file exists then it will open in default browser all links from there.

Re: Ask HN: What do you use to start your dev environment faster?

#20
I work with Docker and Kubernetes do my dev environment is actually in my cluster rather than locally. I use Okteto to manage this dev env so I can even switch computers and all I need is the source code of my app and one 'okteto up' command, and I'm ready to go
Post reply on HN