0.12.0
More in-browser playgrounds
Most playgrounds (like Go or PostgreSQL) run code on the Codapi server. But there are some playgrounds that work completely in the browser, no Codapi server required. There used to be two of them: JavaScript and Fetch.
Now there are five more:
These playgrounds are WASI based (WASI is an executable binary format for browsers based on WebAssembly). They require two additional scripts besides the usual snippet.js
:
<script src="https://unpkg.com/@antonz/[email protected]/dist/runno.js"></script>
<script src="https://unpkg.com/@antonz/[email protected]/dist/engine/wasi.js"></script>
<script src="https://unpkg.com/@antonz/[email protected]/dist/snippet.js"></script>
JavaScript and Fetch playgrounds changes
engine
attribute:
<codapi-snippet engine="browser" sandbox="javascript" editor="basic">
</codapi-snippet>
<codapi-snippet engine="browser" sandbox="fetch" editor="basic">
</codapi-snippet>
This is a breaking change.