Questions tagged [yew]

Rust/Wasm framework for creating web applications

Yew takes inspiration from React and Redux. It uses Web Assembly and webworkers to create multi-threaded frontend apps.

The repository lives at https://github.com/yewstack/yew.

17 questions
4
votes
1 answer

Is there a way to get system time/date inside of a yew app?

Normally in a rust app, I'd get system time with std::time::SystemTime::now(), but that doesn't seem to work in a yew app. Instead the component I'm trying to read the system time from just silently (from the server logs) fails and in the web…
2
votes
1 answer

How to serve multiple HTML pages using Wasm with Rust?

I am trying to build a web application running wasm on the client side, and I am wondering what would be a good way of serving multiple pages. My main concern is performance, because I would like to split the application up into contextual chunks…
stimulate
  • 1,059
  • 6
  • 23
2
votes
1 answer

Rust ffi + wasm (yew -> cargo web start) -> fatal error: 'math.h' file not found

I'm currently developing an application using C and Rust, where I don't have any problems when it's used in either of the following ways: C -> Rust -> C (swift) C -> Rust -> examples (console Rust) but it's getting complicated when I want to…
Stéphane
  • 109
  • 1
  • 9
2
votes
1 answer

How to implement a Stateful App Navigation using Rust and the Yew Crate?

I'm trying to build an app with navigation tabs and trying to use the best way to give state to the entire app. Currently the tabs are functional, but I am struggling to implement a way to both map and restore tab navigation via state in rust using…
1
vote
0 answers

How do I mount multiple wasm components to a page?

I have a flask project I am working on. I would like to be able to start replacing some components with wasm. I was able to get the yew component to mount to a specific
, But I'd like to be able to do that, as well as leverage some of the GUI…
krflol
  • 835
  • 5
  • 11
1
vote
0 answers

how to create a grid and cells in Yew app ( using Rust programs)

Yew app. I am trying to build a grid and inside grid I would like to arrange cells in Yew app. I would like to have My grid a 4*4 array Cells size would be 5px width and height I also need to set the Cell color property based on the method I solve…
Naveen
  • 29
  • 4
1
vote
1 answer

Uncaught Error with Webassembly using Yew Framwork

I'm using Yew to program a theme switcher that by clicking cycles through different themes. This is my update function. It gets the current theme which is stored in shared state, depending on what would come next inside theme_cycle the theme value…
1
vote
1 answer

WASM/Yew - failed to resolve: could not find `unix` in `os`

Building Yew App on Windows I'm building a yew app alongside a rocket backend on Windows following this tutorial (although the tutorial is for a Linux environment). I'm trying to build the yew app using wasm-pack. I'm not using the Linux subsystem…
1
vote
2 answers

Yew error – only one root html element allowed

I have encountered a problem with the Yew library's component mechanism. If I include any other html code in the macro for the main model's html macro, the compiler complains that "only one root html element allowed". My structure is as…
0
votes
0 answers

how to use yew-router with rocket.rs?

I am using yew with rocker.rs with my AppRouter looking like this pub struct AppRouter{} #[derive(Switch, Debug, Clone)] enum AppRoute{ #[to = "/images"] Images, #[to = "/"] Index, } And for my rocket-server : fn…
0
votes
1 answer

How to make JAWS screen reader acknowledge dynamic content updates

Recently, I've been investigating Web Assembly (WASM), Rust and Yew. To reproduce my problem, I've added the code of my project below. There's nothing wrong with the code per se, so you can skip it if you don't want to reproduce the setup…
TimB
  • 843
  • 5
  • 15
0
votes
1 answer

yew app - rustwasm error Uncaught RangeError: Maximum call stack size exceeded

I was trying to solve sudoku as Yew app. Using yew="0.17.4" version. But getting below error Uncaught RangeError: Maximum call stack size exceeded at dlmalloc::dlmalloc::Dlmalloc::malloc::hb6b25cc27fa2f08c…
Naveen
  • 29
  • 4
0
votes
1 answer

how to include a sleep function in Yew app?

I am trying to build small application with Yew (Rustwasm) . I would like to put sleep function in Yew app.when I use use std::thread::sleep , I am getting below error I am using sleep as below let mut index = 0; sleep(Duration::new(1, 0)); if col <…
Naveen
  • 29
  • 4
0
votes
1 answer

Where is the classes! macro in Yew

I am using Yew for one of my experiment project. What is module to import for the classes! macro? html! {
Naveen
  • 29
  • 4
0
votes
1 answer

Yew callback for different Json structs

I am using yew with the WebsocketService and sending jsonrpcs to a backend and receive the according answers. I have a problem to distinguish between valid and error jsonrpc answers. Within the model implementation, I create the callback via: let…
1
2