Code Monkey home page Code Monkey logo

yew-tutorial's Introduction

YEW Megatutorial

Yes, I'm humbling joining the fight to widespread Rust, with a tutorial on Yew.

You can see the parts of this series here, accessible trhough the Wiki:

Installation

This tutorial pre-se does require at least some Rust knowledge. However, I hope it would be profitable also for the beginners. I myself am still learning the language, yet in order to enjoy the full potential of Rust as applied to WASM technology one does not need to know all the intricacies of the type system. A sufficient Rust knowledge is gained after few weeks of acquaintance with this language, thus I think that once the basics are learned, this guide can be very profitable also to the novices.

Of course, Rust itself must be installed. Next, we need to install wasm-pack. NOTE: I made this tutorial in a highly opinonated manner, not "just because", but just because the novices would not get lost around the many choices available.

cargo install wasm-pack

After this we'll need a JS bundler, and we'll use rollup.

npm install --global rollup

After these you are good to go with the tutorial part 1.

yew-tutorial's People

Contributors

davidedelpapa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

yew-tutorial's Issues

Outdated code in tut 5

Hey dude! Great tutorial, thanks!

Just wanted to let you know that in stage 5, you have this code:

impl HostipService {
    pub fn new() -> Self {
        Self {
            fetchserv: FetchService::new(),
        }
    }

But there's no option to do this, I assume since yew got quite a lot of updates since your tutorial. Now instead of creating the service all you need to do is use FetchService and call the fetch function.

use yew::services::fetch::{FetchService, ....};

FetchService::fetch(request, handler.into()).unwrap()

My env info:

❯ cargo version
cargo 1.45.1 (f242df6ed 2020-07-22)
❯ rustc --version
rustc 1.45.2 (d3fb005a3 2020-07-31)

and in Cargo.toml:

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
yew = "0.17"

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.