Skip to content

Commit

Permalink
fix: tests, prepare for 0.61.9 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanceras committed Nov 17, 2024
1 parent 6a374ab commit 8ec2fe5
Show file tree
Hide file tree
Showing 26 changed files with 11 additions and 35 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sauron"
version = "0.61.8"
version = "0.61.9"
authors = [ "Jovansonlee Cesar <[email protected]>" ]
license = "MIT"
description = "A versatile web framework and library for building client-side and/or server-side web applications"
Expand Down Expand Up @@ -101,4 +101,3 @@ harness = false
[[bench]]
name = "bench_view_performance"
harness = false

2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sauron-core"
version = "0.61.8"
version = "0.61.9"
authors = [ "Jovansonlee Cesar <[email protected]>" ]
license = "MIT"
description = "An html library for building client side webapps"
Expand Down
8 changes: 2 additions & 6 deletions crates/core/src/dom/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::vdom;
use crate::vdom::ComponentEventCallback;
use crate::vdom::{Attribute, AttributeValue, EventCallback};
use wasm_bindgen::JsCast;
#[cfg(web_sys_unstable_apis)]
pub use web_sys::ClipboardEvent;
pub use web_sys::{
AnimationEvent, FocusEvent, HashChangeEvent, KeyboardEvent, MouseEvent, Selection, TouchEvent,
Expand Down Expand Up @@ -332,8 +331,8 @@ impl InputEvent {

/// create a native web event, with composed set to true
pub fn create_web_event_composed() -> web_sys::Event {
let mut event_init = web_sys::EventInit::new();
event_init.composed(true);
let event_init = web_sys::EventInit::new();
event_init.set_composed(true);
web_sys::Event::new_with_event_init_dict("input", &event_init).expect("event init")
}
}
Expand Down Expand Up @@ -366,7 +365,6 @@ fn to_open(event: Event) -> bool {
/// Note: paste event happens before the data is inserted into the target element
/// therefore trying to access the data on the target element triggered from paste will get an
/// empty text
#[cfg(web_sys_unstable_apis)]
fn to_clipboard_event(event: Event) -> ClipboardEvent {
event
.as_web()
Expand Down Expand Up @@ -416,9 +414,7 @@ declare_html_events! {
on_submit => submit => to_webevent => web_sys::Event;
on_input => input => to_input_event => InputEvent;
on_checked => input => to_checked => bool;
#[cfg(web_sys_unstable_apis)]
on_paste => paste => to_clipboard_event => ClipboardEvent;
#[cfg(web_sys_unstable_apis)]
on_copy => copy => to_clipboard_event => ClipboardEvent;
on_change => change => to_input_event => InputEvent;
on_broadcast => broadcast => to_input_event => InputEvent;
Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/dom/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ pub fn now() -> f64 {

/// scroll the browser to the top of the document
pub fn scroll_window_to_top() {
let mut options = ScrollToOptions::new();
options.top(0.0);
options.left(0.0);
let options = ScrollToOptions::new();
options.set_top(0.0);
options.set_left(0.0);
window().scroll_to_with_scroll_to_options(&options);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/html-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sauron-html-parser"
version = "0.61.8"
version = "0.61.9"
edition = "2021"
authors = [ "Jovansonlee Cesar <[email protected]>" ]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion crates/macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sauron-macro"
version = "0.61.8"
version = "0.61.9"
authors = ["John-John Tedro <[email protected]>", "Jovansonlee Cesar <[email protected]>"]
license = "MIT"
description = "An html library for building client side webapps"
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ test-with-dom:


wasm-test:
wasm-pack test --firefox --headless
RUSTFLAGS=--cfg=web_sys_unstable_apis wasm-pack test --firefox --headless

wasm-test-with-features:
wasm-pack test --firefox --headless -- --no-default-features --features "with-dom with-node-macro custom_element"
RUSTFLAGS=--cfg=web_sys_unstable_apis wasm-pack test --firefox --headless -- --no-default-features --features "with-dom with-node-macro custom_element"


test-all: test wasm-test
Expand Down
1 change: 0 additions & 1 deletion tests/dom_create_element_tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::{html::attributes::replace, *};
use std::{cell::Cell, rc::Rc};
use test_fixtures::simple_program;
Expand Down
1 change: 0 additions & 1 deletion tests/dom_fragment_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::*;
use test_fixtures::simple_program;
use wasm_bindgen_test::*;
Expand Down
1 change: 0 additions & 1 deletion tests/dom_insert_before_after_patches.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::{
html::{attributes::*, *},
*,
Expand Down
1 change: 0 additions & 1 deletion tests/dom_insert_patches.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::{
html::{attributes::*, *},
*,
Expand Down
1 change: 0 additions & 1 deletion tests/dom_keyed_subsequent_updates.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::{
html::{attributes::*, *},
*,
Expand Down
1 change: 0 additions & 1 deletion tests/dom_node_event_recycling.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::{html::attributes::*, html::events::*, html::*};
use sauron::{vdom::TreePath, *};
use std::{cell::RefCell, rc::Rc};
Expand Down
1 change: 0 additions & 1 deletion tests/dom_passing_reordered_keyed_node.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::*;
use test_fixtures::simple_program;
use wasm_bindgen_test::*;
Expand Down
1 change: 0 additions & 1 deletion tests/dom_patches_keyed.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::{
html::{attributes::*, *},
*,
Expand Down
1 change: 0 additions & 1 deletion tests/dom_patches_text_node.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::{html::attributes::*, html::*, *};

use test_fixtures::simple_program;
Expand Down
1 change: 0 additions & 1 deletion tests/dom_remove_node_patches.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::*;

use test_fixtures::simple_program;
Expand Down
1 change: 0 additions & 1 deletion tests/dom_reordered_keyed_nodes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::*;
use test_fixtures::simple_program;
use wasm_bindgen_test::*;
Expand Down
1 change: 0 additions & 1 deletion tests/dom_replace_node_patches.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::{
html::{attributes::*, *},
*,
Expand Down
1 change: 0 additions & 1 deletion tests/dom_safe_html.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(unused)]
use sauron::dom::DomNode;
use sauron::parse_html;
use sauron::*;
Expand Down
1 change: 0 additions & 1 deletion tests/dom_swap_nodes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::{
html::{attributes::*, *},
*,
Expand Down
1 change: 0 additions & 1 deletion tests/dom_test_update.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::html::*;
use sauron::*;

Expand Down
1 change: 0 additions & 1 deletion tests/dom_updater_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::prelude::*;
use std::{cell::RefCell, rc::Rc};
use test_fixtures::simple_program;
Expand Down
1 change: 0 additions & 1 deletion tests/dom_updates_target_dom.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::html::*;
use sauron::*;

Expand Down
1 change: 0 additions & 1 deletion tests/dom_util_functions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
use sauron::dom::delay;
use wasm_bindgen_test::*;

Expand Down
1 change: 0 additions & 1 deletion tests/test_fixtures.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
//! This is useful only for testing
//! This is a simple component which just barely comply to being a component
//! use for doing component tests
Expand Down

0 comments on commit 8ec2fe5

Please sign in to comment.