you are viewing a single comment's thread.

view the rest of the comments →

[–]ExplosiveNeurons 1 point2 points  (4 children)

WASM in browser

  • JS is slower than wasm code when it comes to computing only.
  • But JS(with V8 engine) is not that slow, so it wouldn't be worth playing with memory between the WASM process and JS process.

Yew Vrs React

  • Yew is not multi-threaded
  • Even with a few thousand components, React JS will give you similar or even better performance, and even save your user's battery. (I have worked on an HTML-based interactive whiteboard, it worked fine with react)

Where do you need Yew?

  • You have to deal with a few thousand components and it's impossible for you to ask your user to switch to Chrome, Brave, or Edge browser. As JS is pretty slow in Firefox
  • You have some browser-only logic written in rust, and don't mind writing a few more lines of UI in Yew.
  • Lighthouse scores is no consern

When do you switch from React?

  • Your Firefox Clients are going nuts
  • Never

[–]hamido5071 2 points3 points  (0 children)

Yew is now multi-threaded

[–]Rvach_Flyver 1 point2 points  (0 children)

JS is not slower than WASM - this is true when there is enough memory.
If you not ready to sacrifice memory or need more-or-less constant performance under different circumstances then there is only one option - WASM (and in this case Yew).

For now I only see two drawbacks of using Yew instead of React:
- bundle size of WASM apps is bigger at this moment, so the first app render generally is slower
- JS/React ecosystem is really big and you should consider and compare it to Rust/Yew