Hi. I’m trying to get my workflow how I want it. I’m now able to edit my .js files in my favourite code editor.
It would be super-cool if I could open up files in my code editor directly from the PlayCanvas editor, by double-clicking on a .js file in the assets pane.
Is this possible at the moment? Or is this a feature request?
This technically not an easy thing.
One way to go around it, would be implementing some browser extension, that would be reacting when particular URL is opened? If that is possible, you would need to do some R&D about it
Thanks Max - it’s not a huge problem, so I’ll just have to open my .js files myself in my editor.
Something useful to note, I noticed that I’d make an edit, and then even if I F5-ed the tab with my running game, the change wasn’t always being picked up, it was a bit hit & miss. I figured it was probably some Chrome caching issue so I disabled caching when DevTools are running, and that did indeed fix it.
TL;DR : Turn off browser caching when using local script hosting.
Regarding local script hosting. You’re right, but it will depend on your local server as the caching headers are all set by the server. If you set up a local version of apache or nginx, you could ensure the correct caching headers were set.
Turning off browser caching will work around the caching problem, but it going to slow your iteration considerably. Your scripts will be force reloaded, but so will all of your scene assets. So, as Dave suggests, try to work with the browser cache rather than against it by configuring a local server that correctly sets headers. Maybe we could do more to document this in the user manual.
If there is any possibility of documenting this, that would be great. My understanding & knowledge of cache headers is zero Time for some Google action!