Skip to content

Commit f7ec1aa

Browse files
committed
fix: ✏️ updated all instances of *WASM* to *Wasm*
1 parent 7693ebf commit f7ec1aa

File tree

11 files changed

+33
-31
lines changed

11 files changed

+33
-31
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Support every major rendering strategy and provide developers the ability to eff
2222

2323
## Motivation
2424

25-
There is a sore lack of Rust frameworks for frontend development that support more than just SPAs and client-side rendering, and so Perseus was born. We need something like NextJS for WASM.
25+
There is a sore lack of Rust frameworks for frontend development that support more than just SPAs and client-side rendering, and so Perseus was born. We need something like NextJS for Wasm.
2626

2727
## Roadmap
2828

docs/src/integrations/actix-web.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async fn main() -> std::io::Result<()> {
5252
}
5353
```
5454

55-
When you use the integration, you'll have to define a few options to tell it what exactly to serve. Specifically, you'll need to tell it where your `index.html` file, your JS bundle, and your WASM bundle all are. In addition, you'll need to a provide it with a template map (which you'll often define a getter function for as above).
55+
When you use the integration, you'll have to define a few options to tell it what exactly to serve. Specifically, you'll need to tell it where your `index.html` file, your JS bundle, and your Wasm bundle all are. In addition, you'll need to a provide it with a template map (which you'll often define a getter function for as above).
5656

5757
Also, because this plugs into an existing server, you have full control over hosting options, like the port to be used!
5858

docs/src/serving.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
# Serving
22

3-
*You only need this page if you're not using the Perseus CLI, which performs this process for you!*
3+
_You only need this page if you're not using the Perseus CLI, which performs this process for you!_
44

55
Having generated a large number of static files, you'll need a system to host your files for you! Due to the dynamic nature of some rendering strategies, Perseus needs to be involved in this process (for executing request-time logic), and so it provides a simple API interface for serving pages.
66

77
Perseus aims to be agnostic as to what framework you use to host your files, and any framework that gives you access to request headers and wildcard paths should work (in other words, any framework worth its salt).
88

99
If you're using one of our supported integrations, you don't have to bother with this page, nearly all of it can be done for you!
1010

11-
- [Actix Web](./integrations/actix-web.md)
12-
- *More coming soon...*
11+
- [Actix Web](./integrations/actix-web.md)
12+
- _More coming soon..._
1313

1414
## Endpoints
1515

1616
Here are the endpoints that a server for Perseus must serve:
1717

18-
- `/.perseus/page/*` – used to serve the JSON data that the app shell needs to render a page (`*` should be extractable as a filename, e.g. `{filename:.*}` in Actix Web)
19-
- `/.perseus/bundle.js` – the JavaScript bundle file that calls your WASM code (see [tutorial on building your first app](./tutorials/first_app/intro.md))
20-
- `/.perseus/bundle.wasm` – the WASM bundle file that contains your code (see [tutorial on building your first app](./tutorials/first_app/intro.md))
21-
- `*` (anything else) – any page that the user actually requests, which will return the app shell to do the heavy lifting (or more accurately an HTML file that includes the bundle)
18+
- `/.perseus/page/*` – used to serve the JSON data that the app shell needs to render a page (`*` should be extractable as a filename, e.g. `{filename:.*}` in Actix Web)
19+
- `/.perseus/bundle.js` – the JavaScript bundle file that calls your Wasm code (see [tutorial on building your first app](./tutorials/first_app/intro.md))
20+
- `/.perseus/bundle.wasm` – the Wasm bundle file that contains your code (see [tutorial on building your first app](./tutorials/first_app/intro.md))
21+
- `*` (anything else) – any page that the user actually requests, which will return the app shell to do the heavy lifting (or more accurately an HTML file that includes the bundle)
2222

2323
## Usage
2424

2525
This example shows what would be done to acquire a page for any framework. You'll need to have access to these data to get a page:
2626

27-
- The page path the user requested, e.g. `/post/test` for a request to `/.perseus/page/post/test`
28-
- Data about the HTTP request the user sent (see below)
29-
- A map of templates produced with [`get_templates_map!`]() (API docs WIP)
30-
- A [config manager](./config_managers.md)
27+
- The page path the user requested, e.g. `/post/test` for a request to `/.perseus/page/post/test`
28+
- Data about the HTTP request the user sent (see below)
29+
- A map of templates produced with [`get_templates_map!`]() (API docs WIP)
30+
- A [config manager](./config_managers.md)
3131

3232
```rust,no_run,no_playground
3333
use perseus::{get_page};
@@ -46,7 +46,7 @@ match page_data {
4646

4747
## Request Data
4848

49-
Perseus needs access to information about HTTP requests so it can perform tasks related to the *request state* strategy, which provides access to headers and the like. Internally, Perseus uses [`http::Request`](https://docs.rs/http/0.2.4/http/request/struct.Request.html) for this, with the body type `()` (payloads are irrelevant in requests that ask for a page at a URL).
49+
Perseus needs access to information about HTTP requests so it can perform tasks related to the _request state_ strategy, which provides access to headers and the like. Internally, Perseus uses [`http::Request`](https://docs.rs/http/0.2.4/http/request/struct.Request.html) for this, with the body type `()` (payloads are irrelevant in requests that ask for a page at a URL).
5050

5151
Unfortunately, different web server frameworks represent request data differently, and so you'll need to convert from your framework's system to `http`'s. When integrations are ready, this will be done for you!
5252

@@ -77,19 +77,19 @@ pub fn convert_req(raw: &actix_web::HttpRequest) -> Result<Request, String> {
7777
// Any custom data should therefore be sent in headers (if you're doing that, consider a dedicated API)
7878
.body(())
7979
.map_err(|err| format!("converting actix web request to perseus-compliant request failed: '{}'", err))?;
80-
80+
8181
Ok(req)
8282
}
8383
```
8484

8585
Notably, the data that need to be converted are:
8686

87-
- Headers
88-
- URI to which the request was sent
89-
- HTTP method (subject to change in future Perseus versions, currently `GET`)
90-
- HTTP version used
87+
- Headers
88+
- URI to which the request was sent
89+
- HTTP method (subject to change in future Perseus versions, currently `GET`)
90+
- HTTP version used
9191

92-
Note that mis-converting any of these data will not affect Perseus (which doesn't require any of them to function), only your own code. So if you have no intention of using the *request state* strategy in your app, you could theoretically just parse an empty request to Perseus like so:
92+
Note that mis-converting any of these data will not affect Perseus (which doesn't require any of them to function), only your own code. So if you have no intention of using the _request state_ strategy in your app, you could theoretically just parse an empty request to Perseus like so:
9393

9494
```rust
9595
use perseus::HttpRequest

docs/src/tutorials/first_app/setup.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ After you've done this, make sure everything works by running `cargo` in a termi
1010

1111
## Build Tools
1212

13-
Perseus is built on top of WASM (WebAssembly), which basically lets you use programming languages other than JavaScript to build websites/webapps. That tech is *really* complicated, and you'll need two particular build tools to make your code work.
13+
Perseus is built on top of Wasm (WebAssembly), which basically lets you use programming languages other than JavaScript to build websites/webapps. That tech is _really_ complicated, and you'll need two particular build tools to make your code work.
1414

1515
The first one is [`wasm-pack`](), which helps to compile your Rust code to WebAssembly (sort of like how you'd compile code normally, but specially for the browser). You can install it with this command:
1616

@@ -20,12 +20,14 @@ cargo install wasm-pack
2020

2121
Now, you should be able to type `wasm-pack` in your terminal to get another help page!
2222

23-
The next tool is one you might be familiar with if you're coming from the JavaScript world: [Rollup](https://rollupjs.org). Rollup is a bundling tool for JavaScript, and it works really nicely with WASM. If you loathe JavaScript with a passion, don't worry, the only JavaScript in Perseus just invokes your (infinitely superior) Rust code! You can install Rollup with the following command:
23+
The next tool is one you might be familiar with if you're coming from the JavaScript world: [Rollup](https://rollupjs.org). Rollup is a bundling tool for JavaScript, and it works really nicely with Wasm. If you loathe JavaScript with a passion, don't worry, the only JavaScript in Perseus just invokes your (infinitely superior) Rust code! You can install Rollup with the following command:
2424

2525
```
2626
npm i -g rollup
2727
```
28+
2829
or
30+
2931
```
3032
yarn global add rollup
3133
```

examples/basic/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ sycamore-router = "0.6"
1515
serde = { version = "1", features = ["derive"] }
1616
serde_json = "1" # Possibly don't need?
1717

18-
# This section is needed for WASM Pack (which we use instead of Trunk for flexibility)
18+
# This section is needed for Wasm Pack (which we use instead of Trunk for flexibility)
1919
[lib]
2020
crate-type = ["cdylib", "rlib"]

examples/cli/.perseus/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This crate defines the user's app in terms that WASM can understand, making development significantly simpler.
1+
# This crate defines the user's app in terms that Wasm can understand, making development significantly simpler.
22
# IMPORTANT: spacing matters in this file for runtime replacements, do NOT change it!
33

44
[package]
@@ -23,7 +23,7 @@ console_error_panic_hook = "0.1.6"
2323
urlencoding = "2.1"
2424
futures = "0.3"
2525

26-
# This section is needed for WASM Pack (which we use instead of Trunk for flexibility)
26+
# This section is needed for Wasm Pack (which we use instead of Trunk for flexibility)
2727
[lib]
2828
crate-type = ["cdylib", "rlib"]
2929

examples/cli/.perseus/server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This crate defines the user's app in terms that WASM can understand, making development significantly simpler.
1+
# This crate defines the user's app in terms that Wasm can understand, making development significantly simpler.
22
# IMPORTANT: spacing matters in this file for runtime replacements, do NOT change it!
33

44
[package]

examples/cli/.perseus/server/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::env;
77
#[actix_web::main]
88
async fn main() -> std::io::Result<()> {
99
// So we don't have to define a different `FsConfigManager` just for the server, we shift the execution context to the same level as everything else
10-
// The server has to be a separate crate because otherwise the dependencies don't work with WASM bundling
10+
// The server has to be a separate crate because otherwise the dependencies don't work with Wasm bundling
1111
env::set_current_dir("../").unwrap();
1212

1313
let host = env::var("HOST").unwrap_or_else(|_| "localhost".to_string());

examples/cli/.perseus/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use sycamore::prelude::{template, StateHandle};
88
use sycamore_router::{HistoryIntegration, Router, RouterProps};
99
use wasm_bindgen::{prelude::wasm_bindgen, JsValue};
1010

11-
/// The entrypoint into the app itself. This will be compiled to WASM and actually executed, rendering the rest of the app.
11+
/// The entrypoint into the app itself. This will be compiled to Wasm and actually executed, rendering the rest of the app.
1212
#[wasm_bindgen]
1313
pub fn run() -> Result<(), JsValue> {
1414
// Panics should always go to the console

examples/cli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ sycamore-router = "0.6"
1515
serde = { version = "1", features = ["derive"] }
1616
serde_json = "1" # Possibly don't need?
1717

18-
# This section is needed for WASM Pack (which we use instead of Trunk for flexibility)
18+
# This section is needed for Wasm Pack (which we use instead of Trunk for flexibility)
1919
[lib]
2020
crate-type = ["cdylib", "rlib"]

packages/perseus-actix-web/src/configurer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Options {
1212
/// The locales on the filesystem of the file that will invoke your JavaScript bundle. This should have something like `init()` in
1313
/// it.
1414
pub js_init: String,
15-
/// The location on the filesystem of your WASM bundle.
15+
/// The location on the filesystem of your Wasm bundle.
1616
pub wasm_bundle: String,
1717
/// The location on the filesystem of your `index.html` file that includes the JS bundle.
1818
pub index: String,
@@ -51,7 +51,7 @@ pub async fn configurer<C: ConfigManager + 'static, T: TranslationsManager + 'st
5151
.data(config_manager.clone())
5252
.data(translations_manager.clone())
5353
.data(opts.clone())
54-
// TODO chunk JS and WASM bundles
54+
// TODO chunk JS and Wasm bundles
5555
// These allow getting the basic app code (not including the static data)
5656
// This contains everything in the spirit of a pseudo-SPA
5757
.route("/.perseus/main.js", web::get().to(js_init))

0 commit comments

Comments
 (0)