What is the best practice to debug and learn about the library code? #1395
-
Hi, I am interested in, say, how the translated JS code looks. I'd put a break point in, say, How do people do this kind of exploration? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Me too, I would like to step through JS/TS code, but in markdown files, this doesn't seem to be possible and I haven't managed either in stepping through JS/TS modules. |
Beta Was this translation helpful? Give feedback.
-
You can put a debugger statement in JS code blocks or in JS components. For example: ```js
debugger;
display(Plot.plot({…}));
``` But, stepping through the client-side is different than what @yoshikiohshima asked for, which is stepping through Framework’s server-side transpilation. For that you would need to use If you just want to see how the translated JS code, there is very little difference, but you can view source on the preview server and you will see it in the HTML, or you can run the |
Beta Was this translation helpful? Give feedback.
-
Jumping on this thread as it somewhat asks my same question. I haven't found a way to debug a framework app from within VS code. @mbostock you show the I have debugged via the browser dev tools which works, just clunky. I am missing a "real" debugging experience in VS Code. F5 from there tries to debug markdown via an extension (marketplace search doesn't show anything obvious). So is debugging really only in the browser (at least for now)? ...and I also want intellisense but see there are some topics to try those ideas out (local packages). Thank you for any further thoughts! I ❤️ framework (but even more if I can debug it) |
Beta Was this translation helpful? Give feedback.
You can put a debugger statement in JS code blocks or in JS components. For example:
But, stepping through the client-side is different than what @yoshikiohshima asked for, which is stepping through Framework’s server-side transpilation. For that you would need to use
node --inspect
.If you just want to see how the translated JS code, there is very little difference, but you can view source on the preview server and you will see it in the HTML, or you can run the
build
command and look at the generated HTML.