Skip to content
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

Bring env files into alignment, some corrections; image loading strategy for event #820

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

timcosgrove
Copy link
Contributor

@timcosgrove timcosgrove commented Nov 25, 2024

Description

The PR addresses issues found during production testing of Events & Event Listings:

  • vets-website generated assets were loading from next-build S3 rather than from their dedicated vets-website S3 buckets, which was significantly slower
  • The main event image was lazy-loading above the folder, causing significant repaints, which lowered our Lighthouse score.

Ticket

department-of-veterans-affairs/va.gov-cms#19859

Developer Task

Tasks

Preview Give feedback

Testing Steps

Explain the steps needed for testing

QA steps

What needs to be checked to prove this works?
What needs to be checked to prove it didn't break any related things?
What variations of circumstances (users, actions, values) need to be checked?

Screenshots

Before:
After:

Is this PR blocked by another PR?

  • Add the DO NOT MERGE label
  • Add links to additional PRs here:

Reviewer

Reviewing a PR

This section lists items that need to be checked or updated when making changes to this repository.

Standard Checks

Tasks

Preview Give feedback

Merging an Approved Layout

When merging a layout, you must ensure that the content type has been turned on for next-build inside the CMS. This CMS flag must be turned on for editors to preview their work using the next build preview server.

Resource types (layouts) that have not been approved by design should NOT be pushed to production. Ensure that slug.tsx does not include your resource type if it is not approved.

The status of layouts should be kept up to date inside templates.md. This includes QA progress, development progress, etc. A link should be provided for where testing can occur.

Merging a Non-Approved Layout

Your new resource type should not be included inside slug.tsx. Items added here will go into production once merged into the main branch. It is imperative that we do not push anything live that has not been approved.

Ensure that this layout has been added to the templates.md file with the current status of the work.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 25, 2024 19:29 Destroyed
@@ -1,11 +1,19 @@
# This is the standard lower environment for Content API.
# Domain for the CMS Content API
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the env changes are formatting & standardization, except as noted.

NEXT_PUBLIC_BUILD_TYPE=vagovdev

# Location to load vets-website assets
NEXT_PUBLIC_ASSETS_URL=https://dev-va-gov-assets.s3-us-gov-west-1.amazonaws.com/generated/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary for vets-website assets to be pulled from their S3 bucket; otherwise, they get pulled from dev.va.gov/generated/, which tries to resolve to the next-build/content-build buckets. This works but it is much slower than sourcing from the vets-website bucket.

NEXT_PUBLIC_BUILD_TYPE=vagovprod

# Location to load vets-website assets
NEXT_PUBLIC_ASSETS_URL=https://prod-va-gov-assets.s3-us-gov-west-1.amazonaws.com/generated/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same note as above: this makes vets-website assets load much faster.

NEXT_PUBLIC_BUILD_TYPE=vagovstaging

# Location to load vets-website assets
NEXT_PUBLIC_ASSETS_URL=https://staging-va-gov-assets.s3-us-gov-west-1.amazonaws.com/generated/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@@ -67,6 +67,7 @@ export const MediaImage = (
title={props.title}
className={props.className}
style={props.style}
loading={props.loading}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows us to pass the loading prop to Next.js's <Image /> component. We do this to avoid lazy loading in the image below.

@@ -88,6 +88,7 @@ export const Event = ({
className="event-detail-img vads-u-margin-bottom--3 medium-screen:vads-u-margin-bottom--4"
{...image}
imageStyle="7_2_medium_thumbnail"
loading="eager"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This image is always above the fold. Previously it was lazy-loading, which caused a large content repaint late in page render. This forces the image to load immediately, which is actually better for page rendering.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 25, 2024 19:47 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 25, 2024 19:52 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 25, 2024 19:56 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 25, 2024 20:09 Destroyed
@timcosgrove timcosgrove merged commit 2ce5dbb into main Nov 26, 2024
12 checks passed
@timcosgrove timcosgrove deleted the events-prod-testing-adjustments branch November 26, 2024 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants