Skip to content

Commit c029f58

Browse files
committed
Implementation of draft RFC
1 parent 74812bd commit c029f58

File tree

214 files changed

+5908
-932
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+5908
-932
lines changed

Cargo.toml

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wasm-bindgen"
3-
version = "0.2.51"
3+
version = "0.2.52"
44
authors = ["The wasm-bindgen Developers"]
55
license = "MIT/Apache-2.0"
66
readme = "README.md"
@@ -36,15 +36,16 @@ strict-macro = ["wasm-bindgen-macro/strict-macro"]
3636
xxx_debug_only_print_generated_code = ["wasm-bindgen-macro/xxx_debug_only_print_generated_code"]
3737

3838
[dependencies]
39-
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.51" }
39+
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.52" }
4040
serde = { version = "1.0", optional = true }
4141
serde_json = { version = "1.0", optional = true }
4242
cfg-if = "0.1.9"
43+
proc-macro-hack = "0.5"
4344

4445
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
45-
js-sys = { path = 'crates/js-sys', version = '0.3.28' }
46-
wasm-bindgen-test = { path = 'crates/test', version = '=0.3.1' }
47-
wasm-bindgen-futures = { path = 'crates/futures', version = '=0.4.1' }
46+
js-sys = { path = 'crates/js-sys', version = '0.3.29' }
47+
wasm-bindgen-test = { path = 'crates/test', version = '=0.3.2' }
48+
wasm-bindgen-futures = { path = 'crates/futures', version = '=0.4.2' }
4849
serde_derive = "1.0"
4950
wasm-bindgen-test-crate-a = { path = 'tests/crates/a', version = '0.1' }
5051
wasm-bindgen-test-crate-b = { path = 'tests/crates/b', version = '0.1' }
@@ -79,6 +80,20 @@ members = [
7980
"examples/todomvc",
8081
"examples/wasm-in-wasm",
8182
"examples/wasm2js",
83+
"examples/web-components-composed-composed-path",
84+
"examples/web-components-defined-pseudo-class",
85+
"examples/web-components-edit-word",
86+
"examples/web-components-editable-list",
87+
"examples/web-components-element-details",
88+
"examples/web-components-expanding-list-web-component",
89+
"examples/web-components-host-selectors",
90+
"examples/web-components-life-cycle-callbacks",
91+
"examples/web-components-popup-info-box-external-stylesheet",
92+
"examples/web-components-popup-info-box-web-component",
93+
"examples/web-components-simple-template",
94+
"examples/web-components-slotchange",
95+
"examples/web-components-slotted-pseudo-element",
96+
"examples/web-components-word-count-web-component",
8297
"examples/webaudio",
8398
"examples/webgl",
8499
"examples/websockets",

_package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
},
66
"devDependencies": {
77
"@wasm-tool/wasm-pack-plugin": "1.0.1",
8+
"copy-webpack-plugin": "^5.0.0",
89
"html-webpack-plugin": "^3.2.0",
910
"text-encoding": "^0.7.0",
1011
"webpack": "^4.29.4",

crates/anyref-xform/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wasm-bindgen-anyref-xform"
3-
version = "0.2.51"
3+
version = "0.2.52"
44
authors = ["The wasm-bindgen Developers"]
55
license = "MIT/Apache-2.0"
66
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/anyref-xform"

crates/backend/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wasm-bindgen-backend"
3-
version = "0.2.51"
3+
version = "0.2.52"
44
authors = ["The wasm-bindgen Developers"]
55
license = "MIT/Apache-2.0"
66
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend"
@@ -22,4 +22,4 @@ log = "0.4"
2222
proc-macro2 = "1.0"
2323
quote = '1.0'
2424
syn = { version = '1.0', features = ['full'] }
25-
wasm-bindgen-shared = { path = "../shared", version = "=0.2.51" }
25+
wasm-bindgen-shared = { path = "../shared", version = "=0.2.52" }

crates/backend/src/ast.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ pub struct Export {
4444
pub method_kind: MethodKind,
4545
/// The type of `self` (either `self`, `&self`, or `&mut self`)
4646
pub method_self: Option<MethodSelf>,
47+
/// The body of the method
48+
pub method_body: Option<syn::Block>,
4749
/// The struct name, in Rust, this is attached to
4850
pub rust_class: Option<Ident>,
4951
/// The name of the rust function/method on the rust side.
@@ -57,8 +59,6 @@ pub struct Export {
5759
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
5860
#[derive(Clone)]
5961
pub enum MethodSelf {
60-
/// `self`
61-
ByValue,
6262
/// `&mut self`
6363
RefMutable,
6464
/// `&self`
@@ -223,6 +223,8 @@ pub struct Struct {
223223
pub js_name: String,
224224
pub fields: Vec<StructField>,
225225
pub comments: Vec<String>,
226+
pub prototype: syn::Type,
227+
pub prototype_field: Option<syn::Member>,
226228
}
227229

228230
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]

0 commit comments

Comments
 (0)