1
0
mirror of https://github.com/actix/actix-website synced 2025-06-26 23:27:43 +02:00

TypeScript compatibility (#379)

* Update file extensions and exports for TypeScript compatibility

* docs: fix typo in getting-started.md

* chore: add no-trailing-punctuation rule to VS Code settings

* feat: add @docusaurus/theme-mermaid for mermaid diagram support

* Update import paths for MermaidDiagram component

* remove redudndant check, use effect only runs after the component is mounted

* Update docusaurus.config.ts to fix syntax error

* bring back check because it's not possible to properly cancel a dynamic import

* feat: optimize dynamic import in CodeBlock component

* chore: update VS Code extensions.json with eslint recommendation

* Update docusaurus.config.ts to add GitHub repository link in header
This commit is contained in:
Hichem Fantar
2024-05-28 20:23:34 +01:00
committed by GitHub
parent a0a2da114d
commit ad4aeac34f
23 changed files with 4597 additions and 73 deletions

View File

@ -2,14 +2,16 @@
title: Getting Started
---
import RenderCodeBlock from '@theme/CodeBlock'; import CodeBlock from "@site/src/components/code_block"; import { rustVersion, actixWebMajorVersion } from "@site/vars";
import RenderCodeBlock from '@theme/CodeBlock';
import CodeBlock from "@site/src/components/code_block";
import vars from "@site/vars";
## Installing Rust
If you don't have Rust yet, we recommend you use `rustup` to manage your Rust installation. The [official rust guide][rustguide] has a wonderful section on getting started.
<p>
Actix Web currently has a minimum supported Rust version (MSRV) of { rustVersion }. Running <code>rustup update</code> will ensure you have the latest and greatest Rust version available. As such, this guide assumes you are running Rust { rustVersion } or later.
Actix Web currently has a minimum supported Rust version (MSRV) of { vars.rustVersion }. Running <code>rustup update</code> will ensure you have the latest and greatest Rust version available. As such, this guide assumes you are running Rust { vars.rustVersion } or later.
</p>
## Hello, world!
@ -27,7 +29,7 @@ Add `actix-web` as a dependency of your project by adding the following to your
<RenderCodeBlock className="language-toml">
{`[dependencies]
actix-web = "${actixWebMajorVersion}"`}
actix-web = "${vars.actixWebMajorVersion}"`}
</RenderCodeBlock>
Request handlers use async functions that accept zero or more parameters. These parameters can be extracted from a request (see `FromRequest` trait) and returns a type that can be converted into an `HttpResponse` (see `Responder` trait):