Logo
Explore Help
Sign In
fluencelabs/wasm-bindgen
1
0
Fork 0
You've already forked wasm-bindgen
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-06-07 10:01:24 +00:00
Code Issues Projects Releases Wiki Activity
wasm-bindgen/examples/hello_world/src/lib.rs

16 lines
262 B
Rust
Raw Normal View History

Leverage new rustc wasm features This commit leverages two new attributes in the Rust compiler, `#[wasm_custom_section]` and `#[wasm_import_module]`. These two attributes allow removing a lot of hacks found in wasm-bindgen and also allows removing the requirement of `wasm-opt` to remove the unused data sections. This does require two new nightly features but we already required the `proc_macro` nightly feature and these will hopefully be stabilized before that feature!
2018-03-14 14:33:53 -07:00
#![feature(proc_macro, wasm_custom_section, wasm_import_module)]
Rewrite the README using Webpack Right now Webpack probably has the most mature support for loading wasm modules, so let's show off how to do that! Additionally this commits hello world as an example to the repository.
2018-03-02 20:11:30 -08:00
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern {
fn alert(s: &str);
}
#[wasm_bindgen]
Add an example of console.log Also clean up some other exampels
2018-03-09 10:25:19 -08:00
pub fn greet(name: &str) {
Rewrite the README using Webpack Right now Webpack probably has the most mature support for loading wasm modules, so let's show off how to do that! Additionally this commits hello world as an example to the repository.
2018-03-02 20:11:30 -08:00
alert(&format!("Hello, {}!", name));
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 49ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API