GitHub - pannous/servox: Fork of official Servo browser (engine) with Wasm and TypeScript baked in

1 min read Original article ↗

Servox - Servo Fork with WASM GC & TypeScript

Fork of official servo browser (engine) with the following modifications:

Features

✅ <script type="text/wast"> ✅ <script type="text/typescript"> ✅ <script type="application/wasm" src="…">

E.g.

  <script type="text/wast">
(module
  (func $getValue (result i32)
    i32.const 123)
  (export "getValue" (func $getValue)))
  </script> 

    <script type="text/typescript">
        const greeting: string = "Hello from TypeScript!";
        const version: number = getValue()
        console.log(`${greeting} (v${version})`);
    </script>

💡exports are immediately available to TypeScript, even gc objects!

<script type="text/wast">
(module
  (type $Box (struct (field $val (mut i32))))
  (global $box (export "box") (ref $Box) (struct.new $Box (i32.const 42)))
)
  </script>
<script type="text/typescript">
  console.log(box.val);
</script>

Installation

brew tap pannous/servox
brew install servox

Tests

servox https://raw.githack.com/pannous/servox/main/test-all.html

See tests/extensions folder