Skip to content

Commit 653ca85

Browse files
authored
docs(examples/core): readability improvements (#191)
Signed-off-by: Ryan Russell <[email protected]> Signed-off-by: Ryan Russell <[email protected]>
1 parent 4f301ab commit 653ca85

File tree

10 files changed

+14
-14
lines changed

10 files changed

+14
-14
lines changed

examples/core/basic/tests/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async fn main(c: &mut Client) -> Result<(), fantoccini::error::CmdError> {
1313
wait_for_checkpoint!("page_interactive", 0, c);
1414
let greeting = c.find(Locator::Css("p")).await?.text().await?;
1515
assert_eq!(greeting, "Hello World!");
16-
// For some reason, retrieving the inner HTML or text of a `<title>` doens't
16+
// For some reason, retrieving the inner HTML or text of a `<title>` doesn't
1717
// work
1818
let title = c.find(Locator::Css("title")).await?.html(false).await?;
1919
assert!(title.contains("Index Page"));

examples/core/idb_freezing/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# IndexedDB Freezing Example
22

3-
This example shows how Perseus can supprot freezing state to IndexedDB and retrieving it from there later, which is the mechanism of state freezing that many apps will use. This is also the basis of Perseus' HSR system.
3+
This example shows how Perseus can support freezing state to IndexedDB and retrieving it from there later, which is the mechanism of state freezing that many apps will use. This is also the basis of Perseus' HSR system.
44

55
Notably, this requires the `wasm-bindgen-futures` package and the `idb-freezing` feature enabled on the `perseus` package.

examples/core/js_interop/tests/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async fn main(c: &mut Client) -> Result<(), fantoccini::error::CmdError> {
1313
wait_for_checkpoint!("page_interactive", 0, c);
1414
let greeting = c.find(Locator::Css("p")).await?.text().await?;
1515
assert_eq!(greeting, "Hello World!");
16-
// For some reason, retrieving the inner HTML or text of a `<title>` doens't
16+
// For some reason, retrieving the inner HTML or text of a `<title>` doesn't
1717
// work
1818
let title = c.find(Locator::Css("title")).await?.html(false).await?;
1919
assert!(title.contains("Index Page"));

examples/core/plugins/tests/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async fn main(c: &mut Client) -> Result<(), fantoccini::error::CmdError> {
1515
wait_for_checkpoint!("page_interactive", 0, c);
1616
let greeting = c.find(Locator::Css("p")).await?.text().await?;
1717
assert_eq!(greeting, "Hello World!");
18-
// For some reason, retrieving the inner HTML or text of a `<title>` doens't
18+
// For some reason, retrieving the inner HTML or text of a `<title>` doesn't
1919
// work
2020
let title = c.find(Locator::Css("title")).await?.html(false).await?;
2121
assert!(title.contains("Index Page"));

examples/core/state_generation/src/templates/build_paths.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn get_template<G: Html>() -> Template<G> {
2929
}
3030

3131
// We'll take in the path here, which will consist of the template name
32-
// `build_paths` followed by the spcific path we're building for (as exported
32+
// `build_paths` followed by the specific path we're building for (as exported
3333
// from `get_build_paths`)
3434
#[perseus::build_state]
3535
pub async fn get_build_state(path: String, _locale: String) -> RenderFnResultWithCause<PageState> {

examples/core/state_generation/src/templates/incremental_generation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub fn get_template<G: Html>() -> Template<G> {
3737
}
3838

3939
// We'll take in the path here, which will consist of the template name
40-
// `incremental_generation` followed by the spcific path we're building for (as
40+
// `incremental_generation` followed by the specific path we're building for (as
4141
// exported from `get_build_paths`)
4242
#[perseus::build_state]
4343
pub async fn get_build_state(path: String, _locale: String) -> RenderFnResultWithCause<PageState> {

examples/core/state_generation/src/templates/revalidation.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ pub fn get_template<G: Html>() -> Template<G> {
1919
// This page will revalidate every five seconds (and so the time displayed will be updated)
2020
.revalidate_after("5s")
2121
// This is an alternative method of revalidation that uses logic, which will be executed
22-
// every itme a user tries to load this page. For that reason, this should NOT do
22+
// every time a user tries to load this page. For that reason, this should NOT do
2323
// long-running work, as requests will be delayed. If both this
24-
// and `revaldiate_after()` are provided, this logic will only run when `revalidate_after()`
24+
// and `revalidate_after()` are provided, this logic will only run when `revalidate_after()`
2525
// tells Perseus that it should revalidate.
2626
.should_revalidate_fn(should_revalidate)
2727
.build_state_fn(get_build_state)
@@ -45,6 +45,6 @@ pub async fn should_revalidate(
4545
_req: perseus::Request,
4646
) -> RenderFnResultWithCause<bool> {
4747
// For simplicity's sake, this will always say we should revalidate, but you
48-
// could amke this check any condition
48+
// could make this check any condition
4949
Ok(true)
5050
}

examples/core/state_generation/src/templates/revalidation_and_incremental_generation.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ pub fn get_template<G: Html>() -> Template<G> {
2626
// This page will revalidate every five seconds (and so the time displayed will be updated)
2727
.revalidate_after(Duration::new(5, 0))
2828
// This is an alternative method of revalidation that uses logic, which will be executed
29-
// every itme a user tries to load this page. For that reason, this should NOT do
29+
// every time a user tries to load this page. For that reason, this should NOT do
3030
// long-running work, as requests will be delayed. If both this
31-
// and `revaldiate_after()` are provided, this logic will only run when `revalidate_after()`
31+
// and `revalidate_after()` are provided, this logic will only run when `revalidate_after()`
3232
// tells Perseus that it should revalidate.
3333
.should_revalidate_fn(should_revalidate)
3434
.build_state_fn(get_build_state)
@@ -61,6 +61,6 @@ pub async fn should_revalidate(
6161
_req: perseus::Request,
6262
) -> RenderFnResultWithCause<bool> {
6363
// For simplicity's sake, this will always say we should revalidate, but you
64-
// could amke this check any condition
64+
// could make this check any condition
6565
Ok(true)
6666
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Static Content Example
22

3-
This example doesn't introduce any new code, it just shows how to host arbitrary static content with Perseus. By default, any content in the `static/` directory at the root of your project will be hosted at the URL `/.perseus/static/`, though you can also add aliases to content inside your project's root directory to be hsoted at any URL in your app. This example shows both methods, and you'll be able to find a file at `/test.txt` and at `/.perseus/static/style.css` (named so as to indicate that you would typically put stylesheets in the `static/` directory).
3+
This example doesn't introduce any new code, it just shows how to host arbitrary static content with Perseus. By default, any content in the `static/` directory at the root of your project will be hosted at the URL `/.perseus/static/`, though you can also add aliases to content inside your project's root directory to be hosted at any URL in your app. This example shows both methods, and you'll be able to find a file at `/test.txt` and at `/.perseus/static/style.css` (named so as to indicate that you would typically put stylesheets in the `static/` directory).

examples/core/unreactive/tests/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async fn main(c: &mut Client) -> Result<(), fantoccini::error::CmdError> {
1313
wait_for_checkpoint!("page_interactive", 0, c);
1414
let greeting = c.find(Locator::Css("p")).await?.text().await?;
1515
assert_eq!(greeting, "Hello World!");
16-
// For some reason, retrieving the inner HTML or text of a `<title>` doens't
16+
// For some reason, retrieving the inner HTML or text of a `<title>` doesn't
1717
// work
1818
let title = c.find(Locator::Css("title")).await?.html(false).await?;
1919
assert!(title.contains("Index Page"));

0 commit comments

Comments
 (0)