Skip to content
Draft
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
42 changes: 42 additions & 0 deletions .github/workflows/typo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Whenever an open PR is updated, the workflow will be triggered

name: Language Linting

on:
push:
branches:
- main

pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main

jobs:
typos:
if: github.event.pull_request.draft == false
name: Check for typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/typos@master

# Check for invalid links in the repository
link-check:
if: github.event.pull_request.draft == false
name: Check For Invalid Links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Run lychee
uses: lycheeverse/lychee-action@v2
with:
args: --base . --config ./lychee.toml './**/*.md'
fail: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
!.vscode/launch.json
!.vscode/extensions.json

.lycheecache

.idea

/pkg
Expand Down
10 changes: 10 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[default.extend-words]
# https://ratatui.rs/
ratatui = "ratatui"
# lits is short for literals
lits = "lits"
# https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/seeked_event
seeked = "seeked"

[files]
extend-exclude = ["translations/*", "CHANGELOG.md", "*.js"]
2 changes: 1 addition & 1 deletion docs-src/0.4/en/reference/use_future.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ The `UseFuture` handle provides a `restart` method. It can be used to execute th
Often, you will need to run the future again every time some value (e.g. a prop) changes. Rather than calling `restart` manually, you can provide a tuple of "dependencies" to the hook. It will automatically re-run the future when any of those dependencies change. Example:

```rust, no_run
{{#include src/doc_examples/untested_04/use_future.rs:dependancy}}
{{#include src/doc_examples/untested_04/use_future.rs:dependency}}
```
6 changes: 3 additions & 3 deletions docs-src/0.6/src/cookbook/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ webServer: [
],
```

- [Web example](https://github.com/DioxusLabs/dioxus/tree/main/playwright-tests/web)
- [Liveview example](https://github.com/DioxusLabs/dioxus/tree/main/playwright-tests/liveview)
- [Fullstack example](https://github.com/DioxusLabs/dioxus/tree/main/playwright-tests/fullstack)
- [Web example](https://github.com/DioxusLabs/dioxus/tree/main/packages/playwright-tests/web)
- [Liveview example](https://github.com/DioxusLabs/dioxus/tree/main/packages/playwright-tests/liveview)
- [Fullstack example](https://github.com/DioxusLabs/dioxus/tree/main/packages/playwright-tests/fullstack)
2 changes: 1 addition & 1 deletion docs-src/0.6/src/guides/fullstack/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Dioxus Fullstack contains helpers for:
This guide will teach you everything you need to know about how to use the utilities in Dioxus fullstack to create amazing fullstack applications.


> In addition to this guide, you can find more examples of full-stack apps and information about how to integrate with other frameworks and desktop renderers in the [dioxus-fullstack examples directory](https://github.com/DioxusLabs/dioxus/tree/main/packages/fullstack/examples).
> In addition to this guide, you can find more examples of full-stack apps and information about how to integrate with other frameworks and desktop renderers in the [dioxus example directory](https://github.com/DioxusLabs/dioxus/tree/main/examples).
2 changes: 1 addition & 1 deletion docs-src/0.6/src/guides/fullstack/server_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SandBoxFrame {

## Running the client with dioxus-desktop

The project presented so far makes a web browser interact with the server, but it is also possible to make a desktop program interact with the server in a similar fashion. (The full example code is available in the [Dioxus repo](https://github.com/DioxusLabs/dioxus/tree/main/packages/fullstack/examples/axum-desktop))
The project presented so far makes a web browser interact with the server, but it is also possible to make a desktop program interact with the server in a similar fashion. (The full example code is available in the [Dioxus repo](https://github.com/DioxusLabs/dioxus/tree/main/examples/fullstack-desktop))

First, we need to make two binary targets, one for the desktop program (the `client.rs` file), one for the server (the `server.rs` file). The client app and the server functions are written in a shared `lib.rs` file.

Expand Down
2 changes: 1 addition & 1 deletion docs-src/0.6/src/guides/web/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ If you are targeting web, but don't plan on targeting any other Dioxus renderer
## Customizing Index Template

Dioxus supports providing custom index.html templates. The index.html must include a `div` with the id `main` to be used. Hot Reload is still supported. An example
is provided in the [PWA-Example](https://github.com/DioxusLabs/dioxus/blob/main/examples/PWA-example/index.html).
is provided in the [PWA-Example](https://github.com/DioxusLabs/dioxus/blob/main/examples/pwa/index.html).
2 changes: 1 addition & 1 deletion docs-src/0.6/src/router/example/first-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ handle when a route doesn't exist. Next, we'll create the blog portion of our
site. We will utilize nested routes and URL parameters.

[`Router`]: https://docs.rs/dioxus-router/latest/dioxus_router/components/fn.Router.html
[`Routable`]: https://docs.rs/dioxus-router/latest/dioxus_router/components/fn.Routable.html
[`Routable`]: https://docs.rs/dioxus-router/latest/dioxus_router/routable/trait.Routable.html
2 changes: 1 addition & 1 deletion docs-src/0.6/src/router/example/redirection-perfection.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ That's it! Now your users will be redirected to the blog.

Well done! You've completed the Dioxus Router guide. You've built a small
application and learned about the many things you can do with Dioxus Router.
To continue your journey, you attempt a challenge listed below, look at the [router examples](https://github.com/DioxusLabs/dioxus/tree/main/packages/router/examples), or
To continue your journey, you attempt a challenge listed below, look at the [examples](https://github.com/DioxusLabs/dioxus/tree/main/examples), or
the [API reference](https://docs.rs/dioxus-router/).

### Challenges
Expand Down
2 changes: 1 addition & 1 deletion docs-src/0.6/src/router/reference/static-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ To statically render pages, we need to flatten the route tree and generate a fil

- [examples/static-hydrated](https://github.com/DioxusLabs/dioxus/tree/v0.5/packages/fullstack/examples/static-hydrated)

[`Routable`]: https://docs.rs/dioxus-router/latest/dioxus_router/components/fn.Routable.html
[`Routable`]: https://docs.rs/dioxus-router/latest/dioxus_router/routable/trait.Routable.html
2 changes: 1 addition & 1 deletion docs-src/blog/src/introducing-dioxus.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ $ cargo init dioxus_example
$ cd dioxus_example
```

