Skip to content

Commit c9637cc

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents c870e22 + 03a5751 commit c9637cc

File tree

816 files changed

+31802
-91
lines changed

Some content is hidden

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

816 files changed

+31802
-91
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defaults:
1111
shell: bash
1212
env:
1313
# Note: when updated, also update version in ensure-cargo-installs
14-
viceroy_version: 0.12.2
14+
viceroy_version: 0.15.0
1515
# Note: when updated, also update version in ensure-cargo-installs ! AND ! release-please.yml
1616
wasm-tools_version: 1.216.0
1717
fastly-cli_version: 10.19.0
@@ -46,7 +46,7 @@ jobs:
4646
matrix:
4747
include:
4848
- crate: viceroy
49-
version: 0.12.2 # Note: workflow-level env vars can't be used in matrix definitions
49+
version: 0.15.0 # Note: workflow-level env vars can't be used in matrix definitions
5050
options: ""
5151
- crate: wasm-tools
5252
version: 1.216.0 # Note: workflow-level env vars can't be used in matrix definitions

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 3.36.0 (2025-11-18)
4+
5+
### Added
6+
7+
* Image Optimizer support ([#1224](https://github.com/fastly/js-compute-runtime/issues/1224)) ([c3dd3de](https://github.com/fastly/js-compute-runtime/commit/c3dd3de7436f999055eb0b3d83a1f59c1c26b5d1))
8+
* Implement 103 Early Hints ([#1217](https://github.com/fastly/js-compute-runtime/issues/1217)) ([fda6ad3](https://github.com/fastly/js-compute-runtime/commit/fda6ad31d6f8ceee16cd950217be770a4f794bb3))
9+
10+
### Fixed
11+
12+
* **fanout:** commit request headers before fanout handoff ([#1222](https://github.com/fastly/js-compute-runtime/issues/1222)) ([8dfefad](https://github.com/fastly/js-compute-runtime/commit/8dfefadec46a2714be010c4a8c7e59cd43537fec))
13+
* Fix broken KVStore test ([#1223](https://github.com/fastly/js-compute-runtime/issues/1223)) ([6055d88](https://github.com/fastly/js-compute-runtime/commit/6055d884f617336d8d6326bf26dcfb49265f5ae2))
14+
315
## 3.35.2 (2025-11-07)
416

517
### Fixed

documentation/app/package-lock.json

Lines changed: 17 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

documentation/docs/globals/fetch.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ fetch(resource, options)
7676
- *Fastly-specific*
7777
- `cacheOverride` _**Fastly-specific**_
7878
- `cacheKey` _**Fastly-specific**_
79+
- `imageOptimizerOptions` _**Fastly-specific**_, see [`imageOptimizerOptions`](../../fastly:image-optimizer/imageOptimizerOptions.mdx).
7980
- `fastly` _**Fastly-specific**_
8081
- `decompressGzip`_: boolean_ _**optional**_
8182
- Whether to automatically gzip decompress the Response or not.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# `Auto`
9+
10+
Enumerator options for [`imageOptimizerOptions.auto`](./imageOptimizerOptions.mdx).
11+
12+
## Constants
13+
14+
- `AVIF` (`"avif"`) If the browser's Accept header indicates compatibility, deliver an AVIF image.
15+
- `WEBP` (`"webp"`) If the browser's Accept header indicates compatibility, deliver a WebP image.
16+
17+
## Examples
18+
19+
```js
20+
import { Auto, Region } from 'fastly:image-optimizer';
21+
22+
addEventListener("fetch", (event) => event.respondWith(handleRequest(event)));
23+
24+
async function handleRequest(event) {
25+
return await fetch('https://www.w3.org/Graphics/PNG/text2.png', {
26+
imageOptimizerOptions: {
27+
region: Region.UsEast,
28+
auto: Auto.AVIF
29+
},
30+
backend: 'w3'
31+
});
32+
}
33+
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# `BWAlgorithm`
9+
10+
Enumerator options for [`imageOptimizerOptions.bw`](./imageOptimizerOptions.mdx).
11+
12+
## Constants
13+
14+
- `Threshold` (`"threshold"`) Uses a luminance threshold to convert the image to black and white.
15+
- `Atkinson` (`"atkinson"`) Uses [Atkinson dithering](https://en.wikipedia.org/wiki/Atkinson_dithering) to convert the image to black and white.
16+
17+
18+
## Examples
19+
20+
```js
21+
import { Region, BWAlgorithm } from 'fastly:image-optimizer';
22+
23+
addEventListener("fetch", (event) => event.respondWith(handleRequest(event)));
24+
25+
async function handleRequest(event) {
26+
return await fetch('https://www.w3.org/Graphics/PNG/text2.png', {
27+
imageOptimizerOptions: {
28+
region: Region.UsEast,
29+
bw: BWAlgorithm.Threshold
30+
},
31+
backend: 'w3'
32+
});
33+
}
34+
```
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# `CropMode`
9+
10+
Enumerator options for [`imageOptimizerOptions.crop.mode`](./imageOptimizerOptions.mdx) and `imageOptimizerOptions.precrop.mode`.
11+
12+
## Constants
13+
14+
- `Smart` (`"smart"`) Enables content-aware algorithms to attempt to crop the image to the desired aspect ratio while intelligently focusing on the most important visual content, including the detection of faces.
15+
- `Safe` (`"safe"`) Allow cropping out-of-bounds regions.
16+
17+
## Examples
18+
19+
```js
20+
import { CropMode, Region } from 'fastly:image-optimizer';
21+
22+
addEventListener("fetch", (event) => event.respondWith(handleRequest(event)));
23+
24+
async function handleRequest(event) {
25+
return await fetch('https://www.w3.org/Graphics/PNG/text2.png', {
26+
imageOptimizerOptions: {
27+
region: Region.UsEast,
28+
crop: {
29+
size: { ratio: { width: 4, height: 3 } },
30+
mode: CropMode.Smart,
31+
}
32+
},
33+
backend: 'w3'
34+
});
35+
}
36+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# `Disable`
9+
10+
Enumerator options for [`imageOptimizerOptions.disable`](./imageOptimizerOptions.mdx).
11+
12+
## Constants
13+
14+
- `Upscale` (`"upscale"`) Prevent images being resized such that the output image's dimensions are larger than the source image.
15+
16+
## Examples
17+
18+
```js
19+
import { Disable, Region } from 'fastly:image-optimizer';
20+
21+
addEventListener("fetch", (event) => event.respondWith(handleRequest(event)));
22+
23+
async function handleRequest(event) {
24+
return await fetch('https://www.w3.org/Graphics/PNG/text2.png', {
25+
imageOptimizerOptions: {
26+
region: Region.UsEast,
27+
width: 2560,
28+
disable: Disable.Upscale
29+
},
30+
backend: 'w3'
31+
});
32+
}
33+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# `Enable`
9+
10+
Enumerator options for [`imageOptimizerOptions.enable`](./imageOptimizerOptions.mdx).
11+
12+
## Constants
13+
14+
- `Upscale` (`"upscale"`) Allow images to be resized such that the output image's dimensions are larger than the source image.
15+
16+
## Examples
17+
18+
```js
19+
import { Enable, Region } from 'fastly:image-optimizer';
20+
21+
addEventListener("fetch", (event) => event.respondWith(handleRequest(event)));
22+
23+
async function handleRequest(event) {
24+
return await fetch('https://www.w3.org/Graphics/PNG/text2.png', {
25+
imageOptimizerOptions: {
26+
region: Region.UsEast,
27+
width: 2560,
28+
enable: Enable.Upscale
29+
},
30+
backend: 'w3'
31+
});
32+
}
33+
```
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# `Fit`
9+
10+
Enumerator options for [`imageOptimizerOptions.fit`](./imageOptimizerOptions.mdx).
11+
12+
## Constants
13+
14+
- `Bounds` (`"bounds"`) Resize the image to fit entirely within the specified region, making one dimension smaller if needed.
15+
- `Cover` (`"cover"`) Resize the image to entirely cover the specified region, making one dimension larger if needed.
16+
- `Crop` (`"crop"`) Resize and crop the image centrally to exactly fit the specified region.
17+
18+
## Examples
19+
20+
```js
21+
import { Fit, Region } from 'fastly:image-optimizer';
22+
23+
addEventListener("fetch", (event) => event.respondWith(handleRequest(event)));
24+
25+
async function handleRequest(event) {
26+
return await fetch('https://www.w3.org/Graphics/PNG/text2.png', {
27+
imageOptimizerOptions: {
28+
region: Region.UsEast,
29+
width: 150,
30+
height; 150,
31+
fit: Fit.Bounds
32+
},
33+
backend: 'w3'
34+
});
35+
}
36+
```

0 commit comments

Comments
 (0)