Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/concepts/services/fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub type Binary = Result<Vec<u8>, Error>;
Here is what a typical GET request will look like:
```rust
use yew::format::Nothing;
use yew_services::fetch::Request;
use yew::services::fetch::Request;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are wrong, since the layout was recently changed and the services are in a separate crate now: https://github.com/yewstack/yew/tree/master/packages/yew-services
Please note that you're editing the documentation for the 'master' branch which contains changes that haven't been published yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely missed that.
Shall I remove the yew_services changes and still add the wording changes here in master?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think the wording changes are great!

let get_request = Request::get("https://example.com/api/v1/get/something")
.body(Nothing)
.expect("Could not build that request");
Expand All @@ -36,7 +36,7 @@ Here is what a typical POST request will look like:
```rust
use serde_json::json;
use yew::format::Json;
use yew_services::fetch::Request;
use yew::services::fetch::Request;
let post_request = Request::post("https://example.com/api/v1/post/something")
.header("Content-Type", "application/json")
.body(Json(&json!({"key": "value"})))
Expand Down Expand Up @@ -95,7 +95,7 @@ An illustrated example of how to fetch data from an API giving information about

use serde::Deserialize;
use yew::{format::{Json, Nothing}, prelude::*};
use yew_services::fetch::{FetchService, FetchTask, Request, Response};
use yew::services::fetch::{FetchService, FetchTask, Request, Response};

#[derive(Deserialize, Debug, Clone)]
pub struct ISSPosition {
Expand Down Expand Up @@ -238,6 +238,6 @@ The Rust Wasm Book also contains [useful debugging tips](https://rustwasm.github
for Wasm applications.

## Further reading
* [The API documentation](https://docs.rs/yew-services/latest/yew_services/fetch/index.html)
* [The API documentation](https://docs.rs/yew/latest/yew/services/fetch/index.html)
* The [dashboard](https://github.com/yewstack/yew/tree/master/examples/dashboard) example.
* [The Rust Wasm Book on debugging Wasm applications](https://rustwasm.github.io/book/reference/debugging.html)
12 changes: 6 additions & 6 deletions docs/more/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ title: Debugging
## Panics

The [`console_error_panic`](https://github.com/rustwasm/console_error_panic_hook) crate catches
`panic!`s and outputs them to the console. Yew will automatically catch `panic!`s and log them to
your browser's console.
`panic!`s and outputs them to the console. Yew automatically catches `panic!`s and logs them to
the browser's console.

## Console Logging

In general, Wasm web apps are able to interact with Browser APIs, and the `console.log` API is no
Wasm web apps can call Browser APIs. The `console.log` API is no
exception. There are a few options available:

### [`wasm-logger`](https://crates.io/crates/wasm-logger)
Expand All @@ -27,9 +27,9 @@ fn main() {
log::info!("Update: {:?}", msg);
```

### [`ConsoleService`](https://docs.rs/yew-services/latest/yew_services/struct.ConsoleService.html)
### [`ConsoleService`](https://docs.rs/yew/latest/yew/services/console/struct.ConsoleService.html)

This service is included within the [`yew-services`](https://crates.io/crates/yew-services) crate:
This service is included with Yew.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible improvement?

Suggested change
This service is included with Yew.
This service is defined inside the `yew` crate.


```rust
// usage
Expand All @@ -38,7 +38,7 @@ ConsoleService::info(format!("Update: {:?}", msg));

## Source Maps

There is currently no first-class support for source maps for Rust / Wasm web apps. This, of course, is subject to change. If this is no longer true or if progress is made, please suggest a change!
There is currently no first-class support for source maps for Rust/Wasm web apps. This could change in the future.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe?

Suggested change
There is currently no first-class support for source maps for Rust/Wasm web apps. This could change in the future.
Sadly Rust/Wasm web apps are not properly supported by browsers. Hopefully this will change in the future.


### Latest Info

Expand Down