SocketCluster / SocketCluster/socketcluster
Debug SocketCluster in VS Code
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6.2k
- Forks
- 318
- PR merge metrics
- No merged PRs in 30d
Description
What's wrong?
Visual Studio Code doesn't respect breakpoints in child processes, such as workers and brokers, scworkercluster and sc-broker-cluster, when I try to debug SocketCluster with VS Code's internal debugger.
How could it be fixed?
We could change a couple of lines of code, a line in socketcluster and a line in sc-broker
from
execOptions.execArgv.push('--inspect=' + inspectPort);
to
execOptions.execArgv.push('--inspect-brk=' + inspectPort);
and breakpoints will work as expected.
What do I propose?
To add a couple of new CLI arguments.
--inspect-brk-workers and
--inspect-brk-brokers
Checklist
- The new CLI arguments should accept the same options as the original
--inspect-brk
--inspect-brk-workers
--inspect-brk-workers=port
--inspect-brk-workers=host:port
--inspect-brk-brokers
--inspect-brk-brokers=port
--inspect-brk-brokers=host:port
- The type signature of
--inspect-workersand--inspect-brokersCLI arguments should be updated as well, to comply with the original--inspect
--inspect-workers
--inspect-workers=port
--inspect-workers=host:port
--inspect-brokers
--inspect-brokers=port
--inspect-brokers=host:port
-
The docs should be updated
-
An example
.vscode/launch.jsonconfiguration should be added to the SocketCluster sample app -
The new CLI arguments should fix socketcluster#510
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked lines in socketcluster/index.js and sc-broker/index.js, then trace the existing --inspect-workers and --inspect-brokers argument handling. Check the debugging documentation and the sample app's .vscode/launch.json for the required updates. Done means the new arguments accept the listed forms, the existing argument signatures are updated, the docs and example are present, and socketcluster#510 is fixed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, vscode
- Domain
- cli, developer-experience, devtools, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100