Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Boscop
    @Boscop
    @koute is there no Element.scrollIntoView() in stdweb?
    Kelly Thomas Kline
    @kellytk
    I'm observing broken behavior in Yew where state I change is reflected in the view, but not in a text input. Where would I start to debug that? I'm asking in here in addition to the Yew channel because I'm not sure which code would be responsible
    My assumption is it's a diff algo flaw because if the input's value was simply set to the self.foo it would show the correct value, as { self.foo } does elsewhere in the html! macro
    Kelly Thomas Kline
    @kellytk
    I've created a simple demo and filed an issue DenisKolodin/yew#449
    madmaxio
    @madmaxio
    @koute Have you heard if the author will continue work on Yew?
    madmaxio
    @madmaxio
    @Boscop Btw how to pass opt-level="s" to cargo web?
    madmaxio
    @madmaxio
    Ah, it's Web.toml
    crocwolf
    @crocwolf
    Hello, where is a doc for rust stdweb ? How could I generate easily a div from html source code. Ex: a_function("<div><p>hello world</p></div>")
    Alexander Irbis
    @alexander-irbis
    Kelly Thomas Kline
    @kellytk
    How can I, using Yew FWIW, identify if an onpointerup event originated on a child element or the element the handler is attached to?
    Kelly Thomas Kline
    @kellytk
    PointerUpEvent doesn't seem to have a target method available to it
    Kelly Thomas Kline
    @kellytk
    @koute ^
    David Ross
    @daboross
    anyone know if wasm32-unknown-unknown has support for global/static constructor functions?
    looking to either port https://github.com/mmastrac/rust-ctor to wasm or find something equivalent
    David Ross
    @daboross
    (opened koute/stdweb#321 for this)
    Joseph Catrambone
    @JosephCatrambone
    A quick question that I can't find on Google. I think document.query_selector().unwrap().unwrap() leaves me with an Element, but I'm trying to get an InputElement instead and TryInto doesn't seem to be behaving.
    the trait std::convert::From<stdweb::web::Element> is not implemented for stdweb::web::html_element::InputElement
    Which doesn't look like it would be the case.
    Joseph Catrambone
    @JosephCatrambone
    Oh buggery. I imported std::convert::TryInto instead of stdweb::unstable::TryInto.
    Koute
    @koute
    @JosephCatrambone Yep. The TryInto from stdweb is a different one than the recently stabilized TryInto from the standard library. I will be unifying those two types in the future so that stdweb will use the TryInto from std.
    Giacomo Cariello
    @giacomocariello
    Hi all
    Redrield
    @Redrield
    I'm having some trouble, I'm trying to get a ws client with stdweb's WebSocket to connect to a server using the websocket crate, I'm wiresharking the connection and the initial GET is sent, the Upgrade is accepted and at that point the client should be sending the first packet for this protocol, but I'm not seeing that
    I have console!() sprinkled all around this, and there's one right before where WebSocket.send_bytes is called, and that gets printed
    But the packet doesn't seem to be sent
    I'm also getting some strange errors in the console that I don't know how to diagnose https://0x0.st/zuiB.png
    Jim Hessin
    @jhessin

    Hello, newbie question here, but I'm trying to build a standard Hello World! app using stdweb without any js! wrappers. I can't seem to figure out how to add a child node to the body element though. It keeps saying that

    no method named `append_child` found for type `stdweb::web::HtmlEleme
        nt` in the current scope

    This seems pretty basic. Do I need to convert it somehow?

    This is my simple example:
    extern crate stdweb;
    
    fn main() {
        let message = "Hello, WASM!";
       let message_node = stdweb::web::document().create_text_node(message);
        stdweb::web::document().body().unwrap().append_child(message_node);                                   
    }
    I know I will eventually refactor to some form of 'use' statements, but I would like to get it working first.
    Kelly Thomas Kline
    @kellytk
    Is something specific blocking IndexedDB 2.0 support?
    Kelly Thomas Kline
    @kellytk
    @koute ^
    Boscop
    @Boscop

    I want to continue an old project that uses stdweb, my last commit was in december. but now I'm getting:

    error[E0433]: failed to resolve: use of undeclared type or module `wasm_bindgen`
        |
    120 |           let handle = js! {
        |  ______________________^
    121 | |             var success_cb = @{success_cb};
    122 | |             var error_cb = @{error_cb};
    123 | |             var options = @{options.unwrap_or_default()};
    ...   |
    137 | |             };
    138 | |         };
        | |_________^ use of undeclared type or module `wasm_bindgen`
        |
        = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

    why?

    Boscop
    @Boscop
    does stdweb require crates that use it to also depend on wasm-bindgen now?
    Kumar Ankur
    @krankur
    is there a way to get sibling elements and parent element?
    Kelly Thomas Kline
    @kellytk
    I've opened koute/cargo-web#204
    Kelly Thomas Kline
    @kellytk
    cargo web was capable of generating a single .js file for an html file to link the generated .wasm file in with, however wasm-pack cannot. The closest it can get is generating a .js file that uses dozens of 'snippets' .js files and a separate bundling tool is required to generate an amalgamated file. Could that code be donated to wasm-pack by cargo web?
    Thomas Gideon
    @cmdln
    Hello--is it possible to set window.location via std::web::Window? The docs seem to suggest that it is but unclear how.
    Thomas Gideon
    @cmdln
    And I figured out a way to do it with the js! macro.
    Boscop
    @Boscop
    i want to revive my old project that uses yew/stdweb but I also want to use console_error_panic_hook and that seems to require wasm-bindgen, but how to make wasm-bindgen work with yew/stdweb nowadays?
    Alexander Irbis
    @alexander-irbis
    @Boscop add this into Cargo.toml
    [target.'cfg(all(target_arch = "wasm32", not(cargo_web)))'.dependencies]
    wasm-bindgen = "=0.2.42"
    Huh, sorry, this was an old question :-)
    John W.
    @TrustTheRust
    Does STDWeb have a way to force reload of page from new files from server? like document.location.reload(true) ?
    Thomas Versteeg
    @tversteeg
    Hi all, I've recently opened #376 and #377 but as @Pauan commented on my PR this won't allow me to actually change the buffer of the image.
    I'm not sure if this is the correct approach for me though: I'm trying to create a WASM target for emoon/rust_minifb#92 using stdweb. So basically what I want from stdweb is to find the most efficient way to render a Rust array of colors (u32) to a HTML5 Canvas. Any suggestions on how to achieve this?
    Mathieu CAROFF
    @mathieucaroff
    Hello there. I was discussing "using stdweb in production", and came across the question of the size of the library. Anybody asked themselves that question before? Do we have an answer?
    Charles Johnson
    @Charles-Johnson
    Hi, I have just started using stdweb to use my existing Rust crate on the web. Do I need to configure the crate somehow to call imported functions within the js! macro? When I try this I get an console error Error loading Rust wasm module 'ziaweb': RuntimeError: "unreachable executed"
    madmaxio
    @madmaxio
    @Charles-Johnson Do you use cargo web tool?
    shelvacu
    @shelvacu
    I was looking at webcore/global_arena.rs, and it seems odd to construct a Vec from_raw_parts and then use mem::forget, which I didn't even know about until today. Shouldn't it just interface directly with the allocator at that point, or make GlobalArena a wrapper around a Vec?
    shelvacu
    @shelvacu
    Similar why-is-it-this-way quesiton: Why does JsSerializationOwned take in a &mut Option? It seems like every implementation just calls .unwrap()
    Loke Gustafsson
    @lokegustafsson
    Hi! I am trying to benchmark some code snippets with the js! macro. So this is running in the stdweb web server. I am using std::time::Instant, which is giving me RuntimeError: unreachable. What time API can I use in WASM?
    I use cargo web start