oraoto/pib

[feature request] To operate DOM through wrapped EM_ASM_ interface

Opened this issue · 2 comments

To operate DOM through wrapped EM_ASM_ interface

reference: http://webassemblycode.com/webassembly-cant-access-dom/

I had considered implement DOM access through EM_ASM, but it require too much work. EM_ASM works with C/C++, so we need a PHP extension. And to do useful things, we need event-handlers, which go throught JavaScript, C and finally PHP, which it is not easy to implement.

Another approch is split the code in two parts:

  1. JS part handle actual render and captures events, pass them to the PHP part
  2. PHP process the event and return the updated view to JS part.
Sarke commented

Could FFI be used for this?