Skip to content

Commit e44d425

Browse files
author
Timo Stark
committed
Update Blockquote Styling and Wording
1 parent 8798e5d commit e44d425

File tree

3 files changed

+30
-22
lines changed

3 files changed

+30
-22
lines changed

source/news/2024/wasm-component-model-part-1.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ The WebAssembly Component Model and NGINX Unit
1616
************************************************************************
1717

1818
A lot has happened since we shipped the first version of our Wasm Language Module for Unit.
19-
Back in September 2023 we said: ::
19+
Back in September 2023 we said:
2020

21-
We introduce WebAssembly support as a Technology Preview - we expect to replace it with WASI-HTTP
22-
support as soon as that is possible.
21+
| We introduce WebAssembly support as a Technology Preview - we expect to replace it with WASI-HTTP support as soon as that is possible.
2322
2423
We have done just that with Unit 1.32.0. This release supports Wasm Components using the WASI 0.2 APIs and the wasi:http/proxy world as its main interface.
2524

@@ -48,7 +47,7 @@ As we are creating Wasm components for server-side runtimes, we cannot target br
4847
The code we write can be compiled into an executable binary file. After launching it, we will see "Hello World" printed on the command line. The magic behind this is a standard called POSIX, which defines system calls. System calls work differently on different operating systems.
4948

5049
WASI provides an abstraction layer for those syscalls, that can be targeted from the Code that will be compiled to Wasm.
51-
A WASI compatible runtime will be able to handle the execution of that code. We see this in action in our `Rust tutorial </news/2024/wasm-component-model-part-2>`-- further in part 2 of this blog series. Since Preview2 of the WASI proposal - `the WASI-APIs are defined in WIT-files <https://bytecodealliance.org/articles/webassembly-the-updated-roadmap-for-developers#webassembly-system-interface-wasi>`__.
50+
A WASI compatible runtime will be able to handle the execution of that code. We see this in action in our `Rust tutorial </news/2024/wasm-component-model-part-2>`__ further in part 2 of this blog series. Since Preview2 of the WASI proposal - `the WASI-APIs are defined in WIT-files <https://bytecodealliance.org/articles/webassembly-the-updated-roadmap-for-developers#webassembly-system-interface-wasi>`__.
5251

5352
WIT (Wasm Interface Types) is a descriptive `interface description language (IDL) <https://en.wikipedia.org/wiki/IDL_(programming_language)>`__ to define interfaces. It isn't a general-purpose coding language. The written WIT files don't contain any business logic; they are pure definitions of contracts. Multiple interfaces can be further combined into worlds. While it is not required to deeply understand the way you can create your own WIT-files, it will help to track down issues or trouble-shoot them while building components. To learn more about the WIT programming language, see the official `documentation. <https://component-model.bytecodealliance.org/design/wit.html#structure-of-a-wit-file>`__
5453

source/news/2024/wasm-component-model-part-2.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
:orphan:
22

3-
************************************************************************
3+
##################################################################
44
The WebAssembly Component Model - The Why, How and What - Part 2
5-
************************************************************************
5+
##################################################################
66

77
This is Part 2 of our Blog series about the Wasm Component Model, it's ecosytem and how to use Wasm Components with NGINX Unit.
88
In `Part 1 </news/2024/wasm-component-model-part-1>`__ we have covered all the conceptional parts. In this part, we will focus on the process of creating a Wasm Component.
99

10-
==========================================================================
10+
************************************************************************
1111
Tutorial - A Rust based Wasm Component
12-
==========================================================================
12+
************************************************************************
1313

1414
Rust is the premier language for WebAssembly development and the most mature in terms of support. In the example, we will use Rust and its ecosystem to create a Wasm Component that can be hosted directly on NGINX Unit.
1515

1616
This tutorial targets Linux-based operating systems and macOS. If you are on Windows, we recommend using WSL2 (Windows Subsystem for Linux) to follow along. If you haven't already installed NGINX Unit alongside with the WebAssembly language module, please refer to the `docs <https://unit.nginx.org/installation/#official-packages>`__ on how to do it or use the official `Docker Image <https://unit.nginx.org/installation/#docker-images>`__ **unit:wasm**.
1717

18-
==========================================================================
18+
=============================
1919
Rust Development Setup
20-
==========================================================================
20+
=============================
2121

2222
Let's start by installing the Rust ecosystem, if not already done. At the time of writing, Rust 1.76 is the latest stable version.
2323
To install Rust, see the instructions on their `website <https://www.rust-lang.org/tools/install>`__.
@@ -31,19 +31,19 @@ After the installation completes, you can confirm the current version of Rust by
3131
3232
To work with Wasm Components, we need some additional tooling. This is a one-time setup for you to be able to write Rust source code and compile it to a Wasm Component.
3333

