GithubHelp home page GithubHelp logo

cjsmith-0141 / wasm-blog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dsegovia90/wasm-vite-svelte-monorepo

3.0 2.0 1.0 53 KB

License: MIT License

Rust 61.48% HTML 2.27% Svelte 30.85% TypeScript 2.94% JavaScript 2.47%

wasm-blog's Introduction

WASM (with Rust) + Vite + Svelte Monorepo

Quick Start

Unix

Assuming a fresh install (no node, no rust)

  1. Clone the repo.
  2. cd into repo
  3. Install nvm, close and reopen terminal after install.
  4. Run
nvm install --lts
  1. To verify install run
node -v
// should output something similar to
v16.13.0
  1. This monorepo uses yarn workspaces under the hood. Install yarn by running
npm i -g yarn
  1. Install rustup + rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
// follow installation prompts, close and reopen terminal after install.
  1. Install wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
  1. If in Ubuntu or similar, you need to install a CC linker (you might already have it if you've run sudo apt-get update before), run
sudo apt-get update
sudo apt install build-essential
  1. Yarn needs rust to be built at least once so it can cross reference dependencies in the monorepo. Run in the packages/rust directory
cd packages/rust
# build WebAssembly and Javascript wrappers using wasm-pack
# don't panic, this might take a few seconds
wasm-pack build --target web
# Then initialize yarn in the rust directory
yarn
# go back to the monorepo root directory
cd ../..
  1. Install node dependencies, run
yarn
  1. Install cargo watch
cargo install cargo-watch
  1. To start the development server, run
yarn dev
  1. Enjoy! Got some feedback? Open an issue, or better yet, a PR. If you like this template, please star this repo.

What's next

This needs to work with a regular CI (ie: vercel/netlify/github pages). Will create a guide for this if there is enough demand for it.

If this gets enough attention, and there demand for it, I will create a template for sveltekit, and potentially for vue and react.

wasm-blog's People

Contributors

dsegovia90 avatar cjsmith-0141 avatar

Stargazers

José Miguel Cordero Carvacho avatar Aaron Benkoczy avatar Dan Todor avatar

Watchers

James Cloos avatar  avatar

Forkers

nadolny

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.