Skip to content

Commit 996e92f

Browse files
authored
Mass rename anyref to externref (#2142)
Updates a mess of dependencies and tracks the most recent version of the reference types specification.
1 parent 61e8fc0 commit 996e92f

Some content is hidden

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

65 files changed

+604
-596
lines changed

azure-pipelines.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,19 @@ jobs:
3535
displayName: "Futures test suite on wasm"
3636
- script: cargo test -p wasm-bindgen-multi-value-xform
3737
displayName: "multi-value xform tests on native"
38-
- script: |
39-
set -e
40-
echo "##vso[task.setvariable variable=NODE_ARGS]--experimental-wasm-anyref"
41-
echo "##vso[task.setvariable variable=WASM_BINDGEN_ANYREF]1"
42-
displayName: "Configure anyref passes"
43-
- script: cargo test --target wasm32-unknown-unknown --test wasm
44-
displayName: "(anyref) Crate test suite"
45-
- script: WASM_BINDGEN_NO_DEBUG=1 cargo test --target wasm32-unknown-unknown --test wasm
46-
displayName: "(anyref) Crate test suite (no debug)"
47-
- script: cargo test --target wasm32-unknown-unknown --features serde-serialize --test wasm
48-
displayName: "(anyref) Crate test suite (with serde)"
38+
# TODO: re-enable when binary decoding for reference types is updated in
39+
# Node.
40+
# - script: |
41+
# set -e
42+
# echo "##vso[task.setvariable variable=NODE_ARGS]--experimental-wasm-anyref"
43+
# echo "##vso[task.setvariable variable=WASM_BINDGEN_ANYREF]1"
44+
# displayName: "Configure anyref passes"
45+
# - script: cargo test --target wasm32-unknown-unknown --test wasm
46+
# displayName: "(anyref) Crate test suite"
47+
# - script: WASM_BINDGEN_NO_DEBUG=1 cargo test --target wasm32-unknown-unknown --test wasm
48+
# displayName: "(anyref) Crate test suite (no debug)"
49+
# - script: cargo test --target wasm32-unknown-unknown --features serde-serialize --test wasm
50+
# displayName: "(anyref) Crate test suite (with serde)"
4951

5052
- job: test_wasm_bindgen_windows
5153
displayName: "Run wasm-bindgen crate tests (Windows)"
@@ -91,8 +93,8 @@ jobs:
9193
displayName: "wasm-bindgen-cli-support tests"
9294
- script: cargo test -p wasm-bindgen-cli
9395
displayName: "wasm-bindgen-cli tests"
94-
- script: cargo test -p wasm-bindgen-anyref-xform
95-
displayName: "wasm-bindgen-anyref-xform tests"
96+
- script: cargo test -p wasm-bindgen-externref-xform
97+
displayName: "wasm-bindgen-externref-xform tests"
9698
- script: cargo test -p wasm-bindgen-multi-value-xform
9799
displayName: "wasm-bindgen-multi-value-xform tests"
98100
- script: cargo test -p wasm-bindgen-wasm-interpreter

crates/backend/src/codegen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ impl ToTokens for ast::ImportType {
580580
let typescript_type_chars = typescript_type.chars().map(|c| c as u32);
581581
quote! {
582582
use wasm_bindgen::describe::*;
583-
inform(NAMED_ANYREF);
583+
inform(NAMED_EXTERNREF);
584584
inform(#typescript_type_len);
585585
#(inform(#typescript_type_chars);)*
586586
}

crates/cli-support/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ log = "0.4"
1818
rustc-demangle = "0.1.13"
1919
serde_json = "1.0"
2020
tempfile = "3.0"
21-
walrus = "0.16.1"
22-
wasm-bindgen-anyref-xform = { path = '../anyref-xform', version = '=0.2.62' }
21+
walrus = "0.17.0"
22+
wasm-bindgen-externref-xform = { path = '../externref-xform', version = '=0.2.62' }
2323
wasm-bindgen-multi-value-xform = { path = '../multi-value-xform', version = '=0.2.62' }
2424
wasm-bindgen-shared = { path = "../shared", version = '=0.2.62' }
2525
wasm-bindgen-threads-xform = { path = '../threads-xform', version = '=0.2.62' }
2626
wasm-bindgen-wasm-conventions = { path = '../wasm-conventions', version = '=0.2.62' }
2727
wasm-bindgen-wasm-interpreter = { path = "../wasm-interpreter", version = '=0.2.62' }
28-
wit-text = "0.6.0"
29-
wit-walrus = "0.2.0"
30-
wit-validator = "0.1.0"
28+
wit-text = "0.7.0"
29+
wit-walrus = "0.4.0"
30+
wit-validator = "0.2.0"

crates/cli-support/src/descriptor.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ tys! {
3030
REFMUT
3131
SLICE
3232
VECTOR
33-
ANYREF
34-
NAMED_ANYREF
33+
EXTERNREF
34+
NAMED_EXTERNREF
3535
ENUM
3636
RUST_STRUCT
3737
CHAR
@@ -62,8 +62,8 @@ pub enum Descriptor {
6262
Vector(Box<Descriptor>),
6363
CachedString,
6464
String,
65-
Anyref,
66-
NamedAnyref(String),
65+
Externref,
66+
NamedExternref(String),
6767
Enum { hole: u32 },
6868
RustStruct(String),
6969
Char,
@@ -100,7 +100,7 @@ pub enum VectorKind {
100100
F32,
101101
F64,
102102
String,
103-
Anyref,
103+
Externref,
104104
}
105105

106106
impl Descriptor {
@@ -133,15 +133,15 @@ impl Descriptor {
133133
OPTIONAL => Descriptor::Option(Box::new(Descriptor::_decode(data, clamped))),
134134
CACHED_STRING => Descriptor::CachedString,
135135
STRING => Descriptor::String,
136-
ANYREF => Descriptor::Anyref,
136+
EXTERNREF => Descriptor::Externref,
137137
ENUM => Descriptor::Enum { hole: get(data) },
138138
RUST_STRUCT => {
139139
let name = get_string(data);
140140
Descriptor::RustStruct(name)
141141
}
142-
NAMED_ANYREF => {
142+
NAMED_EXTERNREF => {
143143
let name = get_string(data);
144-
Descriptor::NamedAnyref(name)
144+
Descriptor::NamedExternref(name)
145145
}
146146
CHAR => Descriptor::Char,
147147
UNIT => Descriptor::Unit,
@@ -192,7 +192,7 @@ impl Descriptor {
192192
Descriptor::U64 => Some(VectorKind::U64),
193193
Descriptor::F32 => Some(VectorKind::F32),
194194
Descriptor::F64 => Some(VectorKind::F64),
195-
Descriptor::Anyref => Some(VectorKind::Anyref),
195+
Descriptor::Externref => Some(VectorKind::Externref),
196196
_ => None,
197197
}
198198
}
@@ -254,7 +254,7 @@ impl VectorKind {
254254
VectorKind::U64 => "BigUint64Array",
255255
VectorKind::F32 => "Float32Array",
256256
VectorKind::F64 => "Float64Array",
257-
VectorKind::Anyref => "any[]",
257+
VectorKind::Externref => "any[]",
258258
}
259259
}
260260

@@ -272,7 +272,7 @@ impl VectorKind {
272272
VectorKind::U64 => 8,
273273
VectorKind::F32 => 4,
274274
VectorKind::F64 => 8,
275-
VectorKind::Anyref => 4,
275+
VectorKind::Externref => 4,
276276
}
277277
}
278278
}

0 commit comments

Comments
 (0)