Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Sep 18, 2024
1 parent 25e48d0 commit f495cf5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions documentation/docs/running-and-building.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ To serve[^3] the web application:
[^3]: Note that Flutter apps in debug mode are known to be quite slow on the web. It is recommended to use release mode when testing on a web browser. Debug mode can be used if you need to analyze the code more deeply, without the `--release` argument.

```bash title="CLI"
rinf wasm --release
flutter run --release # Choose a browser
rinf wasm
flutter run --web-header=Cross-Origin-Opener-Policy=same-origin --web-header=Cross-Origin-Embedder-Policy=require-corp
```

To build the optimized release version of the web application[^4]:
Expand All @@ -42,6 +42,12 @@ rinf wasm --release
flutter build web
```

Since repeatedly writing web header arguments during development can be overwhelming, Rinf provides a convenient command that prints the full Flutter web command.

```bash title="CLI"
rinf server
```

When deploying your web app on a web server, ensure that your web server is configured to include cross-origin-related HTTP headers in its responses. These headers enable web browsers using your website to gain access to `SharedArrayBuffer` web API, which is something similar to shared memory on the web.

- [`Cross-Origin-Opener-Policy`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy): `same-origin`
Expand Down

0 comments on commit f495cf5

Please sign in to comment.