armory icon indicating copy to clipboard operation
armory copied to clipboard

Electron html5 debug runtime

Open tong opened this issue 2 years ago • 2 comments

How about adding a electron application as a (debug) runtime for html5, like kode is doing it for vscode? This would make some things a lot easier:

  • No need for a local web server
  • Live reload if build output changes
  • Livepatch feature via filesystem and/or socket connection (unix socket, not websockets).
  • No browser determination quirks (#2693)
  • No restriction for playing sound without user interaction
  • Chromeless windows as default
  • stdin/stdout communication with blender
  • Start an existing build without opening blender
  • Extending the runtime with native modules (no wasm)
  • ...

Here https://github.com/tong/armory_html5_runtime is a quick hack to test this. Since the appliction uses haxe/js for it's main process one could easily extend it to add custom functionality.

tong avatar Dec 13 '22 18:12 tong

This would require NPM in order to download and initialize the Node dependencies, correct? Kha/armsdk doesn't ship with NPM, only Node, so it would need to be either downloaded separately (which is more work / dependencies), or we ship NPM with the armsdk.

Frankly, I support, but also disagree with these approaches.

  • Requires separate download - more dependencies, I'm not a fan of more dependencies, and to be honest, Armory3D is strictly centered around portability and NPM wouldn't fit in well with that mindset.. 🙂
  • Ships with armsdk - this would be nice, less work for users, as well as allows me to add some NPM required dependencies to the armory_web repository. However, this would results in a slightly larger file size..

rpaladin avatar Jan 13 '23 23:01 rpaladin

I don't think bundling npm with the sdk is a good idea.

Currently i am using the armory_electron_runtime as armory Subproject which works fine.
Maybe we can use the khafile.js (when used as Subproject) to check for dependencies, give some instructions or even auto install npm.

tong avatar Jan 14 '23 14:01 tong