Skip to content

Commit 0b6d333

Browse files
Upgrade sidecar-browsershot-layer and use Puppeteer v24 (#153)
* Add Variable for sidecar-browsershot-layer * Upgrade Pixelmatch * Bump spatie/pixelmatch-php to v1.2
1 parent 0d566f4 commit 0b6d333

4 files changed

Lines changed: 20 additions & 12 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"phpstan/phpstan-phpunit": "^1.0|^2.0",
3939
"phpunit/phpunit": "^11.0 | ^12.0",
4040
"spatie/image": "^3.3",
41-
"spatie/pixelmatch-php": "^1.0"
41+
"spatie/pixelmatch-php": "^1.2"
4242
},
4343
"autoload": {
4444
"psr-4": {

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"name": "sidecar-browsershot",
33
"version": "1.0.0",
44
"dependencies": {
5-
"pixelmatch": "^5.3.0"
5+
"pixelmatch": "^7.1"
66
}
77
}

src/Functions/BrowsershotFunction.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,17 @@ public function layers()
146146
$chromeAwsLambdaVersion = 53;
147147
}
148148

149+
if ($region === 'us-east-1') {
150+
$sidecarBrowsershotLayerVersion = 5;
151+
} else {
152+
$sidecarBrowsershotLayerVersion = 4;
153+
}
154+
149155
// Add Layers that each contain `puppeteer-core` and `@sparticuz/chromium`
150156
// https://github.com/stefanzweifel/sidecar-browsershot-layer
151157
// https://github.com/shelfio/chrome-aws-lambda-layer
152158
return [
153-
"arn:aws:lambda:{$region}:821527532446:layer:sidecar-browsershot-layer:2",
159+
"arn:aws:lambda:{$region}:821527532446:layer:sidecar-browsershot-layer:{$sidecarBrowsershotLayerVersion}",
154160
"arn:aws:lambda:{$region}:764866452798:layer:chrome-aws-lambda:{$chromeAwsLambdaVersion}",
155161
];
156162
}

0 commit comments

Comments
 (0)