Skip to content

Conversation

@hanna-skryl
Copy link
Collaborator

@hanna-skryl hanna-skryl commented Jul 7, 2025

Closes #1008

This PR adds support for running Lighthouse on multiple URLs to provide holistic performance and accessibility analysis across different pages.

Key Features

  • Multiple URL input: Accept string | string[] | Record<string, number> for the urls parameter
  • Sequential execution: Run Lighthouse on each URL sequentially
  • URL-specific audits: Generate distinct audit slugs with numbered suffixes (e.g., first-contentful-paint-1, first-contentful-paint-2)
  • URL-specific groups: Create separate groups for each URL with descriptive titles including the URL and slugs including numbered suffixes
  • Category aggregation: Provide mergeLighthouseCategories helper to combine results across URLs
  • Backward compatibility: Single URL functionality remains unchanged

Example Usage

// Single URL (unchanged)
lighthousePlugin('https://example.com')

// Multiple URLs
lighthousePlugin([
  'https://example.com',
  'https://example.com/about',
  'https://example.com/contact'
])

// Multiple weighted URLs
lighthousePlugin({
  'https://example.com': 3,
  'https://example.com/about': 2,
  'https://example.com/contact': 1
})

// Category merging
const plugin = lighthousePlugin(['https://example.com', 'https://example.com/about']);
const categories = mergeLighthouseCategories(plugin, userCategories);

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2025

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit 1e0a15d with previous commit 73c2989.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🟡 57 🟡 57 ↓ −0.4
Code coverage 🟢 90 🟢 90 ↑ +0.2
Documentation 🔴 23 🔴 23 ↓ −0.2
Security 🟡 61 🟡 61
Updates 🟡 77 🟡 77
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Type Safety 🟢 100 🟢 100
Bug prevention 🟢 100 🟢 100
Miscellaneous 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👍 1 group improved, 👎 2 groups regressed, 👍 7 audits improved, 👎 5 audits regressed, 10 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🟡 57 🟡 57 ↓ −0.4
Code coverage Code coverage metrics 🟢 90 🟢 90 ↑ +0.2
JSDoc coverage Documentation coverage 🔴 23 🔴 23 ↓ −0.2

18 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Total Blocking Time 🟥 1,510 ms 🟥 1,940 ms ↑ +28.6 %
Lighthouse First Contentful Paint 🟥 3.0 s 🟨 2.9 s ↓ −3.6 %
Lighthouse Largest Contentful Paint 🟨 3.3 s 🟨 3.2 s ↓ −3.2 %
Lighthouse Speed Index 🟨 5.2 s 🟨 5.1 s ↓ −2.1 %
Lighthouse Time to Interactive 🟥 12.1 s 🟥 12.7 s ↑ +4.3 %
JSDoc coverage Classes coverage 🟥 7 undocumented classes 🟥 8 undocumented classes ↑ +14.3 %
JSDoc coverage Functions coverage 🟥 476 undocumented functions 🟥 494 undocumented functions ↑ +3.8 %
Code coverage Branch coverage 🟨 85.7 % 🟨 86 % ↑ +0.3 %
Code coverage Line coverage 🟨 86.5 % 🟨 86.8 % ↑ +0.3 %
Code coverage Function coverage 🟩 93.1 % 🟩 93.3 % ↑ +0.2 %
JSDoc coverage Types coverage 🟥 223 undocumented types 🟥 227 undocumented types ↑ +1.8 %
JSDoc coverage Variables coverage 🟥 218 undocumented variables 🟥 221 undocumented variables ↑ +1.4 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,941 KiB 🟩 Total size was 1,945 KiB ↑ +0.2 %
Lighthouse Minimizes main-thread work 🟥 10.2 s 🟥 12.1 s ↑ +18.6 %
Lighthouse JavaScript execution time 🟥 4.4 s 🟥 5.5 s ↑ +25.5 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +4.3 %
Lighthouse Max Potential First Input Delay 🟥 1,050 ms 🟥 1,460 ms ↑ +39.3 %
Lighthouse Server Backend Latencies 🟩 230 ms 🟩 80 ms ↓ −62.8 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 63 KiB 🟥 Potential savings of 70 KiB ↓ −31.1 %
Lighthouse Uses efficient cache policy on static assets 🟨 30 resources found 🟨 30 resources found ↑ +0.1 %
Lighthouse Initial server response time was short 🟩 Root document took 430 ms 🟩 Root document took 520 ms ↑ +22.7 %
Lighthouse Network Round Trip Times 🟩 20 ms 🟩 20 ms ↑ +24.8 %

583 other audits are unchanged.

@github-actions github-actions bot added 📖 Project documentation improvements or additions to the project documentation 🧩 models labels Jul 9, 2025
@hanna-skryl hanna-skryl marked this pull request as ready for review July 9, 2025 01:03
@hanna-skryl hanna-skryl requested a review from BioPhoton as a code owner July 9, 2025 01:03
@hanna-skryl hanna-skryl requested a review from matejchalk July 9, 2025 01:03
Copy link
Collaborator

@matejchalk matejchalk left a comment

Choose a reason for hiding this comment

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

Nice work 👍

@hanna-skryl hanna-skryl merged commit f4db136 into main Jul 14, 2025
15 of 18 checks passed
@hanna-skryl hanna-skryl deleted the multiple-lighthouse-urls branch July 14, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧩 cli 🧩 lighthouse-plugin 🧩 models 📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple URLs in Lighthouse plugin

3 participants