I was wondering what the thinking is to flesh out the 'Native Functions' in the JS runtime? Is the idea to add polyfills for common globals that map to the standard WASI interfaces? In a JS host these would then be the counterpart to the jco/preview2-shims. Meaning a component can use a host function as follows: JS code -> ComponentizeJS polyfill -> JCO shim -> host implementation.
Taking console.log as an example, you would get: JS code using console.log -> mapped to WASI-logging -> mapped back to host console.log implementation.
Taking SubtleCrypto in the browser as an example, you would get: JS code using JS SubtleCrypto API -> mapped to WASI-crypto -> mapped back to host SubtleCrypto implementation.
Last updated: Nov 22 2024 at 16:03 UTC