Skip to content

Commit

Permalink
docs: add inspector protocol vscode debug (#776)
Browse files Browse the repository at this point in the history
* docs: add inspector protocol vscode debug

* docs: vscode debug use npm run debug

* fix(docs): make runtimeArgs correct
  • Loading branch information
okoala authored and atian25 committed Apr 20, 2017
1 parent a8893f7 commit df1bf34
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/source/zh-cn/core/development.md
Expand Up @@ -327,6 +327,19 @@ exports.proxyworker = {
]
}
```
由于 V8 Debugger [Legacy Protocol] 会在 Node.js 8.x 后被移除, 而替换使用的是 [Inspector Protocol]

新的协议主要有三大优势:
1. 支持非常大的 JavaScript 对象
2. 支持 ES6 Proxy
3. 支持 Source Map 更好

对于 Node.js Version >= 6.3 (Windows: >= 6.9) 我们更应该使用 [Inspector Protocol] 进行调试。

在上面的调试配置中需要修改一些参数来开启新协议:
- `Launch Egg` 调整参数 `"runtimeArgs": ["run", "debug"]`
- `Attach Worker` 添加参数 `"protocol": "inspector"`


##### 4. 开始调试

Expand All @@ -341,3 +354,5 @@ exports.proxyworker = {
[glob]: https://www.npmjs.com/package/glob
[egg-bin]: https://github.com/eggjs/egg-bin
[VSCode]: https://code.visualstudio.com
[Legacy Protocol]: https://github.com/buggerjs/bugger-v8-client/blob/master/PROTOCOL.md
[Inspector Protocol]: https://chromedevtools.github.io/debugger-protocol-viewer/v8

0 comments on commit df1bf34

Please sign in to comment.