Revert "web: Bump `wasm-bindgen` to 0.2.83"

This reverts commit 1954f6162f.
This commit is contained in:
relrelb 2022-09-24 09:22:47 +03:00
parent b571b43375
commit b5084eef25
11 changed files with 220 additions and 235 deletions

View File

@ -318,7 +318,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: install
args: wasm-bindgen-cli --version 0.2.83
args: wasm-bindgen-cli --version 0.2.82
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2

View File

@ -60,7 +60,7 @@ jobs:
# wasm-bindgen-cli version must match wasm-bindgen crate version.
# Be sure to update in release_nightly.yml, web/Cargo.toml and web/README.md.
- name: Install wasm-bindgen
run: cargo install wasm-bindgen-cli --version 0.2.83
run: cargo install wasm-bindgen-cli --version 0.2.82
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2

412
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,7 @@ rustversion = "1.0.9"
version = "0.3.24"
[target.'cfg(target_family = "wasm")'.dependencies.wasm-bindgen-futures]
version = "0.4.33"
version = "0.4.32"
[features]
default = []

View File

@ -15,7 +15,7 @@ smallvec = { version = "1.9.0", features = ["union"] }
downcast-rs = "1.2.0"
lyon = { version = "1.0.0", optional = true }
thiserror = "1.0"
wasm-bindgen = { version = "=0.2.83", optional = true }
wasm-bindgen = { version = "=0.2.82", optional = true }
[dependencies.jpeg-decoder]
version = "0.2.6"

View File

@ -6,10 +6,10 @@ edition = "2021"
license = "MIT OR Apache-2.0"
[dependencies]
js-sys = "0.3.60"
js-sys = "0.3.59"
log = "0.4"
ruffle_web_common = { path = "../../web/common" }
wasm-bindgen = "=0.2.83"
wasm-bindgen = "=0.2.82"
fnv = "1.0.7"
ruffle_render = { path = "..", features = ["web"] }
swf = { path = "../../swf" }

View File

@ -6,11 +6,11 @@ edition = "2021"
license = "MIT OR Apache-2.0"
[dependencies]
js-sys = "0.3.60"
js-sys = "0.3.59"
log = "0.4"
ruffle_web_common = { path = "../../web/common" }
ruffle_render = { path = "..", features = ["tessellator", "web"] }
wasm-bindgen = "=0.2.83"
wasm-bindgen = "=0.2.82"
bytemuck = { version = "1.12.1", features = ["derive"] }
fnv = "1.0.7"
swf = { path = "../../swf" }

View File

@ -30,7 +30,7 @@ wgpu-webgl = ["ruffle_render_wgpu", "ruffle_render_wgpu/webgl"]
console_error_panic_hook = { version = "0.1.7", optional = true }
console_log = { version = "0.2", optional = true }
generational-arena = "0.2.8"
js-sys = "0.3.60"
js-sys = "0.3.59"
log = { version = "0.4", features = ["serde"] }
ruffle_render_canvas = { path = "../render/canvas", optional = true }
ruffle_web_common = { path = "common" }
@ -38,9 +38,8 @@ ruffle_render_webgl = { path = "../render/webgl", optional = true }
ruffle_render_wgpu = { path = "../render/wgpu", optional = true }
ruffle_video_software = { path = "../video/software" }
url = "2.3.1"
wasm-bindgen = "=0.2.83"
wasm-bindgen = { version = "=0.2.82", features = ["serde-serialize"] }
wasm-bindgen-futures = "0.4.32"
serde-wasm-bindgen = "0.4.3"
chrono = { version = "0.4", features = ["wasmbind"] }
getrandom = { version = "0.2", features = ["js"] }
serde = { version = "1.0.144", features = ["derive"] }

View File

@ -58,7 +58,7 @@ Note that npm 7 or newer is required. It should come bundled with Node.js 15 or
<!-- Be sure to also update the wasm-bindgen-cli version in `.github/workflows/*.yml` and `web/Cargo.toml`. -->
This can be installed with `cargo install wasm-bindgen-cli --version 0.2.83`. Be sure to install this specific version of `wasm-bindgen-cli` to match the version used by Ruffle.
This can be installed with `cargo install wasm-bindgen-cli --version 0.2.82`. Be sure to install this specific version of `wasm-bindgen-cli` to match the version used by Ruffle.
#### Binaryen

View File

@ -6,9 +6,9 @@ edition = "2021"
license = "MIT OR Apache-2.0"
[dependencies]
js-sys = "0.3.60"
js-sys = "0.3.59"
log = "0.4"
wasm-bindgen = "=0.2.83"
wasm-bindgen = "=0.2.82"
[dependencies.web-sys]
version = "0.3.58"

View File

@ -204,8 +204,8 @@ pub struct Ruffle(Index);
impl Ruffle {
#[allow(clippy::new_ret_no_self)]
#[wasm_bindgen(constructor)]
pub fn new(parent: HtmlElement, js_player: JavascriptPlayer, config: JsValue) -> Promise {
let config: Config = serde_wasm_bindgen::from_value(config).unwrap_or_default();
pub fn new(parent: HtmlElement, js_player: JavascriptPlayer, config: &JsValue) -> Promise {
let config: Config = config.into_serde().unwrap_or_default();
wasm_bindgen_futures::future_to_promise(async move {
if RUFFLE_GLOBAL_PANIC.is_completed() {
// If an actual panic happened, then we can't trust the state it left us in.
@ -224,9 +224,9 @@ impl Ruffle {
/// Stream an arbitrary movie file from (presumably) the Internet.
///
/// This method should only be called once per player.
pub fn stream_from(&mut self, movie_url: String, parameters: JsValue) -> Result<(), JsValue> {
pub fn stream_from(&mut self, movie_url: String, parameters: &JsValue) -> Result<(), JsValue> {
let _ = self.with_core_mut(|core| {
let parameters_to_load = parse_movie_parameters(&parameters);
let parameters_to_load = parse_movie_parameters(parameters);
let ruffle = *self;
let on_metadata = move |swf_header: &ruffle_core::swf::HeaderExt| {
@ -241,10 +241,10 @@ impl Ruffle {
/// Play an arbitrary movie on this instance.
///
/// This method should only be called once per player.
pub fn load_data(&mut self, swf_data: Uint8Array, parameters: JsValue) -> Result<(), JsValue> {
pub fn load_data(&mut self, swf_data: Uint8Array, parameters: &JsValue) -> Result<(), JsValue> {
let mut movie = SwfMovie::from_data(&swf_data.to_vec(), None, None)
.map_err(|e| format!("Error loading movie: {}", e))?;
movie.append_parameters(parse_movie_parameters(&parameters));
movie.append_parameters(parse_movie_parameters(parameters));
self.on_metadata(movie.header());
@ -289,7 +289,7 @@ impl Ruffle {
pub fn prepare_context_menu(&mut self) -> JsValue {
self.with_core_mut(|core| {
let info = core.prepare_context_menu();
serde_wasm_bindgen::to_value(&info).unwrap_or(JsValue::UNDEFINED)
JsValue::from_serde(&info).unwrap_or(JsValue::UNDEFINED)
})
.unwrap_or(JsValue::UNDEFINED)
}
@ -1032,7 +1032,7 @@ impl Ruffle {
is_action_script_3: swf_header.is_action_script_3(),
};
if let Ok(value) = serde_wasm_bindgen::to_value(&metadata) {
if let Ok(value) = JsValue::from_serde(&metadata) {
instance.js_player.set_metadata(value);
}
});