Buuntu/fastapi-react

Adding VSCode development configurations (Optional)

NixBiks opened this issue · 8 comments

VSCode have an extension for remote container development. It would be pretty cool with the option to have a proper development IDE setup for the project.

You can even use multiple containers to have autocompletion, linters, formatters etc. in both python backend and React frontend

That is interesting, so you wouldn't have to setup Prettier, Black, and ESLint yourself in that case? I had an issue for adding documentation for how to set it up with VSCode (#47) but I wasn't aware this existed.

If you want to take this on I'd be happy to accept a pull request. I do like making it optional or opt in though as not everyone will be using VSCode.

Cool. I just stumped upon it today actually so I haven’t tried it. Then I thought to myself that I’d try to make a cookie cutter template with it but thought this was a better idea. I can give it a try for sure.

You’d still set up black, prettier etc. as well but have it automatically as part of your docket-compose ochestration I guess

If you still have to set it up what is the advantage vs just setting it up in your IDE? Not sure I understand.

I guess it depends what you mean by set it up. I’d apply pytest, coverage, black etc. as part of a CI deployment. That is probably out of scope for this project - since this is related to e.g. GitHub actions workflow.

But I’d also like to have those tools available in my IDE when I develop. That could be taken care of by implementing this. Part of the scope for this project.

I actually think the CI deployment (using Github actions) and documentation for an example of that would be super useful - I don't have anything that says how to deploy on something like Heroku but I think that would be immensely helpful. If you have ideas on how to do a quick/easy deployment from these Docker containers let me know!

Yeah setting it up as part of your IDE sounds useful but I don't understand how setting up remote container development could make things easier since you still need to setup an extension (vs just changing your settings.json for example). I have it format on save for Black and Prettier locally for example and could have it run those as part of CI as well (it's not currently but it should be pretty easy to add). The benefit of this being that you don't have to mess with your settings.json file at all?

I also was thinking of adding the option to install pre-commit hooks (#14) for Black (and Prettier).

Maybe I should try remote developer extension before being skeptical that it will make things easier.

Well the biggest difference is that your autocomplete etc. are using your containers environments instead of your local virtual environment. This way you don’t need any virtualenv or local node modules etc since your using the runtime of the actual containers instead. I.e. your are developing ‘closer’ to your production environment (you’ve installed some dev tools like pytest etc in your dev container - otherwise it’s like your prod container).

But if I’m being honest that I don’t have much experience with these things but I’m just about to set these things up. I could give it a go on this project.

I also have file watchers btw...

And you can also control your VSCode extensions this way

Going to close this for now but will accept PRs on this. Personally I think it gets in the way but maybe I'm not configuring it correctly.