Skip to content
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 info to website #3403

Closed
wants to merge 4 commits into from
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
18 changes: 15 additions & 3 deletions website/docs/tutorial/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,24 @@ Now, let's create an `index.html` at the root of the project.
Run the following command to build and serve the application locally.

```bash
trunk serve --open
trunk serve --open // remove option '--open' to not open your default browser
```

Trunk will open your application in your default browser, watch the project directory and helpfully rebuild your
application if you modify any source files. If you are curious, you can run `trunk help` and `trunk help <subcommand>`
for more details on what is happening.
application if you modify any source files.
This will fail if the socket is being used by another application.
By default server will listening at address '127.0.0.1' and port '8080' [localhost:8080](http://127.0.0.1:8080).
To change it, create the following file and edit as needed:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
To change it, create the following file and edit as needed:
To change it, create the [Trunk config file](https://trunkrs.dev/configuration/#trunk-toml) and edit as needed:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hamza1311 suggested changes implemented in PR #3406.


```toml title="Trunk.toml"
[serve]
# The address to serve on.
address = "127.0.0.1" // "0.0.0.0" for WAN
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
address = "127.0.0.1" // "0.0.0.0" for WAN
address = "127.0.0.1"

WAN is incorrect. 0.0.0.0 makes the port exposed on the local network. It has to be exposed. Also, it not recommended to use trunk for anything else other development so I would like to not recommend this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hamza1311 "0.0.0.0 for WAN" is for remote development (ssh client). I agree that is not recommended! But any alternative for this cases?

# The port to serve on.
port = 8000
```

If you are curious, you can run `trunk help` and `trunk help <subcommand>` for more details on what is happening.

### Congratulations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ To convert this simple command line application to a basic Yew web application,

#### Update Cargo.toml

Add `yew` to the list of dependencies.
Add `yew` to the list of dependencies editing file:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Add `yew` to the list of dependencies editing file:
Add `yew` to the list of dependencies by updating your Cargo.toml:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hamza1311 suggested changes implemented in PR #3406.


```toml title=Cargo.toml
[package]
Expand All @@ -58,6 +58,8 @@ edition = "2021"
yew = { version = "0.20.0", features = ["csr"] }
```

or using `cargo add yew -F csr`.

:::info

You only need feature `csr` if you are building an application.
Expand Down Expand Up @@ -128,10 +130,21 @@ Finally, add an `index.html` file in the root directory of your app.
Run the following command to build and serve the application locally.

```bash
trunk serve
trunk serve // add option '--open' to open your default browser
```

Trunk will rebuild your application if you modify any of its source code files.
This will fail if the socket is being used by another application.
By default server will listening at address '127.0.0.1' and port '8080' [localhost:8080](http://127.0.0.1:8080).
To change it, create the following file and edit as needed:

```toml title="Trunk.toml"
[serve]
# The address to serve on.
address = "127.0.0.1" // "0.0.0.0" for WAN
# The port to serve on.
port = 8000
```

## Congratulations

Expand Down
18 changes: 15 additions & 3 deletions website/versioned_docs/version-0.20/tutorial/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,24 @@ Now, let's create an `index.html` at the root of the project.
Run the following command to build and serve the application locally.

```bash
trunk serve --open
trunk serve --open // remove option '--open' to not open your default browser
```

Trunk will open your application in your default browser, watch the project directory and helpfully rebuild your
application if you modify any source files. If you are curious, you can run `trunk help` and `trunk help <subcommand>`
for more details on what's happening.
application if you modify any source files.
This will fail if the socket is being used by another application.
By default server will listening at address '127.0.0.1' and port '8080' [localhost:8080](http://127.0.0.1:8080).
To change it, create the following file and edit as needed:

```toml title="Trunk.toml"
[serve]
# The address to serve on.
address = "127.0.0.1" // "0.0.0.0" for WAN
moyeah marked this conversation as resolved.
Show resolved Hide resolved
# The port to serve on.
port = 8000
```

If you are curious, you can run `trunk help` and `trunk help <subcommand>` for more details on what's happening.

### Congratulations

Expand Down
Loading