n-riesco / ijavascript

IJavascript is a javascript kernel for the Jupyter notebook
Other
2.18k stars 187 forks source link

Support attaching a nodejs --inspect chrome devtools debugger #175

Open Masterxilo opened 5 years ago

Masterxilo commented 5 years ago

I find it sometimes more convenient to work with my data and inspect it in the chrome devtools.

Especially the tree-view of nested objects is unbeatable.

It would of course be cool if there was an easy way to do this interactively natively direcly in ijavascript, instead of having a reduced JSON.stringify-ish static output of objects.

n-riesco commented 5 years ago

Oh, I've just realised this isn't documented. This is already possible with $$.json(x). I've just tested it with hydrogen and nteract and it works.

hydrogen

nteract

graemian commented 5 years ago

I'm keen on this feature. I like to be able to step through my code using a debugger. It should be as simple as starting the NodeJS kernel with the --inspect flag

graemian commented 5 years ago

Any idea where I can just jam in the --inspect parameter to Node when I need to?

graemian commented 5 years ago

A nicer solution would be to create a "NodeJS debug" kernel. When you need to, you can switch your notebook from the normal kernel to a debug kernel that you can attach your debugger to (Chrome, JetBrains, etc)

n-riesco commented 5 years ago

@graemian Here is the line that sets the arguments used to launch the NodeJS session. This line is part of the package NEL and at the moment NEL doesn't provide an API to customise these arguments.


Below is a quick overview of the packages in the IJavascript kernel:

Note that

graemian commented 5 years ago

Tx @n-riesco, much appreciated.

Looks like your message got chopped short somehow, it ends with:

Note that

?

n-riesco commented 5 years ago

@graemian I don't even remember writing that :thinking:.

At the moment, it's a bit hectic for me, but if you're a planning to experiment with this, we can use this issue to discuss.