Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Alexander Irbis
    @alexander-irbis
    Currently, with the last yew in my project, it looks like
    [target.'cfg(all(target_arch = "wasm32", not(target_os="wasi"), not(cargo_web)))'.dependencies]
    wasm-bindgen = "=0.2.56"
    
    [target.'cfg(all(target_arch = "wasm32", not(target_os="wasi"), not(cargo_web)))'.dev-dependencies]
    wasm-bindgen = "=0.2.56"
    I'm just copying this from yew itself.
    Alexander Irbis
    @alexander-irbis
    @Boscop Sorry, I directed you on the wrong path. cargo-web don't need these dependencies. I found that I was checking the build of my project without cargo-web.
    Nicolas
    @nico-abram

    Hello!
    I just got back to a cargo-web+stdweb+quicksilver project after a couple months, it seems cargo web no longer works in virtual workspaces, and when I tried running it in the specific folder for a project I got a bunch of errors about a missing wasm_bindgen. Is this documented anywhere? Apologies if I'm asking an obvious question

    To clarify, this is what I got from building for the wasm unk unk target (https://i.imgur.com/MhwxMSN.png) and this is what cargo web gave me (https://i.imgur.com/HAI4dQm.png)

    Nicolas
    @nico-abram
    Well, I patched cargo-web to display the dep in the panic message, it turns out it's a dependency from another binary crate in the workspace. Is there anything about cargo-web contributing guidelines I should know before I open a PR with a trivial change? (Could not find a contributing guidelines file or a gitter for it)
    Boscop
    @Boscop
    @alexander-irbis are you saying console_error_panic_hook doesn't work with cargo-web? but i want to log panics in a readable way..
    btw, whenever i switch between cargo check in my editor to cargo web deploy in cmd.exe, cargo rebuilds stdweb-internal-runtime, stdweb and yew-router. probably because of this? https://github.com/koute/stdweb/blob/master/stdweb-internal-runtime/build.rs#L62
    @koute could you exclude cargo check from rebuilding stdweb-internal-runtime to reduce compilation time? :)
    Kalabuk Dmitriy
    @kalabukdima_gitlab
    Hi! What is the preferred way to execute js code obtained in runtime (i.e. stored in a string) using stdweb? Should I just call the eval function?
    madmaxio
    @madmaxio
    @kalabukdima_gitlab There is js! macro
    Kalabuk Dmitriy
    @kalabukdima_gitlab
    @madmaxio Could you please clarify, how can I use js! macro with code which is not given at compile time? An example code snippet would be great.
    madmaxio
    @madmaxio
    @kalabukdima_gitlab Perhaps eval inside js! macro
    Kalabuk Dmitriy
    @kalabukdima_gitlab
    @madmaxio Yeah, I ended up with something like that. Additionally put it inside a sandbox as described in this post: https://blog.risingstack.com/writing-a-javascript-framework-sandboxed-code-evaluation/
    madmaxio
    @madmaxio
    @kalabukdima_gitlab Nice, also check Yew project and wasm-pack/wasm-bindgen if you didn't.
    1init
    @1init
    Hay guys i have a simple question... Lets say i make a svelte front end.. can i simply call the js and html file after building it into stdweb?
    madmaxio
    @madmaxio
    @1init You can use js! macro
    1init
    @1init
    Thanks but my app is svelete can I just refence the file
    madmaxio
    @madmaxio
    I'm not in context of that framework, well, perhaps you need to share some code.
    Jacob Pratt
    @jhpratt
    @koute Any opposition to switching to the rustversion crate? It would allow the aliasing of the TryFrom and TryInto traits, among other things. I can also upgrade to Rust 2018 if you'd like; the MSRV of 1.32 is already high enough (2018 was 1.31).
    Ben Lichtman
    @Ben-Lichtman
    hi guys, I am trying to convert an html String into a Yew Html, to do this I am using VNode::VRef(node)
    however I have a switch in my rendering, the first branch renders the VNode, the second doesnt render this VNode
    as soon as I take the second switch case after the first I get a panic
    Panic error message: can't remove node by VRef: NotFoundError(Reference(125))
    Panic location: /Users/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/yew-0.11.0/src/virtual_dom/vnode.rs:35
    anyone know what's going on here?
    here is my code:
    Nicholas Alexeev
    @scifi6546

    say I have an exported function: ```

    [cfg(target_arch = "wasm32")]

    [js_export]

    pub fn start(rom: Vec<u8>,dom_ids: JAVASCRIPT_OBJECT) {
    //do start stuff
    }
    ```

    how do I write a rust struct that can be read from javascript?
    sorry markdown is being wierd for some reason
    Justin Starry
    @jstarry
    @Ben-Lichtman that's a Yew bug: yewstack/yew#963
    @scifi6546 you can use ```rust to format your code
    Nicholas Alexeev
    @scifi6546
    oh ok thanks. Was not sure where to look
    alvinhochun
    @alvinhochun
    Hi, what's the current state of stdweb? I noticed that there hasn't been much activity from @koute for a few months.
    Justin Starry
    @jstarry
    🤷‍♂️
    Boscop
    @Boscop
    is there a function like elem.scroll_into_view()?
    nitsuga5124
    @nitsuga5124_gitlab
    how would i be able to run an asynchronous function ? I'm trying to make an http get request, I'm currently using reqwest where i had issues running it in blocking, asked on a community discord server and Globi told me that blocking is not available for wasm targets and to just expose an async function and get a Promise from js, but idk how to do this with stdweb. Also tried tokio, but that didn't compile at all.
    Newbyte
    @Newbytee
    Is this still maintained?
    madmaxio
    @madmaxio
    At the moment no
    Newbyte
    @Newbytee
    I notice Koute hasn't contributed anything to GitHub for a good while. Are they still around, i.e., if someone were to be interested in picking up maintenance, would they have any way to have it uploaded to crates.io as a new release under the same name?
    madmaxio
    @madmaxio
    I think there are some people out there who can.
    Wojciech Niedźwiedź
    @Niedzwiedzw
    what happened to the guy though?
    madmaxio
    @madmaxio
    Well perhaps support of this project ended
    Wojciech Niedźwiedź
    @Niedzwiedzw
    but there's zero activity on his account...
    madmaxio
    @madmaxio
    That's what I mean.
    Elias Gabriel Amaral da Silva
    @dlight
    Hello, does stdweb have any support for printing panics to console? Also, printing println! to console (I see that stdweb::console! recommends println! but it doesn't work)
    madmaxio
    @madmaxio
    Better check wasm-bindgen for now, stdweb is not maintained.
    But I think panics will be printed. What works is console logging.
    Elias Gabriel Amaral da Silva
    @dlight

    yes, just noted that stdweb isn't maintained =/

    but cargo web won't work with wasm-bindgen and web-sys right

    madmaxio
    @madmaxio
    You can use wasm-pack for building, for hosting you need just local http server for pkg directory, check https://yew.rs/