Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit e02b54a

Browse files
chore: fix type errors
1 parent ed930dd commit e02b54a

File tree

4 files changed

+55
-17
lines changed

4 files changed

+55
-17
lines changed

.changeset/blue-owls-peel.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@astrojs/cloudflare': major
3+
'@astrojs/netlify': major
4+
---
5+
6+
Removed support for the Squoosh image service. As the underlying library `libsquoosh` is no longer maintained, and the image service sees very little usage we have decided to remove it from Astro.
7+
8+
Our recommendation is to use the base Sharp image service, which is more powerful, faster, and more actively maintained.
9+
10+
```diff
11+
- import { squooshImageService } from "astro/config";
12+
import { defineConfig } from "astro/config";
13+
14+
export default defineConfig({
15+
- image: {
16+
- service: squooshImageService()
17+
- }
18+
});
19+
```
20+
21+
If you are using this service, and cannot migrate to the base Sharp image service, a third-party extraction of the previous service is available here: https://github.com/Princesseuh/astro-image-service-squoosh

.changeset/early-berries-rush.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@astrojs/cloudflare': major
3+
'@astrojs/netlify': major
4+
---
5+
6+
Deprecates the `functionPerRoute` option
7+
8+
This option is now deprecated, and will be removed entirely in Astro v5.0. We suggest removing this option from your configuration as soon as you are able to:
9+
10+
```diff
11+
import { defineConfig } from 'astro/config';
12+
import vercel from '@astrojs/vercel/serverless';
13+
14+
export default defineConfig({
15+
// ...
16+
output: 'server',
17+
adapter: vercel({
18+
- functionPerRoute: true,
19+
}),
20+
});
21+
```

packages/cloudflare/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ export default function createIntegration(args?: Options): AstroIntegration {
155155
serverEntrypoint: '@astrojs/cloudflare/entrypoints/server.js',
156156
exports: ['default'],
157157
adapterFeatures: {
158-
functionPerRoute: false,
159158
edgeMiddleware: false,
160159
},
161160
supportedAstroFeatures: {
@@ -166,7 +165,6 @@ export default function createIntegration(args?: Options): AstroIntegration {
166165
assets: {
167166
supportKind: 'stable',
168167
isSharpCompatible: false,
169-
isSquooshCompatible: false,
170168
},
171169
envGetSecret: 'experimental',
172170
},

packages/netlify/src/index.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ async function writeNetlifyFrameworkConfig(config: AstroConfig, logger: AstroInt
115115
const headers = config.build.assetsPrefix
116116
? undefined
117117
: [
118-
{
119-
for: `${config.base}${config.base.endsWith('/') ? '' : '/'}${config.build.assets}/*`,
120-
values: {
121-
'Cache-Control': 'public, max-age=31536000, immutable',
122-
},
118+
{
119+
for: `${config.base}${config.base.endsWith('/') ? '' : '/'}${config.build.assets}/*`,
120+
values: {
121+
'Cache-Control': 'public, max-age=31536000, immutable',
123122
},
124-
];
123+
},
124+
];
125125

126126
// See https://docs.netlify.com/image-cdn/create-integration/
127127
const deployConfigDir = new URL('.netlify/v1/', config.root);
@@ -259,9 +259,9 @@ export default function netlifyIntegration(
259259
`
260260
import createSSRHandler from './${handler}';
261261
export default createSSRHandler(${JSON.stringify({
262-
cacheOnDemandPages: Boolean(integrationConfig?.cacheOnDemandPages),
263-
notFoundContent,
264-
})});
262+
cacheOnDemandPages: Boolean(integrationConfig?.cacheOnDemandPages),
263+
notFoundContent,
264+
})});
265265
export const config = {
266266
includedFiles: ['**/*'],
267267
name: 'Astro SSR',
@@ -343,7 +343,7 @@ export default function netlifyIntegration(
343343
if (typeof req.headers[header] === 'string') {
344344
try {
345345
return JSON.parse(Buffer.from(req.headers[header] as string, 'base64').toString('utf8'));
346-
} catch {}
346+
} catch { }
347347
}
348348
};
349349

@@ -429,8 +429,8 @@ export default function netlifyIntegration(
429429
},
430430
...((await shouldExternalizeAstroEnvSetup())
431431
? {
432-
ssr: { external: ['astro/env/setup'] },
433-
}
432+
ssr: { external: ['astro/env/setup'] },
433+
}
434434
: {}),
435435
},
436436
image: {
@@ -453,7 +453,6 @@ export default function netlifyIntegration(
453453
serverEntrypoint: '@astrojs/netlify/ssr-function.js',
454454
exports: ['default'],
455455
adapterFeatures: {
456-
functionPerRoute: false,
457456
edgeMiddleware,
458457
},
459458
args: { middlewareSecret } satisfies Args,
@@ -466,7 +465,6 @@ export default function netlifyIntegration(
466465
supportKind: 'experimental',
467466
// still using Netlify Image CDN instead
468467
isSharpCompatible: true,
469-
isSquooshCompatible: true,
470468
},
471469
envGetSecret: 'experimental',
472470
},
@@ -483,7 +481,7 @@ export default function netlifyIntegration(
483481
let notFoundContent = undefined;
484482
try {
485483
notFoundContent = await readFile(new URL('./404.html', dir), 'utf8');
486-
} catch {}
484+
} catch { }
487485
await writeSSRFunction({ notFoundContent, logger });
488486
logger.info('Generated SSR Function');
489487
}

0 commit comments

Comments
 (0)