Giter VIP home page Giter VIP logo

Comments (10)

sepiropht avatar sepiropht commented on May 14, 2024 1

Thanks! I hope that it's enought

from percy.

sepiropht avatar sepiropht commented on May 14, 2024 1

Yes! It 's working !

from percy.

sepiropht avatar sepiropht commented on May 14, 2024

Can i take it ?

from percy.

chinedufn avatar chinedufn commented on May 14, 2024

Absolutely!

Are the above details enough?

If not I'd be more than happy to go into more detail or answer any questions that you might have!

from percy.

sepiropht avatar sepiropht commented on May 14, 2024

The docs is still update ? I have the last version of the repo but tests fails when i run ./test.sh

from percy.

chinedufn avatar chinedufn commented on May 14, 2024

Tests are currently failing for a couple of cases due to some recent changes - I'll get that fixed

In the meantime you can use cargo test -p html-macro-test to verify that the html macro still works as expected.

Let me know if you have any issues there!

from percy.

sepiropht avatar sepiropht commented on May 14, 2024

i added a test like this, and strangely it hasn't failed

fn closure_with_no_parmas() {
    HtmlMacroTest {
        desc: "No parameter defined for the closure",
        generated: html! {
            <div onclick=||{}></div>
        },
        expected: html! {<div></div>},
    }
    .test();
}

I'm missing something ?

from percy.

chinedufn avatar chinedufn commented on May 14, 2024

Ah sorry I misled you!!!

In non wasm32 targets the html macro completely ignores closures.

#[cfg(target_arch = "wasm32")]
{
let closure = wasm_bindgen::prelude::Closure::wrap(
Box::new(#value) as Box<FnMut(_)>
);
let closure_rc = std::rc::Rc::new(closure);
#var_name_node.as_velement_mut().expect("Not an element")
.events.0.insert(#key.to_string(), closure_rc);
}


So we need to test this using our in browser tests

If you branch off of the latest master you'll see that I moved your test to closures.rs here -> 404dd70

Very sorry for that! Let me know if there are any other stumbling blocks

from percy.

sepiropht avatar sepiropht commented on May 14, 2024

I want to run closure' s tests but this command does'nt work wasm-pack test crates/virtual-dom-rs --chrome --headless -- --test closures

from percy.

chinedufn avatar chinedufn commented on May 14, 2024

Ahhh I'm using functionality that hasn't been released by wasm-pack yet.

Could you try

cargo install -f --git https://github.com/rustwasm/wasm-pack ?

Then you should be able to run the tests

from percy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.