You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+72-1Lines changed: 72 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The JS Compute Runtime for Fastly's [Compute@Edge platform](https://www.fastly.c
8
8
9
9
Note that this repository uses Git submodules, so you will need to run
10
10
11
-
```
11
+
```sh
12
12
git submodule update --recursive --init
13
13
```
14
14
@@ -21,13 +21,63 @@ To build from source, you need to ensure that the headers and object files for t
21
21
(cd c-dependencies/spidermonkey && sh download-engine.sh)
22
22
```
23
23
24
+
24
25
Alternatively, the engine can also be built from source using `c-dependencies/spidermonkey/build-engine.sh`. That should only be required if you want to modify the engine itself, however.
25
26
27
+
In additon you need to have the following tools installed to successfully build, and build from a linux based system.
28
+
29
+
- Rust
30
+
```
31
+
curl -so rust.sh https://sh.rustup.rs && sh rust.sh -y
- rust version - the rust version may need to be pinned due to the WASI spidermonkey version, the current version can be found at [main.yml](.github/workflows/main.yml) under "Install pinned Rust version and wasm32-wasi target"
58
+
```
59
+
rustup update 1.57.0 --no-self-update
60
+
rustup default 1.57.0
61
+
```
62
+
26
63
Once that is done, the runtime and the CLI tool for applying it to JS source code can be built using cargo:
27
64
```sh
28
65
cargo build --release
29
66
```
30
67
68
+
#### Build a windows executable
69
+
To build for windows on a linux system you need to install the following modules:
The JS Compute Runtime doesn't currently contain automated tests itself. Instead, Fastly runs an automated test suite for an internal repository for the JavaScript SDK using the runtime.
@@ -43,6 +93,20 @@ addEventListener('fetch', e => {
43
93
console.log("Hello World!");
44
94
});
45
95
```
96
+
Create a fastly.toml file which is required for the application to run:
97
+
```toml
98
+
# This file describes a Fastly Compute@Edge package. To learn more visit:
into a C@E service with your build of the CLI tool, run the following command:
47
111
```sh
48
112
cargo run --release -- test.js test.wasm
@@ -52,3 +116,10 @@ Then test your service in Viceroy:
52
116
```sh
53
117
viceroy test.wasm
54
118
```
119
+
120
+
## Testing a Dev Release
121
+
:warning:**You should not use this for production workloads!!!!!!!!**
122
+
123
+
Dev builds are released before production releases to allow for further testing. These are not released upstream to NPM, however you can acquire them from the [Releases](https://github.com/fastly/js-compute-runtime/releases/) section. Download the runtime for your platform, extract the executable and place it in the /node_modules/@fastly/js-compute/bin/PLATFORM folder of your Compute@Edge project. Then you can use the normal [Fastly CLI](https://github.com/fastly/cli) to build your service.
124
+
125
+
Please submit an [issue](https://github.com/fastly/js-compute-runtime/issues) if you find any problems during testing.
0 commit comments