vscode-extension-samples/wasm-component-model
Matt Bierner 1a3ac0c722 Switch internal scripts to ts
Also adds a formatting script and runs it against all TS files in the samples
2024-10-28 16:41:49 -07:00
..
.vscode
bin
src Switch internal scripts to ts 2024-10-28 16:41:49 -07:00
wit
.gitignore
Cargo.lock
Cargo.toml
README.md
eslint.config.mjs Migrate all samples to eslint 9 2024-10-26 17:44:03 -07:00
package-lock.json Migrate all samples to eslint 9 2024-10-26 17:44:03 -07:00
package.json Migrate all samples to eslint 9 2024-10-26 17:44:03 -07:00
tsconfig.json

README.md

WASM Component Model Example

An example demonstrating how to use the component model to integrate WebAssembly code into VS Code.

Functionality

A simple calculator that can perform add, sub, mul and div. The calculator is implemented in Rust and compiled to WebAssembly code and then call from JavaScript.

Pre-requisites

To run the sample the following tool chains need to be installed

  • Rust: installation instructions can be found here
  • wasm-tools: releases can be found here. You need at least version >= 1.200 to run the example.

Running the Sample in the Desktop

  • Run npm install in this folder. This installs all necessary npm modules.
  • Open VS Code on this folder.
  • Execute the launch config Run Example.

Running the Sample in the Web

As a pre-requisite follow the instructions here to generate necessary certificate to side load the extension into vscode.dev or insiders.vscode.dev.

Then compile the extension for the Web by running npm run esbuild, start a local extension server using npm run serve, open vscode.dev or insiders.vscode.dev in a browser and execute the command Install Extension from Location. As a location use https://localhost:5000.