anmonteiro / lumo

Fast, cross-platform, standalone ClojureScript environment
Eclipse Public License 1.0
1.88k stars 85 forks source link

On remote debugging of Node in Lumo #55

Open tiye opened 7 years ago

tiye commented 7 years ago

Since node 7 there is https://nodejs.org/api/debugger.html#debugger_v8_inspector_integration_for_node_js

$ node --inspect index.js
Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:9229/node

How does lumo support that?

anmonteiro commented 7 years ago

There's currently no support for that in Lumo, since we compile the resulting binary without the V8 inspector.

While including the V8 inspector in the resulting binary is an easy change, I'm not sure how we'd go about actually debugging a file in Lumo. Perhaps we could make it work if Node.js exposes an API to do so. That said, any help is appreciated, I don't really have time to look into this soon.

tiye commented 7 years ago

Didn't notice that it's all binary. Then it's much tougher to make it now.

tiye commented 7 years ago

I took a glance on the packaging. It looks like Lumo is mainly running on JavaScript. I didn't get why it's bundled in binary. Can I run it like other Node.js programs(add bin entry and start running the script)?

anmonteiro commented 7 years ago

The packaging involves creating a standalone binary which is basically Node.js with a custom initialization script to land you in a ClojureScript REPL. The release process compiles all C++ in Node.js and its dependencies (e.g. V8).

arichiardi commented 6 years ago

We can debug directly with node now that lumo can compile down to JS, the ability to debug things in a REPL is kind of mind bending and cool though.