├── .gitignore ├── example ├── crate │ ├── .gitignore │ ├── src │ │ └── lib.rs │ ├── tests │ │ └── app.rs │ ├── Cargo.toml │ └── Cargo.lock ├── .gitignore ├── public │ └── favicon.ico ├── src │ ├── assets │ │ └── logo.png │ ├── main.js │ ├── index.css │ ├── App.vue │ └── components │ │ └── HelloWorld.vue ├── vite.config.js ├── index.html └── package.json ├── tsconfig.json ├── README.md ├── LICENSE ├── package.json └── src ├── rustRollupPlugin.ts ├── index.ts ├── compiler.ts └── config.ts /.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /node_modules -------------------------------------------------------------------------------- /example/crate/.gitignore: -------------------------------------------------------------------------------- 1 | /pkg 2 | /target -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | *.local -------------------------------------------------------------------------------- /example/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gliheng/vite-plugin-rust/HEAD/example/public/favicon.ico -------------------------------------------------------------------------------- /example/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gliheng/vite-plugin-rust/HEAD/example/src/assets/logo.png -------------------------------------------------------------------------------- /example/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import './index.css' 4 | 5 | createApp(App).mount('#app') -------------------------------------------------------------------------------- /example/src/index.css: -------------------------------------------------------------------------------- 1 | #app { 2 | font-family: Avenir, Helvetica, Arial, sans-serif; 3 | -webkit-font-smoothing: antialiased; 4 | -moz-osx-font-smoothing: grayscale; 5 | text-align: center; 6 | color: #2c3e50; 7 | margin-top: 60px; 8 | } 9 | -------------------------------------------------------------------------------- /example/vite.config.js: -------------------------------------------------------------------------------- 1 | const rust = require('vite-plugin-rust'); 2 | 3 | module.exports = { 4 | minify: 'esbuild', 5 | plugins: [ 6 | rust({ 7 | crates: { 8 | rust_crate: './crate', 9 | } 10 | }), 11 | ] 12 | }; 13 | -------------------------------------------------------------------------------- /example/src/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 16 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-test", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build" 7 | }, 8 | "dependencies": { 9 | "vue": "^3.0.0-rc.1" 10 | }, 11 | "devDependencies": { 12 | "vite": "^1.0.0-rc.1", 13 | "@vue/compiler-sfc": "^3.0.0-rc.1", 14 | "vite-plugin-rust": "file:../" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "moduleResolution": "node", 5 | "strict": true, 6 | "declaration": true, 7 | "noUnusedLocals": true, 8 | "esModuleInterop": true, 9 | "outDir": "dist", 10 | "module": "commonjs", 11 | "lib": ["ESNext"], 12 | "sourceMap": true 13 | }, 14 | "include": [ 15 | "./src" 16 | ] 17 | } -------------------------------------------------------------------------------- /example/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vite-plugin-rust 2 | 3 | vite-plugin-rust is a vite plugin that intergrate wasm-pack. 4 | 5 | ## Getting Started 6 | 7 | - Config plugin in `vite.config.js` 8 | ```js 9 | const rust = require('vite-plugin-rust'); 10 | 11 | module.exports = { 12 | plugins: [ 13 | rust({ 14 | crates: { 15 | rust_crate: './crate', 16 | } 17 | }), 18 | ] 19 | }; 20 | ``` 21 | It's not needed to add wasm-pack generated package to package.json dependency list. 22 | 23 | - Wasm loading 24 | You can use wasm-pack generated package with import or dynamic import. 25 | 26 | ```js 27 | // Static Import 28 | import init from 'rust_crate'; 29 | init().then(m => { 30 | m.greet(); 31 | }); 32 | ``` 33 | 34 | ```js 35 | // Dynamic Import 36 | import('rust_crate').then(async m => { 37 | await m.default(); 38 | m.greet(); 39 | }); 40 | ``` 41 | 42 | ## License 43 | 44 | MIT 45 | -------------------------------------------------------------------------------- /example/crate/src/lib.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use web_sys::console; 3 | 4 | 5 | // When the `wee_alloc` feature is enabled, this uses `wee_alloc` as the global 6 | // allocator. 7 | // 8 | // If you don't want to use `wee_alloc`, you can safely delete this. 9 | #[cfg(feature = "wee_alloc")] 10 | #[global_allocator] 11 | static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; 12 | 13 | #[wasm_bindgen] 14 | extern { 15 | fn alert(s: &str); 16 | } 17 | 18 | #[wasm_bindgen] 19 | pub fn greet() { 20 | alert("Hello, vite!"); 21 | } 22 | 23 | // This is like the `main` function, except for JavaScript. 24 | #[wasm_bindgen(start)] 25 | pub fn main_js() -> Result<(), JsValue> { 26 | // This provides better error messages in debug mode. 27 | // It's disabled in release mode so it doesn't bloat up the file size. 28 | #[cfg(debug_assertions)] 29 | console_error_panic_hook::set_once(); 30 | 31 | 32 | // Your code goes here! 33 | console::log_1(&JsValue::from_str("Hello world!")); 34 | 35 | Ok(()) 36 | } 37 | 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 juju 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /example/crate/tests/app.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen_test::{wasm_bindgen_test_configure, wasm_bindgen_test}; 2 | use futures::prelude::*; 3 | use wasm_bindgen::JsValue; 4 | use wasm_bindgen_futures::JsFuture; 5 | 6 | wasm_bindgen_test_configure!(run_in_browser); 7 | 8 | 9 | // This runs a unit test in native Rust, so it can only use Rust APIs. 10 | #[test] 11 | fn rust_test() { 12 | assert_eq!(1, 1); 13 | } 14 | 15 | 16 | // This runs a unit test in the browser, so it can use browser APIs. 17 | #[wasm_bindgen_test] 18 | fn web_test() { 19 | assert_eq!(1, 1); 20 | } 21 | 22 | 23 | // This runs a unit test in the browser, and in addition it supports asynchronous Future APIs. 24 | #[wasm_bindgen_test(async)] 25 | fn async_test() -> impl Future { 26 | // Creates a JavaScript Promise which will asynchronously resolve with the value 42. 27 | let promise = js_sys::Promise::resolve(&JsValue::from(42)); 28 | 29 | // Converts that Promise into a Future. 30 | // The unit test will wait for the Future to resolve. 31 | JsFuture::from(promise) 32 | .map(|x| { 33 | assert_eq!(x, 42); 34 | }) 35 | } 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-plugin-rust", 3 | "version": "1.0.1", 4 | "description": "A vite plugin that intergrate rust & wasm-pack", 5 | "main": "dist/index.js", 6 | "files": [ 7 | "dist" 8 | ], 9 | "keywords": [ 10 | "Rust", 11 | "wasm", 12 | "WebAssembly", 13 | "wasm-pack", 14 | "vite" 15 | ], 16 | "engines": { 17 | "node": ">=10.16.0" 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "git+https://github.com/gliheng/vite-plugin-rust.git" 22 | }, 23 | "bugs": { 24 | "url": "https://github.com/gliheng/vite-plugin-rust/issues" 25 | }, 26 | "homepage": "https://github.com/gliheng/vite-plugin-rust/tree/master/#readme", 27 | "scripts": { 28 | "dev": "tsc -w -p .", 29 | "build": "npx rimraf dist && tsc -p ." 30 | }, 31 | "author": "juju", 32 | "license": "MIT", 33 | "dependencies": { 34 | "chalk": "^4.1.0", 35 | "chokidar": "^3.3.1", 36 | "debug": "^4.1.1", 37 | "which": "^2.0.2" 38 | }, 39 | "peerDependencies": { 40 | "vite": ">=1.0.0-beta.1" 41 | }, 42 | "devDependencies": { 43 | "@types/node": "^14.0.3", 44 | "@types/which": "^1.3.2", 45 | "typescript": "^3.9.2", 46 | "vite": "^1.0.0-beta.1" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/rustRollupPlugin.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from 'rollup'; 2 | import { resolveAsset, registerAssets } from 'vite/dist/node/build/buildPluginAsset'; 3 | import { PluginConfig } from './config'; 4 | 5 | const LINE = "input = import.meta.url.replace(/\\.js$/, '_bg.wasm');" 6 | 7 | // TODO: Is it possible to get these options from vite? 8 | export const createRustRollupPlugin = ( 9 | cfg: PluginConfig, 10 | publicBase: string = '/', 11 | assetsDir: string = '_assets', 12 | inlineLimit: number = 4096, 13 | ): Plugin => { 14 | const assets = new Map() 15 | 16 | return { 17 | name: 'vite:rust', 18 | 19 | async transform(code, id) { 20 | let crateInfo = cfg.crateForFile(id); 21 | if (crateInfo) { 22 | if (cfg.isEntryForCrate(...crateInfo)) { 23 | let idx = id.lastIndexOf('.'); 24 | let wasmId = id.substring(0, idx) + '_bg.wasm'; 25 | const { fileName, content, url } = await resolveAsset( 26 | wasmId, 27 | cfg.root, 28 | publicBase, 29 | assetsDir, 30 | inlineLimit, 31 | ); 32 | if (fileName && content && url) { 33 | assets.set(fileName, content); 34 | let replLine = `input = '${url}';`; 35 | code = code.replace(LINE, replLine); 36 | return code; 37 | } 38 | } 39 | } 40 | return null; 41 | }, 42 | 43 | generateBundle(_options, bundle) { 44 | registerAssets(assets, bundle); 45 | }, 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /example/crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | # You must change these to your own details. 2 | [package] 3 | name = "rust-crate" 4 | description = "My super awesome Rust, WebAssembly, and Webpack project!" 5 | version = "0.1.0" 6 | authors = ["You "] 7 | categories = ["wasm"] 8 | readme = "README.md" 9 | edition = "2018" 10 | 11 | [lib] 12 | crate-type = ["cdylib"] 13 | 14 | [profile.release] 15 | # This makes the compiled code faster and smaller, but it makes compiling slower, 16 | # so it's only enabled in release mode. 17 | lto = true 18 | 19 | [features] 20 | # If you uncomment this line, it will enable `wee_alloc`: 21 | #default = ["wee_alloc"] 22 | 23 | [dependencies] 24 | # The `wasm-bindgen` crate provides the bare minimum functionality needed 25 | # to interact with JavaScript. 26 | wasm-bindgen = "0.2.45" 27 | 28 | # `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size 29 | # compared to the default allocator's ~10K. However, it is slower than the default 30 | # allocator, so it's not enabled by default. 31 | wee_alloc = { version = "0.4.2", optional = true } 32 | 33 | # The `web-sys` crate allows you to interact with the various browser APIs, 34 | # like the DOM. 35 | [dependencies.web-sys] 36 | version = "0.3.22" 37 | features = ["console"] 38 | 39 | # The `console_error_panic_hook` crate provides better debugging of panics by 40 | # logging them with `console.error`. This is great for development, but requires 41 | # all the `std::fmt` and `std::panicking` infrastructure, so it's only enabled 42 | # in debug mode. 43 | [target."cfg(debug_assertions)".dependencies] 44 | console_error_panic_hook = "0.1.5" 45 | 46 | # These crates are used for running unit tests. 47 | [dev-dependencies] 48 | wasm-bindgen-test = "0.2.45" 49 | futures = "0.1.27" 50 | js-sys = "0.3.22" 51 | wasm-bindgen-futures = "0.3.22" 52 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { UserConfig, normalizeConfig } from './config'; 2 | import { compile, watch } from './compiler'; 3 | import { createRustRollupPlugin } from './rustRollupPlugin'; 4 | 5 | const debug = require('debug')('vite-plugin-rust:index'); 6 | 7 | const URL_PREFIX = '/@rust/'; 8 | 9 | function urlForCrate(crate: string, ...pathes: string[]): string { 10 | let tail = pathes.map(p => p.replace(/\\/g, '/')).join('/') 11 | return `${URL_PREFIX}${crate}/${tail}`; 12 | } 13 | 14 | module.exports = (config: UserConfig) => { 15 | let root = process.cwd(); 16 | let cfg = normalizeConfig(config, root); 17 | 18 | debug('vite-plugin-rust config', cfg); 19 | // Do initial compile in dev mode 20 | // wasm-pack compile in build is done in rollup plugin 21 | compile(cfg, '', true); 22 | 23 | // TODO: only watch in dev mode 24 | watch(cfg, crate => { 25 | compile(cfg, crate); 26 | }); 27 | 28 | return { 29 | resolvers: [{ 30 | alias(id: string) { 31 | let parts = id.split('/', 2); 32 | if (parts.length >= 1) { 33 | let [crate, filePath] = parts; 34 | if (crate in cfg.crates) { 35 | if (!filePath) { 36 | filePath = cfg.crates[crate].outName + '.js'; 37 | } 38 | return urlForCrate(crate, filePath); 39 | } 40 | } 41 | }, 42 | requestToFile(publicPath: string, root: string) { 43 | if (publicPath.startsWith(URL_PREFIX)) { 44 | let seg = publicPath.substring(URL_PREFIX.length); 45 | let [crate, filePath] = seg.split('/', 2); 46 | return cfg.filePathForCrate(crate, filePath); 47 | } 48 | }, 49 | fileToRequest(filePath: string, root: string) { 50 | let crateInfo = cfg.crateForFile(filePath); 51 | if (crateInfo) { 52 | return urlForCrate(...crateInfo); 53 | } 54 | }, 55 | }], 56 | rollupInputOptions: { 57 | plugins: [ 58 | createRustRollupPlugin(cfg), 59 | ] 60 | } 61 | }; 62 | }; -------------------------------------------------------------------------------- /src/compiler.ts: -------------------------------------------------------------------------------- 1 | import { spawnSync, spawn } from 'child_process'; 2 | import path from 'path'; 3 | import { PluginConfig, WasmPackOpts } from "./config"; 4 | import chalk from 'chalk'; 5 | import chokidar from 'chokidar'; 6 | 7 | const debug = require('debug')('vite-plugin-rust:compiler'); 8 | 9 | function compileOne(crate: string, opt: WasmPackOpts, sync: boolean) { 10 | // TODO: toggle this mode base on build profile 11 | let mode = '--dev'; 12 | let exe = 'wasm-pack'; 13 | if (process.platform == 'win32') { 14 | exe = 'wasm-pack.exe'; 15 | } 16 | const args = ['build', mode, '--out-name', opt.outName, '--target', 'web']; 17 | debug('Running subprocess with command: ', exe, args.join(' ')); 18 | if (sync) { 19 | let ps = spawnSync(exe, args, { 20 | shell: true, 21 | cwd: opt.path, 22 | encoding: 'utf-8', 23 | stdio: ['inherit', 'inherit', 'inherit'], 24 | }); 25 | if (ps.status != 0) { 26 | throw chalk.red(`wasm-pack for crate ${crate} failed`); 27 | } 28 | } else { 29 | let ps = spawn(exe, args, { 30 | shell: true, 31 | cwd: opt.path, 32 | stdio: ['inherit', 'inherit', 'inherit'], 33 | }); 34 | ps.on('close', code => { 35 | if (code != 0) { 36 | throw chalk.red(`wasm-pack for crate ${crate} failed`); 37 | } 38 | }); 39 | } 40 | } 41 | 42 | export function compile(cfg: PluginConfig, crate?: string, sync?: boolean) { 43 | const { crates, wasmPack } = cfg; 44 | debug('Compile using wasm-pack at', wasmPack); 45 | for (let crate in crates) { 46 | let opt = crates[crate]; 47 | compileOne(crate, opt, sync || false); 48 | } 49 | } 50 | 51 | type WatchCallback = (crateName: string) => void; 52 | 53 | export function watch(cfg: PluginConfig, cbk: WatchCallback) { 54 | Object.entries(cfg.crates).forEach(([crateName, opt]) => { 55 | chokidar.watch([ 56 | path.join(opt.path, '/src'), 57 | path.join(opt.path, 'Cargo.toml'), 58 | ], { 59 | ignoreInitial: true, 60 | }).on('all', (event, path) => { 61 | console.log('Crate', crateName, 'changed!', 'Event:', event, 'File:', path); 62 | cbk(crateName); 63 | }); 64 | }); 65 | } -------------------------------------------------------------------------------- /src/config.ts: -------------------------------------------------------------------------------- 1 | import which from 'which'; 2 | import chalk from 'chalk'; 3 | import path from 'path' 4 | 5 | export interface UserConfig { 6 | crates: Record, 7 | wasmPack?: string, 8 | } 9 | 10 | export interface WasmPackOpts { 11 | path: string, 12 | outName: string, // --out-name passed to wasm-pack 13 | } 14 | 15 | export class PluginConfig { 16 | wasmPack: string; 17 | crates: Record; 18 | root: string; 19 | 20 | constructor(wasmPack: string, crates: Record, root: string) { 21 | this.wasmPack = wasmPack; 22 | this.crates = crates; 23 | this.root = root; 24 | } 25 | 26 | // given a local file absolute path, check if it's in one of our crates 27 | // if so, split it into crate and remaining path 28 | public crateForFile(filePath: string): [string, string] | undefined { 29 | for (let crate in this.crates) { 30 | let cratePath = this.crates[crate].path + path.sep + 'pkg'; 31 | if (filePath.startsWith(cratePath)) { 32 | return [crate, filePath.substring(cratePath.length + 1)]; 33 | } 34 | } 35 | } 36 | 37 | public filePathForCrate(crate: string, filePath: string): string | undefined { 38 | if (crate in this.crates) { 39 | let cratePath = this.crates[crate].path; 40 | return path.resolve(cratePath, 'pkg', filePath); 41 | } 42 | } 43 | 44 | // if the given relative file path is crate entry js file 45 | public isEntryForCrate(crate: string, filePath: string): boolean { 46 | if (crate in this.crates) { 47 | let outName = this.crates[crate].outName; 48 | return filePath == outName + '.js'; 49 | } 50 | return false; 51 | } 52 | } 53 | 54 | export function normalizeConfig(cfg: UserConfig, root: string): PluginConfig { 55 | let wasmPack = cfg.wasmPack; 56 | if (!wasmPack) { 57 | wasmPack = which.sync('wasm-pack', { nothrow: true }) || undefined; 58 | if (!wasmPack) { 59 | throw chalk.red('Cannot find wasm-pack in your PATH. Please make sure wasm-pack is installed'); 60 | } 61 | } 62 | 63 | let newCrates: Record = {}; 64 | for (let crate in cfg.crates) { 65 | let opt = cfg.crates[crate]; 66 | let newCrate; 67 | if (typeof opt == 'string') { 68 | newCrate = { 69 | path: path.resolve(root, opt), 70 | outName: nameForCrate(crate), 71 | } 72 | } else { 73 | newCrate = { 74 | path: path.resolve(root, opt.path), 75 | outName: opt.outName, 76 | }; 77 | } 78 | newCrates[crate] = newCrate; 79 | } 80 | 81 | return new PluginConfig(wasmPack, newCrates, root); 82 | } 83 | 84 | function nameForCrate(crate: string): string { 85 | return crate.replace(/-/g, '_').toLowerCase(); 86 | } 87 | -------------------------------------------------------------------------------- /example/crate/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "bumpalo" 5 | version = "3.4.0" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 8 | 9 | [[package]] 10 | name = "cfg-if" 11 | version = "0.1.10" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 14 | 15 | [[package]] 16 | name = "console_error_panic_hook" 17 | version = "0.1.6" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" 20 | dependencies = [ 21 | "cfg-if", 22 | "wasm-bindgen", 23 | ] 24 | 25 | [[package]] 26 | name = "futures" 27 | version = "0.1.29" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" 30 | 31 | [[package]] 32 | name = "js-sys" 33 | version = "0.3.44" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73" 36 | dependencies = [ 37 | "wasm-bindgen", 38 | ] 39 | 40 | [[package]] 41 | name = "lazy_static" 42 | version = "1.4.0" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 45 | 46 | [[package]] 47 | name = "libc" 48 | version = "0.2.74" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" 51 | 52 | [[package]] 53 | name = "log" 54 | version = "0.4.11" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 57 | dependencies = [ 58 | "cfg-if", 59 | ] 60 | 61 | [[package]] 62 | name = "memory_units" 63 | version = "0.4.0" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" 66 | 67 | [[package]] 68 | name = "proc-macro2" 69 | version = "0.4.30" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" 72 | dependencies = [ 73 | "unicode-xid 0.1.0", 74 | ] 75 | 76 | [[package]] 77 | name = "proc-macro2" 78 | version = "1.0.19" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" 81 | dependencies = [ 82 | "unicode-xid 0.2.1", 83 | ] 84 | 85 | [[package]] 86 | name = "quote" 87 | version = "0.6.13" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" 90 | dependencies = [ 91 | "proc-macro2 0.4.30", 92 | ] 93 | 94 | [[package]] 95 | name = "quote" 96 | version = "1.0.7" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 99 | dependencies = [ 100 | "proc-macro2 1.0.19", 101 | ] 102 | 103 | [[package]] 104 | name = "rust-crate" 105 | version = "0.1.0" 106 | dependencies = [ 107 | "console_error_panic_hook", 108 | "futures", 109 | "js-sys", 110 | "wasm-bindgen", 111 | "wasm-bindgen-futures", 112 | "wasm-bindgen-test", 113 | "web-sys", 114 | "wee_alloc", 115 | ] 116 | 117 | [[package]] 118 | name = "scoped-tls" 119 | version = "1.0.0" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" 122 | 123 | [[package]] 124 | name = "syn" 125 | version = "1.0.38" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4" 128 | dependencies = [ 129 | "proc-macro2 1.0.19", 130 | "quote 1.0.7", 131 | "unicode-xid 0.2.1", 132 | ] 133 | 134 | [[package]] 135 | name = "unicode-xid" 136 | version = "0.1.0" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 139 | 140 | [[package]] 141 | name = "unicode-xid" 142 | version = "0.2.1" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 145 | 146 | [[package]] 147 | name = "wasm-bindgen" 148 | version = "0.2.67" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" 151 | dependencies = [ 152 | "cfg-if", 153 | "wasm-bindgen-macro", 154 | ] 155 | 156 | [[package]] 157 | name = "wasm-bindgen-backend" 158 | version = "0.2.67" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" 161 | dependencies = [ 162 | "bumpalo", 163 | "lazy_static", 164 | "log", 165 | "proc-macro2 1.0.19", 166 | "quote 1.0.7", 167 | "syn", 168 | "wasm-bindgen-shared", 169 | ] 170 | 171 | [[package]] 172 | name = "wasm-bindgen-futures" 173 | version = "0.3.27" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "83420b37346c311b9ed822af41ec2e82839bfe99867ec6c54e2da43b7538771c" 176 | dependencies = [ 177 | "cfg-if", 178 | "futures", 179 | "js-sys", 180 | "wasm-bindgen", 181 | "web-sys", 182 | ] 183 | 184 | [[package]] 185 | name = "wasm-bindgen-macro" 186 | version = "0.2.67" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" 189 | dependencies = [ 190 | "quote 1.0.7", 191 | "wasm-bindgen-macro-support", 192 | ] 193 | 194 | [[package]] 195 | name = "wasm-bindgen-macro-support" 196 | version = "0.2.67" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" 199 | dependencies = [ 200 | "proc-macro2 1.0.19", 201 | "quote 1.0.7", 202 | "syn", 203 | "wasm-bindgen-backend", 204 | "wasm-bindgen-shared", 205 | ] 206 | 207 | [[package]] 208 | name = "wasm-bindgen-shared" 209 | version = "0.2.67" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092" 212 | 213 | [[package]] 214 | name = "wasm-bindgen-test" 215 | version = "0.2.50" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "a2d9693b63a742d481c7f80587e057920e568317b2806988c59cd71618bc26c1" 218 | dependencies = [ 219 | "console_error_panic_hook", 220 | "futures", 221 | "js-sys", 222 | "scoped-tls", 223 | "wasm-bindgen", 224 | "wasm-bindgen-futures", 225 | "wasm-bindgen-test-macro", 226 | ] 227 | 228 | [[package]] 229 | name = "wasm-bindgen-test-macro" 230 | version = "0.2.50" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "0789dac148a8840bbcf9efe13905463b733fa96543bfbf263790535c11af7ba5" 233 | dependencies = [ 234 | "proc-macro2 0.4.30", 235 | "quote 0.6.13", 236 | ] 237 | 238 | [[package]] 239 | name = "web-sys" 240 | version = "0.3.44" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47" 243 | dependencies = [ 244 | "js-sys", 245 | "wasm-bindgen", 246 | ] 247 | 248 | [[package]] 249 | name = "wee_alloc" 250 | version = "0.4.5" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" 253 | dependencies = [ 254 | "cfg-if", 255 | "libc", 256 | "memory_units", 257 | "winapi", 258 | ] 259 | 260 | [[package]] 261 | name = "winapi" 262 | version = "0.3.9" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 265 | dependencies = [ 266 | "winapi-i686-pc-windows-gnu", 267 | "winapi-x86_64-pc-windows-gnu", 268 | ] 269 | 270 | [[package]] 271 | name = "winapi-i686-pc-windows-gnu" 272 | version = "0.4.0" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 275 | 276 | [[package]] 277 | name = "winapi-x86_64-pc-windows-gnu" 278 | version = "0.4.0" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 281 | --------------------------------------------------------------------------------