-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tutorial #1968
Add tutorial #1968
Conversation
Visit the preview URL for this PR (updated for commit 5982ca1): https://yew-rs--pr1968-tutorial-d0mqk3dk.web.app (expires Sat, 14 Aug 2021 17:36:46 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a few suggestions here and there. Looks good overall!
|
||
In a real world application, data will basically never be hardcoded but instead will come from an API. Let's fetch our | ||
videos list from external source. For this we will need to add the following crates: | ||
- [`reqwasm`](https://crates.io/crates/reqwasm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Side note: nothing against reqwasm
but it would certainly be nice if we could suggest using a more "official" library. Since you are also a maintainer for gloo
, maybe something like reqwasm
could be ported over?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to but I'm holding off because I can't publish gloo. I don't have permissions on crates.io
Co-authored-by: Luke Chu <[email protected]>
Hi @hamza1311. Thank you for the wonderful tutorial. I submitted a PR to your branch with some fixes and edits I made while following it here: ranile#1 The CORS fix using |
Thanks for that. Can you please submit that as a PR review instead? It's a lot easier discuss it/pick only certain parts of it that way.
That's because that resource doesn't yet exist. It will once the PR gets merged |
website/src/pages/tutorial.md
Outdated
[here](/next/concepts/function-components/pre-defined-hooks#use_state) | ||
|
||
:::note | ||
Struct components act differently. See the documentation to learn about those. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Struct components act differently. See the documentation on [Components](https://yew.rs/concepts/components?) to learn about those.
Done.
I would also expect a 404 error in that case. However I get:
If I try requesting an image file that does exist such as https://yew.rs/img/logo.png I get the same error. |
@fultonm, I've made the changes, feel free to take a look again. FYI, there's a suggestion button when you add a review comment provides UI for suggestion and makes incorporating them much easier. |
Looks good to me! Ignore my comments about about CORS, I was still specifying the full path to And thanks for the suggestion UI tip I see how that works now. |
``` | ||
|
||
:::note | ||
We're using `unwrap`s here because it is a demo application. In a real world, In a real world, you want to have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using `unwrap`s here because it is a demo application. In a real world, In a real world, you want to have | |
We're using `unwrap`s here because this is a demo application. In a real world app, you should use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's too late to comment here, I guess. If you think this change should be incorporated, you should make new PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh lol true 😄 I was just skimming it over and noticed noticed the typo. I completely forgot that it was already merged.
Sorry about that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also just noticed the typo. It would be great if you could fix it in a PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done #1990
Description
Fixes #1384
Very inspired by Kotlin React hands-on guide.
This tutorial is based on function components/hooks. I don't know if it's worth using struct components (after #1961), function components will be part of up-coming release anyway.
Checklist
cargo make pr-flow
IssueHunt Summary
Referenced issues
This pull request has been submitted to: