I'm looking to port a JS web game to console (Nintendo Switch and PlayStation 5). With the WiiU, it had native HTML5 support. These are my current solutions:
Built-in browser: Currently, the only way to run HTML5 games is a roundabout using the built-in browser; however, that circumvents proper account management that should go through Nintendo or Sony. Additionally, it's difficult for user navigation, and requires significant overhauling per device type.
From what I've seen on the PlayStation Dev Portal, the PlayStation WebKit - JavaScriptCore might help. But the documentation is a bit lacking. It looks like I just compile it with CMake and juggle parts. Perhaps there is more documentation in another area of the portal that I missed.
Wrap a browser: There is a subpar optimized way of porting using a browser then caching the game, but it seems like a very bad plan. There might be missing features because of how it calls. It would be better to just convert it over and optimize it per device.
Translate JS to C++: I have an understanding of taking C++ to JS with WASM, but doing it vice-versa is daunting. Off the top of my head, I can only think of translate the entire codebase into C++ then massage the code until it works.
As far as I know, there is nothing like Cordova or MonoGame that does JS to C++.
I am wondering if there is an existing wrapper for JS to C++? If there is no tool, how would I start to create a wrapper?