Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Fully-Featured Debugging with VSC & Debugger for Chrome?

1596183109

Edited 1596183249
As I understand debugging, the fact that Roll20 is hosted on its own server and we lack full access to the operating code prevents using standard debugging tools that generally require running the entire application locally.  As a result, instead of using watchlists and setting breakpoints to observe real-time property values and the like, we're all sort of doing the equivalent of spamming our code with console.log statements (or variations) to try to get a look at the problem. The Visual Studio Code extension Debugger for Chrome allows VSC to attach to a running Chrome window to enable its debugging tools on whatever Chrome is running.  Unfortunately, the extension is no different from the others in requiring you to run the whole thing locally.  But I caught this in the extension description and realized I wasn't savvy enough to figure out whether this might work with Roll20 if, say, we were given SSH access on an isolated testing server?  Perhaps by invite-only or something, if opening up the code like this makes it vulnerable to malicious code in some way?
1596200403
The Aaron
Roll20 Production Team
API Scripter
In theory, that would work. Architecturally, I believe it's unlikely to be something Roll20 would be interested in setting up. That's a lot of effort for something that would be used by few people and adds some security concerns and management problems. API scripts are not complicated enough to warrant that level of interactive execution.  It's easier (and I would argue better) to set up a mock environment locally and execute scripts in unit tests. I use Jest as a test framework, and have mocked out the API's interface functions to let me test scripts locally. I still use console log type debugging for tracking down the bugs that slip by, so it's not a perfect solution yet, but it's sufficient for getting scripts out there. 
1596203704
GiGs
Pro
Sheet Author
API Scripter
The Aaron said: In theory, that would work. Architecturally, I believe it's unlikely to be something Roll20 would be interested in setting up. That's a lot of effort for something that would be used by few people and adds some security concerns and management problems. API scripts are not complicated enough to warrant that level of interactive execution.  Also, when they released the Custom Sandbox, they described it as the tool they used internally, so it doesnt seem likely they'd easily be able to add extra features like suggested here on a roll20 pro-userbase scale, very quickly if at all.
The Aaron said: It's easier (and I would argue better) to set up a mock environment locally and execute scripts in unit tests. I use Jest as a test framework, and have mocked out the API's interface functions to let me test scripts locally. Is this something you might consider releasing for community use?  I could definitely use even an incomplete testing environment --- indeed, I've tried my hands at something similar a few times, but there's just so much functionality server-side to reproduce that I've always given up after deciding it wasn't worth the effort to save myself debugging time!
1596601333
The Aaron
Roll20 Production Team
API Scripter
Possibly. I'll look and see what it would take.