34-
==========================================================================
34+
======================================
3535
Add the wasm32-wasi compiler target
36-
==========================================================================
36+
======================================
3737

3838
The wasm32-wasi compiler target will provide general Wasm support to your rustc installation. Add the target by running:
3939

4040
.. code-block:: bash
4141
4242
$ rustup target add wasm32-wasi
4343
44-
==========================================================================
44+
======================================
4545
Install cargo-component
46-
==========================================================================
46+
======================================
4747

4848
**cargo-component** will add a cargo subcommand to build Wasm Components without any intermediate steps from our Rust project.
4949
To install the latest version run the following command:
@@ -52,9 +52,9 @@ To install the latest version run the following command:
5252
5353
$ cargo install cargo-component
5454
55-
==========================================================================
55+
=================================================
5656
Install wasmtime runtime and CLI for testing
57-
==========================================================================
57+
=================================================
5858

5959
The wasmtime-cli will be used to test and play around with the Wasm component. At the time of writing, we are using Wasmtime 18.
6060
To install the latest version of Wasmtime run:
@@ -63,14 +63,14 @@ To install the latest version of Wasmtime run:
6363
6464
$ curl https://wasmtime.dev/install.sh -sSf | bash
6565
66-
For more information about Wasmtime and installing it, see their `Github repository <https://github.com/bytecodealliance/wasmtime/>`__
66+
For more information about Wasmtime and installing it, see their `GitHub repository <https://github.com/bytecodealliance/wasmtime/>`__
6767

6868
Once we have all the tools in place, we can create the Rust projects.
6969

7070
.. _tutorial-rust-based-wasm-component:
71-
==========================================================================
71+
======================================
7272
Using the **wasi** Rust library
73-
==========================================================================
73+
======================================
7474

7575
Our experience with the official WASI Rust library was very interesting and exciting. The component build time was fascinating, and the library has a low dependency footprint. However, there are some costs in terms of developer experience. See for yourselves:
7676

@@ -80,7 +80,7 @@ Start by creating a new Wasm Component using **cargo component**:
8080
8181
$ cargo component new --lib test-wasi-component
8282
83-
At the time of writing, the wasi crate (Version 0.12.1) available on `crates.io <https://crates.io/crates/wasi>`__ didn't include the latest version available on GitHub. As we are making use of a Macro in Rust, we will have to clone the repository <https://github.com/bytecodealliance/wasi>`__ and reference it from our new Wasm Component project.
83+
At the time of writing, the wasi crate (Version 0.12.1) available on `crates.io <https://crates.io/crates/wasi>`__ didn't include the latest version available on GitHub. As we are making use of a Macro in Rust, we will have to clone the `repository <https://github.com/bytecodealliance/wasi>`__ and reference it from our new Wasm Component project.
8484

8585
Clone the bytecodealliances wasi repository
8686

@@ -157,7 +157,7 @@ The actual code from **src/lib.rs** should look like this:
157157
}
158158
}
159159
160-
Targeting the wasi crate requires some low-level Rust work by us. Not bad at all, but something to consider when choosing this option. For the **wasi:http/proxy** world there is an interface description available on `Github <https://github.com/WebAssembly/wasi-http/blob/main/proxy.md>`__ which will help to write your code.
160+
Targeting the wasi crate requires some low-level Rust work by us. Not bad at all, but something to consider when choosing this option. For the **wasi:http/proxy** world there is an interface description available on `GitHub <https://github.com/WebAssembly/wasi-http/blob/main/proxy.md>`__ which will help to write your code.
161161

162162
Let's build the component. Run the following command from the **test-wasi-component** directory:
163163

@@ -232,7 +232,7 @@ Apply the configuration using **unitc**:
232232

233233
.. code-block:: bash
234234
235-
unitc config.json /config
235+
$ unitc config.json /config
236236
237237
Sending a request to the exposed endpoint will create the same output from a different runtime implementation:
238238

source/theme/static/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,3 +798,12 @@ iframe {
798798
text-shadow: 1px 0 #1e293b;
799799
}
800800
}
801+
802+
blockquote {
803+
margin: 1em 0;
804+
border-color: #1e293b;
805+
border-left: .2em solid;
806+
border-left-color: currentcolor;
807+
font-style: italic;
808+
padding: .6em 0 .6em 1em;
809+
}

0 commit comments

Comments
 (0)