![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
boilerplate-typescript-rest-docker
Advanced tools
How to use TypeScript & Docker building a REST service with debugging enabled (e.g. WebStorm or VSCode).
How to use TypeScript & Docker building a REST service with debugging enabled (e.g. WebStorm or VSCode).
# Clone the directory
$ git clone https://github.com/stefanwalther/boilerplate-typescript-rest-docker
# Install the local dependencies
# - Not necessary if you just want to use/test the docker containers
$ npm install
The development environment contains the following:
rest-service
containing the REST server as defined in ./src
.http://localhost:8000
../src
folder, the TypeScript files will be transpiled again and the server restarted.
rest-service
container, which is after any change immediately up to date.5858
.$ docker-compose --f=./docker/docker-compose.dev.yml up
This will give you all of the above described.
Assuming that rest-service itself could rely on other services it makes sense just to spin up the development environment:
$ docker-compose --f=./docker/docker-compose.dev.yml up
So you can run your integration tests against http://localhost8000
The rest-service
will be updated every time you make updates to the ./src
folder.
If you want to debug the rest-service (e.g. when hitting integration tests against the rest-service
) this is the configuration being used in this example:
Create a remote debugger
./docker/docker-compose.dev.yml
opens the port 5858
for the debugger, so let's connect to it:Running the unit test in this scenario is straight-forward, just configure WebStorm as follows. (This will not use the container, just directly test the transpiled TypeScript code).
Most of the settings should be default, except:
--require ./test/mocha.conf.js
./test/unit/**/*.spec.ts
If you want to debug the rest-service
(running inside the container), follow these steps:
1) Set up the remote debugger as shown above
2) Run the development environment
docker-compose --f=./docker/docker-compose.dev.yml up
3) Set up the integration tests in Mocha:
The configuration is very similar to the unit tests:
--require ./test/mocha.conf.js
./test/integration/**/*.spec.ts
4) Start your "Remote Debugger"
Here come the trick. If you don't see your ./*.ts
files (as in the screenshot below), then the sourcemaps as created by tsc
have not been resolved by WebStorm. (That's a bug and I'll file it as such).
There's a neat trick, though a bit annoying, but i works:
Just press the "Re-Run Debugger" icon, and then you should see the ./*.ts
files as in the second following screenshot.
Once this works you can hit any breakpoint in the rest-service
(e.g. by running test:integration
in Run
mode) and it will be hit:
To simulate the Continuous Integration script run the following
$ bash ./docker/docker-ci.sh
An example how to implement CI using travis is provided, have a look at the .travis.yml
file and the result .
This solutions is very much inspired by the following two articles:
Another very interesting read in that context:
FAQs
How to use TypeScript & Docker building a REST service with debugging enabled (e.g. WebStorm or VSCode).
We found that boilerplate-typescript-rest-docker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.