Skip to content

Ensure that the RendererWorker version matches the API version, and reduce the size of the *built* pdf.renderer.mjs file (PR 21860 follow-up) - #22097

Merged
Snuffleupagus merged 3 commits into
mozilla:masterfrom
Snuffleupagus:RendererWorker-fixes
Oct 6, 2026
Merged

Snuffleupagus merged 3 commits into
mozilla:masterfrom
Snuffleupagus:RendererWorker-fixes

Conversation

@Snuffleupagus

Copy link
Copy Markdown
Collaborator
  • Ensure that the RendererWorker version matches the API version (PR 21860 follow-up)

    While the actual implementation differs slightly from the "normal" worker, since the new RendererWorker only supports one document, the basic principle is the same.
    By ensuring that the API and worker versions match, we prevent any possible issues that could occur e.g. as a result of caching, which should help prevent strange and hard to debug errors in third-party PDF.js deployments.

  • Split DOMCanvasFactory and OffscreenCanvasFactory into separate files (PR 21860 follow-up)

    This avoids bundling dead code in the built pdf.mjs and pdf.renderer.mjs files.

    Note: This reduces the size of the gulp mozcentral bundle by 487 bytes, which isn't a lot but still cannot hurt.

  • Split DOMFilterFactory and WorkerFilterFactory into separate files (PR 21860 follow-up)

    This avoids bundling dead code in the built pdf.mjs and pdf.renderer.mjs files.

    Note: This reduces the size of the gulp mozcentral bundle by 11898 bytes, i.e. over 11 kilo-bytes, which is way too much to ignore.

…21860 follow-up)

While the actual implementation differs slightly from the "normal" worker, since the new `RendererWorker` only supports one document, the basic principle is the same.
By ensuring that the API *and* worker versions match, we prevent any possible issues that could occur e.g. as a result of caching, which should help prevent strange and hard to debug errors in third-party PDF.js deployments.
…iles (PR 21860 follow-up)

This avoids bundling dead code in the *built* `pdf.mjs` and `pdf.renderer.mjs` files.

*Note:* This reduces the size of the `gulp mozcentral` bundle by `487` bytes, which isn't a lot but still cannot hurt.
…s (PR 21860 follow-up)

This avoids bundling dead code in the *built* `pdf.mjs` and `pdf.renderer.mjs` files.

*Note:* This reduces the size of the `gulp mozcentral` bundle by `11898` bytes, i.e. over 11 kilo-bytes, which is way too much to ignore.
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Reference tests

Results for 7765947 (run, references from mozilla/pdf.js.refs@a0031ac7e2).

Platform Status Tests Total runtime Errors Different FBF No reference Report
Linux ⚠️ 1382 11m 57s 0 1 0 0 view differences
Windows ⚠️ 1382 16m 23s 0 1 0 0 view differences

The report is kept for 30 days and replaced by the next run.

Problems on Linux
TEST-UNEXPECTED-FAIL | test failed issue16114-partial | in firefox-1 | page1 round 1 | Optimized rendering differs from full rendering.
Problems on Windows
TEST-UNEXPECTED-FAIL | test failed issue16114-partial | in firefox-0 | page1 round 1 | Optimized rendering differs from full rendering.
TEST-UNEXPECTED-FAIL | test failed firefox-1 has not responded in 120s

@Snuffleupagus Snuffleupagus changed the title Ensure that the RendererWorker version matches the API version, and reduce the size of the *built* pdf.renderer.mjs file (PR 21860 follow-up) Ensure that the RendererWorker version matches the API version, and reduce the size of the *built* pdf.renderer.mjs file (PR 21860 follow-up) Oct 6, 2026
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Viewer preview

🗑️ Viewer previews removed.

@calixteman calixteman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thank you.

@codecov-commenter

codecov-commenter commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.35659% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.22%. Comparing base (61b7f9a) to head (7765947).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
src/display/dom_filter_factory.js 75.81% 59 Missing ⚠️
src/display/api.js 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22097      +/-   ##
==========================================
+ Coverage   90.20%   90.22%   +0.01%     
==========================================
  Files         271      274       +3     
  Lines       67790    67795       +5     
==========================================
+ Hits        61151    61167      +16     
+ Misses       6639     6628      -11     
Flag Coverage Δ
browsertest 66.14% <56.58%> (+<0.01%) ⬆️
fonttest 8.95% <ø> (ø)
integrationtest 70.03% <60.07%> (+0.03%) ⬆️
unittest 59.89% <10.07%> (+0.02%) ⬆️
unittestcli 58.27% <0.78%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 6, 2026
@Snuffleupagus
Snuffleupagus merged commit 638bcdf into mozilla:master Oct 6, 2026
34 checks passed
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 6, 2026
@Snuffleupagus
Snuffleupagus deleted the RendererWorker-fixes branch October 6, 2026 21:05

This branch was successfully deployed

1 active deployment
sync_pdfs — 77659470 Deployed Oct 6, 2026 by Snuffleupagus via request #302
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core release-blocker Blocker for the upcoming release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants