Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary closure in the src/core/font_renderer.js file #13341

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

With modern JavaScript modules, where you explicitly list the properties that should be exported, it's no longer necessary to wrap all of the code within one file into a top-level closure.[1]

This patch reduces the size, of even the built pdf.worker.js file, since there's now a lot less unnecessary whitespace.


[1] For files which contain different functionality, some closures may however still make sense in order to separate the code.
It might be possible to remove some of those cases later, e.g. once private class fields becomes generally available/usable in browsers.

With modern JavaScript modules, where you explicitly list the properties that should be exported, it's no longer necessary to wrap *all* of the code within one file into a top-level closure.[1]

This patch reduces the size, of even the *built* `pdf.worker.js` file, since there's now a lot less unnecessary whitespace.

---
[1] For files which contain *different* functionality, some closures may however still make sense in order to separate the code.
It might be possible to remove some of those cases later, e.g. once private class fields becomes generally available/usable in browsers.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented May 5, 2021

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/29d15b6449db9c0/output.txt

@pdfjsbot
Copy link

pdfjsbot commented May 5, 2021

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/c6ec4265d1ab080/output.txt

@pdfjsbot
Copy link

pdfjsbot commented May 5, 2021

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/29d15b6449db9c0/output.txt

Total script time: 26.12 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/29d15b6449db9c0/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented May 5, 2021

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/c6ec4265d1ab080/output.txt

Total script time: 29.56 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://3.101.106.178:8877/c6ec4265d1ab080/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit f66829e into mozilla:master May 7, 2021
@timvandermeij
Copy link
Contributor

Thanks!

@Snuffleupagus Snuffleupagus deleted the FontRendererFactory-rm-closure branch May 7, 2021 18:47
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.

None yet

3 participants