Skip to content

fix: web-core background thread module coverage#2463

Merged
PupilTong merged 1 commit intolynx-family:mainfrom
PupilTong:p/hw/fix-coverage-after-use-html-head
Apr 15, 2026
Merged

fix: web-core background thread module coverage#2463
PupilTong merged 1 commit intolynx-family:mainfrom
PupilTong:p/hw/fix-coverage-after-use-html-head

Conversation

@PupilTong
Copy link
Copy Markdown
Collaborator

@PupilTong PupilTong commented Apr 14, 2026

Summary by CodeRabbit

  • Chores
    • Expanded test coverage reporting to discover and aggregate coverage from additional source files
    • Enabled source map generation for JavaScript and CSS in the build output
    • Updated package distribution to exclude all source map files from published releases

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@PupilTong PupilTong self-assigned this Apr 14, 2026
@PupilTong PupilTong requested a review from Sherry-hue as a code owner April 14, 2026 13:20
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

📝 Walkthrough

Walkthrough

Enhanced code coverage analysis by enabling source map generation in the build pipeline, expanding coverage fixture discovery to include web-core mapped files, and broadening package exclusion patterns to encompass all source map artifacts instead of JavaScript-only maps.

Changes

Cohort / File(s) Summary
Coverage Fixture Enhancement
packages/web-platform/playwright-fixtures/src/coverage-fixture.ts
Added getWebCoreMappedFiles() function to recursively discover .map files in web-core/dist/client_prod. Modified coverage conversion to iterate over multiple resolved source paths (original candidates plus discovered files) and aggregate Istanbul coverage from each via Object.assign instead of processing a single path.
Build and Package Configuration
packages/web-platform/web-core/rsbuild.config.ts, packages/web-platform/web-core/package.json
Enabled source map generation for both JavaScript (js: 'source-map') and CSS (css: true) in rsbuild output configuration. Updated package.json exclusion pattern from !dist/**/*.js.map to !dist/**/*.map to exclude all source map types from published artifacts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

platform:Web

Suggested reviewers

  • Sherry-hue
  • colinaaa

Poem

🐰 Whiskers twitching with delight,
Maps are born and coverage takes flight,
From source to spread across the land,
Web-core discovered, perfectly planned! ✨📍

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main objective of the changeset: improving coverage detection for the web-core background thread module by discovering additional source files dynamically.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...atform/playwright-fixtures/src/coverage-fixture.ts 0.00% 31 Missing ⚠️
packages/web-platform/web-core/rsbuild.config.ts 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/web-platform/playwright-fixtures/src/coverage-fixture.ts (1)

24-33: Minor: Redundant type assertion after filter.

The type assertion (f as string) on line 29 is redundant since the filter already narrows the type to string.

♻️ Suggested simplification
 const getWebCoreMappedFiles = () => {
   try {
     const files = readdirSync(webCoreDist, { recursive: true });
     return files
       .filter((f) => typeof f === 'string' && f.endsWith('.map'))
-      .map((f) => path.join(webCoreDist, (f as string).replace(/\.map$/, '')));
+      .map((f) => path.join(webCoreDist, f.replace(/\.map$/, '')));
   } catch (e) {
     return [];
   }
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web-platform/playwright-fixtures/src/coverage-fixture.ts` around
lines 24 - 33, In getWebCoreMappedFiles, remove the redundant type assertion "(f
as string)" because the prior filter already narrows f to string; update the
.map call to use f directly (e.g., path.join(webCoreDist, f.replace(/\.map$/,
''))) while keeping the try/catch, readdirSync usage, and path.join(webCoreDist,
...) logic intact so behavior is unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/web-platform/playwright-fixtures/src/coverage-fixture.ts`:
- Around line 24-33: In getWebCoreMappedFiles, remove the redundant type
assertion "(f as string)" because the prior filter already narrows f to string;
update the .map call to use f directly (e.g., path.join(webCoreDist,
f.replace(/\.map$/, ''))) while keeping the try/catch, readdirSync usage, and
path.join(webCoreDist, ...) logic intact so behavior is unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 69129ad2-07eb-4d87-904d-722c8fea05ed

📥 Commits

Reviewing files that changed from the base of the PR and between 7332eb4 and 513787d.

📒 Files selected for processing (3)
  • packages/web-platform/playwright-fixtures/src/coverage-fixture.ts
  • packages/web-platform/web-core/package.json
  • packages/web-platform/web-core/rsbuild.config.ts

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 14, 2026

Merging this PR will degrade performance by 42.92%

❌ 1 regressed benchmark
✅ 80 untouched benchmarks
⏩ 21 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
basic-performance-text-200 11.8 ms 20.7 ms -42.92%

Comparing PupilTong:p/hw/fix-coverage-after-use-html-head (513787d) with main (7332eb4)

Open in CodSpeed

Footnotes

  1. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 14, 2026

Web Explorer

#8873 Bundle Size — 749.3KiB (0%).

513787d(current) vs 7332eb4 main#8857(baseline)

Bundle metrics  Change 2 changes
                 Current
#8873
     Baseline
#8857
No change  Initial JS 44.45KiB 44.45KiB
No change  Initial CSS 2.16KiB 2.16KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 10 10
Change  Modules 148(-1.33%) 150
No change  Duplicate Modules 11 11
Change  Duplicate Code 35.01%(+0.03%) 35%
No change  Packages 3 3
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8873
     Baseline
#8857
No change  Other 401.63KiB 401.63KiB
No change  JS 345.51KiB 345.51KiB
No change  CSS 2.16KiB 2.16KiB

Bundle analysis reportBranch PupilTong:p/hw/fix-coverage-afte...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 14, 2026

React MTF Example

#432 Bundle Size — 192.85KiB (0%).

513787d(current) vs 7332eb4 main#416(baseline)

Bundle metrics  no changes
                 Current
#432
     Baseline
#416
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 173 173
No change  Duplicate Modules 67 67
No change  Duplicate Code 45.36% 45.36%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#432
     Baseline
#416
No change  IMG 111.23KiB 111.23KiB
No change  Other 81.61KiB 81.61KiB

Bundle analysis reportBranch PupilTong:p/hw/fix-coverage-afte...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 14, 2026

React External

#417 Bundle Size — 582.81KiB (0%).

513787d(current) vs 7332eb4 main#401(baseline)

Bundle metrics  no changes
                 Current
#417
     Baseline
#401
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 17 17
No change  Duplicate Modules 5 5
No change  Duplicate Code 8.59% 8.59%
No change  Packages 0 0
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#417
     Baseline
#401
No change  Other 582.81KiB 582.81KiB

Bundle analysis reportBranch PupilTong:p/hw/fix-coverage-afte...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Apr 14, 2026

React Example

#7299 Bundle Size — 223.58KiB (0%).

513787d(current) vs 7332eb4 main#7283(baseline)

Bundle metrics  no changes
                 Current
#7299
     Baseline
#7283
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 179 179
No change  Duplicate Modules 70 70
No change  Duplicate Code 45.76% 45.76%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7299
     Baseline
#7283
No change  IMG 145.76KiB 145.76KiB
No change  Other 77.82KiB 77.82KiB

Bundle analysis reportBranch PupilTong:p/hw/fix-coverage-afte...Project dashboard


Generated by RelativeCIDocumentationReport issue

@PupilTong PupilTong merged commit 04be21a into lynx-family:main Apr 15, 2026
74 of 80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants