irthomasthomas / undecidability

13 stars 2 forks source link

gh actions sqlite wasm #691

Open irthomasthomas opened 9 months ago

irthomasthomas commented 9 months ago

Title: gh actions sqlite wasm

Description:

<!DOCTYPE html>

<title>Minimal sql.js-httpvfs demo</title>
<!-- DEV: -->
<script src="./dist/bundle.js"></script>
<!-- PROD: -->
<!-- <script src="./bundle.js"></script> -->
<script>

    // Check if WebAssembly is supported for the target browser
    const supported = (() => {
        try {
            if (typeof WebAssembly === "object"
                && typeof WebAssembly.instantiate === "function") {
                const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
                if (module instanceof WebAssembly.Module)
                    return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
            }
        } catch (e) {
        }
        return false;
    })();
    console.log(supported ? "WebAssembly is supported" : "WebAssembly is not supported");

    // TODO: Dynamically load bundle.js based on env
    // var isProduction = process.env.NODE_ENV == 'production';
    // var src = isProduction ? "./bundle.js" : "./dist/bundle.js";
    // document.write('<script src="' + src + '"><\/script>');

</script>
<div>Hello World! If you don't see anything probably your browser doesn't support WebAssembly</div>

URL:

GitHub Repository

Suggested labels

irthomasthomas commented 9 months ago

Related content

691 - Similarity score: 1.0

692 - Similarity score: 0.91

695 - Similarity score: 0.89

74 - Similarity score: 0.89

114 - Similarity score: 0.83

625 - Similarity score: 0.83