I know it’s possible to simply take the HTML5 export from OpenFL and drop it in the electron starter project, and it will work pretty much seamlessly. However I want to also be able to make IPC calls in order to communicate with Electron’s NodeJS process. This is where I start to run into problems. The very act of including the hxElectron externs into the project.xml causes this error when I build with openfl html5.
C:/HaxeToolkit/haxe/lib/lime/6,1,0/lime/system/System.hx:322: characters 14-46 : Class<lime._backend.native.NativeCFFI> has no field lime_system_get_time
Presumably, this might be because some of the classes have dependencies to NodeJS when OpenFL is targeting the browser? I’m not sure. The same thing happens if I try to include hxnodejs. Regardless, I just want the browser IPC stuff, not the nodejs IPC stuff. But even when I isolate the
IpcRenderer.hx extern class into my project, I still run into some errors. Such as this:
characters 2-18 : Accessing this field requires 'electron' to be enabled
Which is strangely a haxe compilation error, even though by runtime “electron” will already be enabled as a container for the entire OpenFL project.