Skip to content

[UXIT-3331][filecoin.io V3] Address Lighthouse audit issues - Fix performance score [skip percy]#2142

Open
barbaraperic wants to merge 2 commits intomainfrom
bp/fix-performance-issues
Open

[UXIT-3331][filecoin.io V3] Address Lighthouse audit issues - Fix performance score [skip percy]#2142
barbaraperic wants to merge 2 commits intomainfrom
bp/fix-performance-issues

Conversation

@barbaraperic
Copy link
Collaborator

@barbaraperic barbaraperic commented Feb 5, 2026

📝 Description

The blog listing page had poor Lighthouse performance scores:

  • FCP: 1.3s
  • LCP: 1.7s
  • Render-blocking CSS causing ~170ms delay

Stripped the content field from blog posts before passing to the client component, as serializing the full markdown content of 716 posts was causing significant rendering delays.

🛠️ Key Changes

  • Created BlogPostPreview type that omits content
  • Blog listing now only sends metadata needed for display (title, slug, excerpt, categories, image, date, author)
  • Updated BlogPostList and postMatchesCategory to use the new type

📸 Screenshots

blog

Screenshot 2026-02-05 at 12 01 14

blog/:slug

Screenshot 2026-02-05 at 12 00 23

… from posts. Update postMatchesCategory function to accept BlogPostPreview. Clean up imports in CardImage component.
@barbaraperic barbaraperic self-assigned this Feb 5, 2026
@notion-workspace
Copy link

@vercel
Copy link

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
filecoin-foundation-site Ready Ready Preview, Comment Feb 5, 2026 0:17am
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
ffdweb-site Skipped Skipped Feb 5, 2026 0:17am
filecoin-foundation-uxit Skipped Skipped Feb 5, 2026 0:17am
filecoin-site Skipped Skipped Feb 5, 2026 0:17am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the blog listing page's Lighthouse performance scores by reducing the data serialized and sent to the client. The main performance issue was caused by serializing the full markdown content of all 716 blog posts when only metadata was needed for the listing view.

Changes:

  • Created BlogPostPreview type that omits the content field from BlogPost
  • Updated blog listing page to strip content before passing posts to the client component
  • Updated type signatures in components that only need preview data
  • Removed unused clsx import from CardImage component

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/ui-filecoin/src/components/Card/CardImage.tsx Removed unused clsx import
apps/filecoin-site/src/app/[locale]/blog/types/blogPostType.ts Added new BlogPostPreview type that omits the content field
apps/filecoin-site/src/app/[locale]/blog/utils/postMatchesCategory.ts Updated function signature to accept BlogPostPreview instead of BlogPost
apps/filecoin-site/src/app/[locale]/blog/components/BlogPostList.tsx Updated component to accept and use BlogPostPreview type
apps/filecoin-site/src/app/[locale]/blog/page.tsx Strips content field from posts before passing to client component
Comments suppressed due to low confidence (1)

apps/filecoin-site/src/app/[locale]/blog/page.tsx:39

  • For consistency with the performance optimization goal, consider using postsWithoutContent instead of sortedPosts here. While generateStructuredData only accesses the slug and title fields and doesn't use content, using the stripped version would be more consistent with the rest of the changes and makes the intent clearer.
      <StructuredDataScript
        structuredData={generateStructuredData(BLOG_SEO, sortedPosts)}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@CharlyMartin CharlyMartin left a comment

Choose a reason for hiding this comment

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

@barbaraperic, I totally agree that removing content will help reduce load significantly.

One thing I find odd is that we fetch content, only to remove it later. This seems wasteful.

How would you feel about adding a withContent param to the fetching function and then creating a new helper getBlogPostsPreviewData that returns just the metadata? (Everything but the content)

What do you think?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants