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

Improve the larger event listeners in the web/app.js file #18544

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

Snuffleupagus
Copy link
Collaborator

  • Shorten the names of the event listeners.

  • Use bind to pass in the PDFViewerApplication-scope to the event handlers.
    This makes the event handler code (a lot) less verbose, and this change is possible now that we're removing event listeners with AbortSignal.

  • Move the GENERIC-only event listeners into the same pre-processor block.

Note: This patch reduces the size of the gulp mozcentral output by ~4.3 kilo-bytes, which isn't a lot but still cannot hurt.

 - Shorten the names of the event listeners.

 - Use `bind` to pass in the `PDFViewerApplication`-scope to the event handlers.
   This makes the event handler code (a lot) less verbose, and this change is possible now that we're removing event listeners with `AbortSignal`.

 - Move the GENERIC-only event listeners into the same pre-processor block.

*Note:* This patch reduces the size of the `gulp mozcentral` output by `~4.3` kilo-bytes, which isn't a lot but still cannot hurt.
…tion

Given that these event handlers are virtually identical, obviously with the exception of the name-parameter, let's reduce a little bit of code duplication.
@Snuffleupagus
Copy link
Collaborator Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/bf1a46b9d83c67b/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/cd727dab2792185/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/cd727dab2792185/output.txt

Total script time: 8.44 mins

  • Integration Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/bf1a46b9d83c67b/output.txt

Total script time: 17.97 mins

  • Integration Tests: Passed

@Snuffleupagus Snuffleupagus marked this pull request as ready for review August 2, 2024 14:46
@timvandermeij
Copy link
Contributor

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 1

Live output at: http://54.241.84.105:8877/9e6cba4983e6928/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/9e6cba4983e6928/output.txt

Total script time: 1.04 mins

Published

timvandermeij
timvandermeij approved these changes Aug 2, 2024
@timvandermeij timvandermeij merged commit 7ac87dd into mozilla:master Aug 2, 2024
6 checks passed
@timvandermeij
Copy link
Contributor

Thank you for simplifying this!

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.

3 participants