Auto-reload and external editor workflows



  • Hi,

    I've recently found out about JSCAD, having used OpenSCAD for a while. I've played around a bit and am really liking it, however trying to set up vscode and jscad.xyz to work seemlessly together is proving tricky for me.

    I've been scouring the documentation for any mention of Auto-reload or how to set it up/get it to work/etc. and came up blank. I found a few comments on the usergroup here about how auto-reload just works, but it did not for me - neither on chrome or firefox.

    The first thing I tried was following the getting started with v2 section of the userguide but could not get the WEB version to work, getting:

    "Can't walk dependency graph: Cannot find module '@jscad/core' from 'C:\Users\rich\github\OpenJSCAD.org\packages\web\src'
    required by C:\Users\rich\github\OpenJSCAD.org\packages\web\src\index.js"

    I then tried out both vscode extensions, neither of which were workable for me, before returning to trying to get the website + vscode workflow to work. The only way I managed to make any progress is by finding the console error:

    'Firefox can’t establish a connection to the server at ws://127.0.0.1:35729/livereload.'

    and searching around to find out what livereload was, after going down a big rabbit hole of gulp and trying to work out if not using that was causing the issue. Having just installed LiveReload 0.9.2 Alpha, I've got it working and my changes being reflected live, but it feels like I'm doing something wrong here - as far as I can tell LiveReload hasn't been actively developed in years and it feels strange that there is no mention of it anywhere.

    Would anyone mind explaining their workflows for using an external editor/how best to develop with JSCAD? It would be really useful to have a page in the userguide/a section in getting started explaining how to set up an external editor and the like.

    I'd also be interested in writing in typescript, which as I understand would require use of something like gulp for transpilation into standard javascript. Any help with that would be much appreciated.

    Cheers,
    Rich



  • Hi Rich, hot off the presses, I just created a tool called jscad-now:
    https://github.com/danmarshall/jscad-now

    I hit all the same problems you reported, and so I created this tool. It seems to work for me and I hope it does for you too. Let me know what you think.



  • @rich-27 Welcome!

    It seems that you hit the bug as mentioned here.

    https://github.com/jscad/OpenJSCAD.org/issues/765

    There’s an issue with Lerna on Windows. Luckily, there’s a work around mentioned at the end of the issue.


Log in to reply