We then add a dependancy on Dioxus to the `Cargo.toml` file, with the "desktop" feature enabled:
We then add a dependency on Dioxus to the `Cargo.toml` file, with the "desktop" feature enabled:

```rust
[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion docs-src/blog/src/release-020.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ A ton more! Dioxus is now much more stable than it was at release!
* [Home automation server app](https://github.com/FruitieX/homectl) [@FruitieX](https://github.com/FruitieX)
* [Video Recording app](https://github.com/rustkid/recorder)
* [Music streaming app](https://github.com/autarch/Crumb/tree/master/web-frontend) [@autarch](https://github.com/autarch)
* [NixOS dependancy installation](https://gist.github.com/FruitieX/73afe3eb15da45e0e05d5c9cf5d318fc) [@FruitieX](https://github.com/FruitieX)
* [NixOS dependency installation](https://gist.github.com/FruitieX/73afe3eb15da45e0e05d5c9cf5d318fc) [@FruitieX](https://github.com/FruitieX)
* [Vercel Deploy Template](https://github.com/lucifer1004/dioxus-vercel-demo) [@lucifer1004](https://github.com/lucifer1004)
* [Render Katex in Dioxus](https://github.com/oovm/katex-wasm)
* [Render PrismJS in Dioxus](https://github.com/oovm/prism-wasm)
Expand Down
18 changes: 18 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This is the configuration file for lychee, a link validator.
exclude = [
'file:///',
'https://github.com/DioxusLabs/dioxus/commit',
'mysql.com',
'azure.microsoft.com'
]
exclude_path = [
'target',
'docs-src/0.3',
'docs-src/0.4',
'docs-src/0.5',
'docs-src/blog'
]
exclude_all_private = true
no_progress = false
cache = true
max_cache_age = "10d"
14 changes: 8 additions & 6 deletions src/doc_examples/untested_03/conditional_rendering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
pub fn App(cx: Scope) -> Element {
let is_logged_in = use_state(cx, || false);

cx.render(rsx!(LogIn {
is_logged_in: **is_logged_in,
on_log_in: |_| is_logged_in.set(true),
on_log_out: |_| is_logged_in.set(false),
}))
cx.render(rsx!(
LogIn {
is_logged_in: **is_logged_in,
on_log_in: |_| is_logged_in.set(true),
on_log_out: |_| is_logged_in.set(false),
}
))
}

#[inline_props]
Expand Down Expand Up @@ -57,7 +59,7 @@
// We only render the welcome message if we are logged in
// You can use if statements in the middle of a render block to conditionally render elements
if *is_logged_in {
// Notice the body of this if statment is rsx code, not an expression
// Notice the body of this if statemenet is rsx code, not an expression

Check warning on line 62 in src/doc_examples/untested_03/conditional_rendering.rs

View workflow job for this annotation

GitHub Actions / Check for typos

"statemenet" should be "statement".
"Welcome!"
}
button {
Expand Down
24 changes: 12 additions & 12 deletions src/doc_examples/untested_04/custom_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ impl State for Size {
fn update<'a>(
&mut self,
node_view: NodeView<()>,
_node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>,
_parent: Option<<Self::ParentDependencies as Dependancy>::ElementBorrowed<'a>>,
children: Vec<<Self::ChildDependencies as Dependancy>::ElementBorrowed<'a>>,
_node: <Self::NodeDependencies as Dependency>::ElementBorrowed<'a>,
_parent: Option<<Self::ParentDependencies as Dependency>::ElementBorrowed<'a>>,
children: Vec<<Self::ChildDependencies as Dependency>::ElementBorrowed<'a>>,
context: &SendAnyMap,
) -> bool {
let font_size = context.get::<FontSize>().unwrap().0;
Expand Down Expand Up @@ -99,9 +99,9 @@ impl State for TextColor {
fn update<'a>(
&mut self,
node_view: NodeView<()>,
_node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>,
parent: Option<<Self::ParentDependencies as Dependancy>::ElementBorrowed<'a>>,
_children: Vec<<Self::ChildDependencies as Dependancy>::ElementBorrowed<'a>>,
_node: <Self::NodeDependencies as Dependency>::ElementBorrowed<'a>,
parent: Option<<Self::ParentDependencies as Dependency>::ElementBorrowed<'a>>,
_children: Vec<<Self::ChildDependencies as Dependency>::ElementBorrowed<'a>>,
_context: &SendAnyMap,
) -> bool {
// TextColor only depends on the color tag, so getting the first tag is equivalent to looking through all tags
Expand Down Expand Up @@ -148,9 +148,9 @@ impl State for Border {
fn update<'a>(
&mut self,
node_view: NodeView<()>,
_node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>,
_parent: Option<<Self::ParentDependencies as Dependancy>::ElementBorrowed<'a>>,
_children: Vec<<Self::ChildDependencies as Dependancy>::ElementBorrowed<'a>>,
_node: <Self::NodeDependencies as Dependency>::ElementBorrowed<'a>,
_parent: Option<<Self::ParentDependencies as Dependency>::ElementBorrowed<'a>>,
_children: Vec<<Self::ChildDependencies as Dependency>::ElementBorrowed<'a>>,
_context: &SendAnyMap,
) -> bool {
// check if the node contains a border attribute
Expand Down Expand Up @@ -271,11 +271,11 @@ impl State for MyState {
// The view of the current node limited to the parts this state depends on
_node_view: NodeView<()>,
// The state of the current node that this state depends on
_node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>,
_node: <Self::NodeDependencies as Dependency>::ElementBorrowed<'a>,
// The state of the parent nodes that this state depends on
_parent: Option<<Self::ParentDependencies as Dependancy>::ElementBorrowed<'a>>,
_parent: Option<<Self::ParentDependencies as Dependency>::ElementBorrowed<'a>>,
// The state of the child nodes that this state depends on
_children: Vec<<Self::ChildDependencies as Dependancy>::ElementBorrowed<'a>>,
_children: Vec<<Self::ChildDependencies as Dependency>::ElementBorrowed<'a>>,
// The context of the current node used to pass global state into the tree
_context: &SendAnyMap,
) -> bool {
Expand Down
4 changes: 2 additions & 2 deletions src/doc_examples/untested_04/use_future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ pub fn App(cx: Scope) -> Element {

#[component]
fn RandomDog(cx: Scope, breed: String) -> Element {
// ANCHOR: dependancy
// ANCHOR: dependency
let future = use_future(cx, (breed,), |(breed,)| async move {
reqwest::get(format!("https://dog.ceo/api/breed/{breed}/images/random"))
.await
.unwrap()
.json::<ApiResponse>()
.await
});
// ANCHOR_END: dependancy
// ANCHOR_END: dependency

cx.render(rsx!(()))
}
Loading