We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
Accept
Advertisement 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
Forum Champion
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.
1596599392
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
Forum Champion
API Scripter
Possibly. I'll look and see what it would take.