Merge branch 'master' into use-server-function

This commit is contained in:
Evan Almloff committed 2023-07-19 14:19:03 -07:00
1 parent f3d1600822
commit 7e2ef1260f
81 files changed
+483 -375

No files matched your search

+4 -4
View File
@@ -2,14 +2,14 @@
In this chapter we will introduce all `dioxus-cli` commands.
> You can also use `dioxus --help` to get cli help info.
> You can also use `dx --help` to get cli help info.
```
dioxus
dx
Build, bundle, & ship your Dioxus app
USAGE:
dioxus [OPTIONS] <SUBCOMMAND>
dx [OPTIONS] <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
@@ -23,4 +23,4 @@ SUBCOMMANDS:
help Print this message or the help of the given subcommand(s)
serve Build, watch & serve the Rust WASM app and all of its assets
translate Translate some html file into a Dioxus component
```
```
+9 -9
View File
@@ -1,13 +1,13 @@
# Build
The `dioxus build` command can help you `pack & build` a dioxus project.
The `dx build` command can help you `pack & build` a dioxus project.
```
dioxus-build
dioxus-build
Build the Rust WASM app and all of its assets
USAGE:
dioxus build [OPTIONS]
dx build [OPTIONS]
OPTIONS:
--example <EXAMPLE> [default: ""]
@@ -19,7 +19,7 @@ OPTIONS:
You can use this command to build a project:
```
dioxus build --release
dx build --release
```
## Target platform
@@ -28,14 +28,14 @@ Use the `platform` option to choose your target platform:
```
# for desktop project
dioxus build --platform desktop
dx build --platform desktop
```
`platform` currently only supports `desktop` & `web`.
```
# for web project
dioxus build --platform web
dx build --platform web
```
## Specify workspace bin
@@ -43,7 +43,7 @@ dioxus build --platform web
You can add the `--bin` option to select which crate you want Dioxus to build:
```
dioxus build --bin app
dx build --bin app
```
## Build Example
@@ -52,5 +52,5 @@ You can use the `example` option to select a example to build:
```
# build the `test` example
dioxus build --exmaple test
```
dx build --exmaple test
```
+6 -6
View File
@@ -1,13 +1,13 @@
# Clean
`dioxus clean` will clear the build artifacts (the out_dir and the cargo cache)
`dx clean` will clear the build artifacts (the out_dir and the cargo cache)
```
dioxus-clean
dioxus-clean
Clean build artifacts
USAGE:
dioxus clean [OPTIONS]
dx clean [OPTIONS]
OPTIONS:
--bin [default: None]
@@ -16,12 +16,12 @@ OPTIONS:
# Example
```
dioxus clean
dx clean
```
# Specify workspace bin
You can add the `--bin` option to select which crate you want Dioxus to clean artifacts from:
```
dioxus clean --bin app
```
dx clean --bin app
```
+10 -10
View File
@@ -1,13 +1,13 @@
# Serve
The `dioxus serve` can start a dev server with hot-reloading
The `dx serve` can start a dev server with hot-reloading
```
dioxus-serve
dioxus-serve
Build, watch & serve the Rust WASM app and all of its assets
USAGE:
dioxus serve [OPTIONS]
dx serve [OPTIONS]
OPTIONS:
--example <EXAMPLE> [default: ""]
@@ -20,7 +20,7 @@ OPTIONS:
You can use this command to build project and start a dev server:
```
dioxus serve
dx serve
```
## Serve Example
@@ -29,7 +29,7 @@ You can use the `example` option to serve a example:
```
# serve the `test` example
dioxus serve --exmaple test
dx serve --exmaple test
```
## Specify workspace bin
@@ -37,7 +37,7 @@ dioxus serve --exmaple test
You can add the `--bin` option to select which crate you want Dioxus to build and serve:
```
dioxus serve --bin app
dx serve --bin app
```
## Open Browser
@@ -45,7 +45,7 @@ dioxus serve --bin app
You can add the `--open` option to open system default browser when server startup:
```
dioxus serve --open
dx serve --open
```
## RSX Hot Reloading
@@ -53,7 +53,7 @@ dioxus serve --open
You can add the `--hot-reload` flag to enable [rsx hot reloading](https://dioxuslabs.com/docs/0.3/guide/en/getting_started/hot_reload.html). This will allow you to reload some rsx changes without a full recompile:
```
dioxus serve --open
dx serve --open
```
## Cross Origin Policy
@@ -66,5 +66,5 @@ You can add the `cross-origin-policy` option to change cross-origin header to:
```
```
dioxus serve --corss-origin-policy
```
dx serve --corss-origin-policy
```
+7 -7
View File
@@ -1,13 +1,13 @@
# Translate
`dioxus translate` can translate some `html` file into a Dioxus compoent
`dx translate` can translate some `html` file into a Dioxus compoent
```
dioxus-translate
dioxus-translate
Translate some source file into a Dioxus component
USAGE:
dioxus translate [OPTIONS] [OUTPUT]
dx translate [OPTIONS] [OUTPUT]
ARGS:
<OUTPUT> Output file, defaults to stdout if not present
@@ -22,7 +22,7 @@ OPTIONS:
You can use the `file` option to set path to the `html` file to translate:
```
dioxus transtale --file ./index.html
dx transtale --file ./index.html
```
## Output rsx to a file
@@ -30,7 +30,7 @@ dioxus transtale --file ./index.html
You can pass a file to the traslate command to set the path to write the output of the command to:
```
dioxus translate --file ./index.html component.rsx
dx translate --file ./index.html component.rsx
```
## Output rsx to a file
@@ -38,7 +38,7 @@ dioxus translate --file ./index.html component.rsx
Setting the `component` option will create a compoent from the HTML:
```
dioxus translate --file ./index.html --component
dx translate --file ./index.html --component
```
## Example
@@ -65,4 +65,4 @@ fn component(cx: Scope) -> Element {
}
})
}
```
```
+2 -2
View File
@@ -29,8 +29,8 @@ General application confiration:
# default: web
default_platform = "web"
```
if you change this to `desktop`, the `dioxus build` will default building a desktop app
3. ***out_dir*** - The directory to place the build artifacts from `dioxus build` or `dioxus service` into. This is also where the `assets` directory will be copied to
if you change this to `desktop`, the `dx build` will default building a desktop app
3. ***out_dir*** - The directory to place the build artifacts from `dx build` or `dx service` into. This is also where the `assets` directory will be copied to
```
out_dir = "dist"
```
+4 -4
View File
@@ -4,10 +4,10 @@ Once you have the Dioxus CLI tool installed, you can use it to create dioxus pro
## Initializing a default project
First, run the `dioxus create` command to create a new project ready to be used with Dioxus and the Dioxus CLI:
First, run the `dx create` command to create a new project ready to be used with Dioxus and the Dioxus CLI:
```
dioxus create hello-dioxus
dx create hello-dioxus
```
> It will clone a default template from github template: [DioxusLabs/dioxus-template](https://github.com/DioxusLabs/dioxus-template)
@@ -15,7 +15,7 @@ dioxus create hello-dioxus
>
> You can choose to create your project from a different template by passing the `template` argument:
> ```
> dioxus init hello-dioxus --template=gh:dioxuslabs/dioxus-template
> dx init hello-dioxus --template=gh:dioxuslabs/dioxus-template
> ```
Next, move the current directory into your new project:
@@ -33,7 +33,7 @@ cd hello-dioxus
Finally, create serve your project with the Dioxus CLI:
```
dioxus serve
dx serve
```
By default, the CLI serve your site at: [`http://127.0.0.1:8080/`](http://127.0.0.1:8080/)
+2 -2
View File
@@ -2,7 +2,7 @@
> For Cli 0.2.0 we will add `plugin-develop` support.
Before the 0.2.0 we use `dioxus tool` to use & install some plugin, but we think that is not good for extend cli program, some people want tailwind support, some people want sass support, we can't add all this thing in to the cli source code and we don't have time to maintain a lot of tools that user request, so maybe user make plugin by themself is a good choice.
Before the 0.2.0 we use `dx tool` to use & install some plugin, but we think that is not good for extend cli program, some people want tailwind support, some people want sass support, we can't add all this thing in to the cli source code and we don't have time to maintain a lot of tools that user request, so maybe user make plugin by themself is a good choice.
### Why Lua ?
@@ -76,4 +76,4 @@ end
manager.serve.interval = 1000
return manager
```
```