Skip to content

Commit acfb8e0

Browse files
chore(main): release 3.33.0 (#1139)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: guybedford <[email protected]>
1 parent a735993 commit acfb8e0

File tree

748 files changed

+27367
-437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

748 files changed

+27367
-437
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 3.33.0 (2025-03-12)
4+
5+
### Added
6+
7+
* add support for EventTarget ([#1145](https://github.com/fastly/js-compute-runtime/issues/1145)) ([a735993](https://github.com/fastly/js-compute-runtime/commit/a735993e609b5e2405a5223e7bc02ef655a47d68))
8+
* FormData support and Request.formData and Response.formData ([#1144](https://github.com/fastly/js-compute-runtime/issues/1144)) ([0214ae7](https://github.com/fastly/js-compute-runtime/commit/0214ae70b8d5afd1bc66231d779af5b606e89efb))
9+
10+
### Fixed
11+
12+
* Backend.prototype.health method definition ([#1143](https://github.com/fastly/js-compute-runtime/issues/1143)) ([42d429b](https://github.com/fastly/js-compute-runtime/commit/42d429bafdd7ec02854217675bdb58eba1e533a4))
13+
* Weval stack overflow bug ([#1135](https://github.com/fastly/js-compute-runtime/issues/1135)) ([f6947d9](https://github.com/fastly/js-compute-runtime/commit/f6947d9eb9fcd10f91c8c439a8a5cd6db8169d9e))
14+
315
## 3.32.2 (2025-02-26)
416

517
### Fixed

documentation/app/package-lock.json

+116-116
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

documentation/package-lock.json

+304-318
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# Acl.open()
9+
10+
Opens the ACL with the given name, returning a new `Acl` instance with the given name on success.
11+
12+
## Syntax
13+
14+
```js
15+
Acl.open(name)
16+
```
17+
18+
### Return value
19+
20+
An `Acl` instance.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# Acl.prototype.lookup()
9+
10+
The **`lookup(ipAddress)`** method returns the name associated with the `Acl` instance.
11+
12+
## Syntax
13+
14+
```js
15+
acl.lookup(ipAddress)
16+
```
17+
18+
### Parameters
19+
20+
- `ipAddress` _: string_
21+
- IPv4 or IPv6 address to lookup
22+
23+
### Return value
24+
25+
An Object of the form `{ action: 'ALLOW' | 'BlOCK', prefix: string }`, where `prefix` is the IP
26+
address prefix that was matched in the ACL.
27+
28+
## Example
29+
30+
```js
31+
/// <reference types="@fastly/js-compute" />
32+
import { Acl } from 'fastly:acl';
33+
addEventListener('fetch', async (evt) => {
34+
const myAcl = Acl.open('myacl');
35+
const match = await myAcl.lookup(evt.client.address);
36+
evt.respondWith(new Response(match?.action === 'BLOCK' ? 'blocked' : 'allowed'));
37+
});
38+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
import {Fiddle} from '@site/src/components/fiddle';
8+
9+
# `Backend()`
10+
11+
The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service.
12+
13+
>**Note**: Dynamic backends are by default disabled at the Fastly service level. Contact [Fastly Support](https://support.fastly.com/hc/en-us/requests/new?ticket_form_id=360000269711) to request dynamic backends on Fastly Services.
14+
15+
To disable the usage of dynamic backends, see [enforceExplicitBackends](../enforceExplicitBackends.mdx).
16+
17+
## Syntax
18+
19+
```js
20+
new Backend(backendConfiguration)
21+
```
22+
23+
> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx).
24+
25+
### Parameters
26+
27+
- `backendConfiguration`
28+
29+
- : An Object which contains all the configuration options to apply to the newly created Backend.
30+
31+
- `name` _: string_
32+
- The name of the backend.
33+
- The name has to be between 1 and 254 characters inclusive.
34+
- The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application.
35+
- Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters.
36+
- `target` _: string_
37+
- A hostname, IPv4, or IPv6 address for the backend as well as an optional port.
38+
- The target has to be at-least 1 character.
39+
- Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::`
40+
- `hostOverride` _: string_ _**optional**_
41+
- If set, will force the HTTP Host header on connections to this backend to be the supplied value.
42+
- Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string.
43+
- `connectTimeout` _: number_ _**optional**_
44+
- Maximum duration in milliseconds to wait for a connection to this backend to be established.
45+
- If exceeded, the connection is aborted and a 503 response will be presented instead.
46+
- Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32
47+
- `firstByteTimeout` _: number_ _**optional**_
48+
- Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent.
49+
- If exceeded, the connection is aborted and a 503 response will be presented instead.
50+
- Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32
51+
- `betweenBytesTimeout` _: number_ _**optional**_
52+
- Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend.
53+
- If exceeded, the response received so far will be considered complete and the fetch will end.
54+
- Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32
55+
- `useSSL` _: boolean_ _**optional**_
56+
- Whether or not to require TLS for connections to this backend.
57+
- `dontPool` _: boolean_ _**optional**_
58+
- Determine whether or not connections to the same backend should be pooled across different sessions.
59+
- Fastly considers two backends “the same” if they're registered with the same name and the exact same settings.
60+
- In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2.
61+
- This can help improve backend latency, by removing the need for the initial network / TLS handshake(s).
62+
- By default, pooling is enabled for dynamic backends.
63+
- `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_
64+
- Minimum allowed TLS version on SSL connections to this backend.
65+
- If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead.
66+
- Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3
67+
- `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_
68+
- Maximum allowed TLS version on SSL connections to this backend.
69+
- If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead.
70+
- Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3
71+
- `certificateHostname` _: string_ _**optional**_
72+
- Define the hostname that the server certificate should declare.
73+
- Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string.
74+
- `caCertificate` _: string_ _**optional**_
75+
- The CA certificate to use when checking the validity of the backend.
76+
- Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string.
77+
- `ciphers` _: string_ _**optional**_
78+
- List of OpenSSL ciphers to support for connections to this origin.
79+
- If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead.
80+
- [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration).
81+
- Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string.
82+
- `sniHostname` _: string_ _**optional**_
83+
- The SNI hostname to use on connections to this backend.
84+
- Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string.
85+
- `clientCertificate` _: object_ _**optional**_
86+
- The client certificate to provide for the TLS handshake
87+
- `certificate` _: string_
88+
- The PEM certificate string.
89+
- `key` _: SecretStoreEntry_
90+
- The `SecretStoreEntry` to use for the key, created via [`SecretStore.prototype.get`](../../fastly:secret-store/SecretStore/prototype/get.mdx) or alteratively via [`SecretStore.fromBytes`](../../fastly:secret-store/SecretStore/fromBytes.mdx).
91+
- `httpKeepalive` _: number_ _**optional**_
92+
- Enable HTTP keepalive, setting the timout in milliseconds.
93+
- `tcpKeepalive` _: boolean | object_ _**optional**_
94+
- Enable TCP keepalive. When an object, optionally setting the keepalive configuration options.
95+
- `timeSecs` _: number_ _**optional**_
96+
- Configure how long to wait after the last sent data over the TCP connection before starting to send TCP keepalive probes.
97+
- `intervalSecs` _: number_ _**optional**_
98+
- Configure how long to wait between each TCP keepalive probe sent to the backend to determine if it is still active.
99+
- `probes` _: number_ _**optional**_
100+
- Number of probes to send to the backend before it is considered dead.
101+
- `grpc` _: boolean_ _**optional**_
102+
- **_Experimental feature_**
103+
- When enabled, sets that this backend is to be used for gRPC traffic.
104+
- _Warning: When using this experimental feature, no guarantees are provided for behaviours for backends that do not provide gRPC traffic._
105+
106+
All optional generic options can have their defaults set via [`setDefaultDynamicBackendConfig()`](../setDefaultDynamicBackendConfig.mdx).
107+
108+
This includes all configuration options above except for `name`, `target`, `hostOverride`, `sniHostname` and `grpc`.
109+
110+
### Return value
111+
112+
A new `Backend` object.
113+
114+
## Examples
115+
116+
In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client.
117+
118+
<Fiddle config={{
119+
"type": "javascript",
120+
"title": "Explicit Dynamic Backend Example",
121+
"origins": [
122+
"https://http-me.glitch.me"
123+
],
124+
"src": {
125+
"deps": "{\n \"@fastly/js-compute\": \"^1.0.1\"\n}",
126+
"main": `
127+
/// <reference types="@fastly/js-compute" />
128+
import { Backend } from "fastly:backend";
129+
async function app() {
130+
// For any request, return the fastly homepage -- without defining a backend!
131+
const backend = new Backend({
132+
name: 'fastly',
133+
target: 'fastly.com',
134+
hostOverride: "www.fastly.com",
135+
connectTimeout: 1000,
136+
firstByteTimeout: 15000,
137+
betweenBytesTimeout: 10000,
138+
useSSL: true,
139+
tlsMinVersion: 1.3,
140+
tlsMaxVersion: 1.3,
141+
});
142+
return fetch('https://www.fastly.com/', {
143+
backend // Here we are configuring this request to use the backend from above.
144+
});
145+
}
146+
addEventListener("fetch", event => event.respondWith(app(event)));
147+
`
148+
},
149+
"requests": [
150+
{
151+
"enableCluster": true,
152+
"enableShield": false,
153+
"enableWAF": false,
154+
"method": "GET",
155+
"path": "/status=200",
156+
"useFreshCache": false,
157+
"followRedirects": false,
158+
"tests": "",
159+
"delay": 0
160+
}
161+
],
162+
"srcVersion": 1
163+
}}>
164+
165+
```js
166+
/// <reference types="@fastly/js-compute" />
167+
import { Backend } from "fastly:backend";
168+
async function app() {
169+
// For any request, return the fastly homepage -- without defining a backend!
170+
const backend = new Backend({
171+
name: 'fastly',
172+
target: 'fastly.com',
173+
hostOverride: "www.fastly.com",
174+
connectTimeout: 1000,
175+
firstByteTimeout: 15000,
176+
betweenBytesTimeout: 10000,
177+
useSSL: true,
178+
tlsMinVersion: 1.3,
179+
tlsMaxVersion: 1.3,
180+
});
181+
return fetch('https://www.fastly.com/', {
182+
backend // Here we are configuring this request to use the backend from above.
183+
});
184+
}
185+
addEventListener("fetch", event => event.respondWith(app(event)));
186+
```
187+
188+
</Fiddle>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# Backend.exists()
9+
10+
The **`Backend.exists()`** method returns a boolean indicating if a Backend with the given name exists or not.
11+
12+
## Syntax
13+
14+
```js
15+
exists(name)
16+
```
17+
18+
### Return value
19+
20+
A boolean indicating if a Backend with the given name exists or not.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# Backend.fromName()
9+
10+
Returns the `Backend` instance with the given name, if one exists. If one does not exist, an error is thrown.
11+
12+
## Syntax
13+
14+
```js
15+
fromName(name)
16+
```
17+
18+
### Return value
19+
20+
A `Backend` instance.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# Backend.health()
9+
10+
:::info
11+
12+
This method is deprecated, use [`Backend.prototype.health`](./prototype/health.mdx) instead.
13+
14+
:::
15+
16+
The **`Backend.health()`** method returns a string representing the health of the given Backend instance.
17+
18+
## Syntax
19+
20+
```js
21+
Backend.health(backend)
22+
```
23+
24+
### Return value
25+
26+
A string representing the health of the specified Backend value.
27+
28+
Possible values are:
29+
- `"healthy"` - The backend's health check has succeeded, indicating the backend is working as expected and should receive requests.
30+
- `"unhealthy"` - The backend's health check has failed, indicating the backend is not working as expected and should not receive requests.
31+
- `"unknown"` - The backend does not have a health check configured.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# Backend.betweenBytesTimeout
9+
10+
The read-only **`betweenBytesTimeout`** property of a `Backend` instance is an integer number
11+
providing the between bytes timeout for this backend in milliseconds.
12+
13+
When not set or in environments that do not support this property (such as Viceroy), `null`
14+
may be returned.
15+
16+
## Value
17+
18+
A `number` or `null`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# Backend.connectTimeout
9+
10+
The read-only **`connectTimeout`** property of a `Backend` instance is an integer number
11+
providing the connect timeout for this backend in milliseconds.
12+
13+
When not set or in environments that do not support this property (such as Viceroy), `null`
14+
may be returned.
15+
16+
## Value
17+
18+
A `number` or `null`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# Backend.firstByteTimeout
9+
10+
The read-only **`firstByteTimeout`** property of a `Backend` instance is an integer number
11+
providing the first byte timeout for this backend in milliseconds.
12+
13+
When not set or in environments that do not support this property (such as Viceroy), `null`
14+
may be returned.
15+
16+
## Value
17+
18+
A `number` or `null`.

0 commit comments

Comments
 (0)