Skip to content

Use a "normal" import statement to access the importPrintedAppearances function, in the src/core/worker.js file (PR 21858 follow-up) - #21923

Merged
calixteman merged 1 commit into
mozilla:masterfrom
Snuffleupagus:importPrintedAppearances-normal-import
Sep 10, 2026
Merged

calixteman merged 1 commit into
mozilla:masterfrom
Snuffleupagus:importPrintedAppearances-normal-import

Conversation

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

Currently this code is accessed with a dynamic import, which has the unfortunate side-effect of inflating the size of the built pdf.worker.mjs file a whole lot.

Given the relatively small size of the src/core/editor/print_appearances.js file it really doesn't seem like an issue to just bundle that code unconditionally, and the existing pre-processor checks means that the importPrintedAppearances code will only be invoked in MOZCENTRAL builds.

NOTE: This patch reduces the size of the gulp mozcentral bundle by 96 kilo-bytes, which I think is way too much to ignore.

…es` function, in the `src/core/worker.js` file (PR 21858 follow-up)

Currently this code is accessed with a dynamic import, which has the unfortunate side-effect of inflating the size of the *built* `pdf.worker.mjs` file a whole lot.

Given the relatively small size of the `src/core/editor/print_appearances.js` file it really doesn't seem like an issue to just bundle that code unconditionally, and the existing pre-processor checks means that the `importPrintedAppearances` code will only be invoked in MOZCENTRAL builds.

*NOTE:* This patch reduces the size of the `gulp mozcentral` bundle by `96` kilo-bytes, which I think is way too much to ignore.
@codecov-commenter

codecov-commenter commented Sep 9, 2026 •

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 90.30%. Comparing base (61ac0bd) to head (7f28f84).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21923      +/-   ##
==========================================
- Coverage   90.31%   90.30%   -0.02%     
==========================================
  Files         269      269              
  Lines       67535    67534       -1     
==========================================
- Hits        60992    60984       -8     
- Misses       6543     6550       +7     
Flag Coverage Ξ”
browsertest 66.15% <ΓΈ> (-0.13%) ⬇️
fonttest 8.94% <ΓΈ> (ΓΈ)
integrationtest 69.34% <ΓΈ> (-0.09%) ⬇️
unittest 59.49% <ΓΈ> (+<0.01%) ⬆️
unittestcli 58.01% <ΓΈ> (+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.

@Snuffleupagus

Copy link
Copy Markdown
Collaborator Author

/botio browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/8302166e6abfc1e/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/53f9e41baf5d108/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/53f9e41baf5d108/output.txt

Total script time: 18.97 mins

  • Regression tests: Passed

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/8302166e6abfc1e/output.txt

Total script time: 23.91 mins

  • Regression tests: Passed

@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.

@calixteman
calixteman merged commit 10db1d6 into mozilla:master Sep 10, 2026
24 checks passed
@Snuffleupagus
Snuffleupagus deleted the importPrintedAppearances-normal-import branch September 10, 2026 09:20
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.

4 participants