-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Clarify and reduce Cloudflare adapter integration logs noise #13817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8288710
Clarify and reduce Cloudflare integration logs
yanthomasdev f592fa3
Simplify log
yanthomasdev 6b36145
Move enabling sessions log to only show in build
yanthomasdev 6247780
Use double quotes instead
yanthomasdev ce490e2
Add option to suppress adapter feature support log
yanthomasdev ec46803
Add fixture to test option
yanthomasdev 908afe9
Add changeset
yanthomasdev e5f74a0
Merge branch 'main' into cloudflare-log-improv
yanthomasdev 628a0ce
Merge branch 'cloudflare-log-improv' into suppress-supported-features…
yanthomasdev 7fbd8a6
Apply suggestions from code review
yanthomasdev d30ad27
Merge branch 'main' into suppress-supported-features-log-option
ascorbic 7c8d997
Use `suppress` option instead of hack
yanthomasdev ba9360a
Create fast-planets-shout.md
yanthomasdev ca703e1
Update .changeset/fast-planets-shout.md
yanthomasdev 3191a96
Merge branch 'main' into cloudflare-log-improv
ascorbic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| import type { AstroConfig, AstroIntegrationLogger, HookParameters } from 'astro'; | ||
| import { passthroughImageService, sharpImageService } from 'astro/config'; | ||
|
|
||
| export type ImageService = 'passthrough' | 'cloudflare' | 'compile' | 'custom'; | ||
ascorbic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| export function setImageConfig( | ||
| service: string, | ||
| service: ImageService, | ||
| config: AstroConfig['image'], | ||
| command: HookParameters<'astro:config:setup'>['command'], | ||
| logger: AstroIntegrationLogger, | ||
|
|
@@ -35,7 +37,7 @@ export function setImageConfig( | |
| default: | ||
| if (config.service.entrypoint === 'astro/assets/services/sharp') { | ||
| logger.warn( | ||
| `The current configuration does not support image optimization. To allow your project to build with the original, unoptimized images, the image service has been automatically switched to the 'noop' option. See https://docs.astro.build/en/reference/configuration-reference/#imageservice`, | ||
| `The current configuration does not support image optimization. To allow your project to build with the original, unoptimized images, the image service has been automatically switched to the 'passthrough' option. See https://docs.astro.build/en/reference/configuration-reference/#imageservice`, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A bit of an extra, the option name itself is not |
||
| ); | ||
| return { ...config, service: passthroughImageService() }; | ||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is misleading because in dev it's not using CLoudflare KV. I'd move this inside the conditional block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does say it's Cloudflare KV for production, so I wouldn't think that would apply in dev if I were reading that.
I am not against moving this into the conditional, though! I was thinking, and I guess most people wanting to use Sessions will either look into the docs and configure manually or see the Cloudflare adapter docs and just use the default config, so being reminded of this in dev might not be necessary.