Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR prevents the development environment from being indexed and adds an OpenGraph image to improve social sharing.
- Removed the client-only directive from the image loader module.
- Updated metadata in layout and article pages to include OpenGraph images and no-index robots directives.
- Extended AWS configuration to pass a no-index flag via environment variables.
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/image-loader.ts | Removed 'use client' directive, shifting the file's execution context. |
| frontend/src/app/layout.tsx | Added metadataBase, openGraph images, and robots configuration based on environment variables. |
| frontend/src/app/(public-area)/articles/[slug]/page.tsx | Updated metadata generation to include inherited OpenGraph images. |
| frontend/next.config.ts | Configured the custom image loader with unoptimized mode enabled. |
| aws/lib/regional-stack.ts | Introduced a new noIndex prop and added NEXT_PUBLIC_NO_INDEX to the environment variables. |
| aws/lib/environment.ts | Propagated the noIndex property into the environment configuration. |
Files not reviewed (1)
- frontend/Dockerfile: Language not supported
Comments suppressed due to low confidence (1)
frontend/src/image-loader.ts:1
- Verify that the removal of the 'use client' directive is intentional, as this change could affect the runtime context of the imageLoader function if client-side execution was expected.
-'use client';
| @@ -7,6 +7,7 @@ const nextConfig: NextConfig = { | |||
| ? { | |||
| loader: 'custom', | |||
| loaderFile: './src/image-loader.ts', | |||
There was a problem hiding this comment.
Ensure that setting 'unoptimized: true' for the custom image loader is a deliberate decision, as it may impact image performance and optimization.
Suggested change
| loaderFile: './src/image-loader.ts', | |
| loaderFile: './src/image-loader.ts', | |
| // Setting `unoptimized: true` because image optimization is handled externally by the CDN. |
| NEXT_PUBLIC_CDN_URL: `https://${s3BucketDistDomainName}/public/frontend`, | ||
| NEXT_PUBLIC_PUBLIC_S3_BUCKET_NAME: publicS3BucketName, | ||
| NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: props.stripePublishableKey, | ||
| NEXT_PUBLIC_NO_INDEX: props.noIndex ? 'true' : '', |
There was a problem hiding this comment.
Consider explicitly setting NEXT_PUBLIC_NO_INDEX to 'false' when props.noIndex is not provided, instead of an empty string, to ensure consistent boolean handling.
Suggested change
| NEXT_PUBLIC_NO_INDEX: props.noIndex ? 'true' : '', | |
| NEXT_PUBLIC_NO_INDEX: props.noIndex ? 'true' : 'false', |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What It Does
Prevents dev from being indexed and adds OpenGraph image.