-
Notifications
You must be signed in to change notification settings - Fork 10k
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
[Regression] Prevent the *built* pdf.scripting.js
/pdf.sandbox.js
files from accidentally including most of the main-thread code (PR 12631 follow-up)
#12693
Conversation
…files from accidentally including most of the main-thread code (PR 12631 follow-up) *This is a recent regression, which I stumbled upon while working on cleaning-up the gulpfile related to `pdf.sandbox.js` building.* By placing the `ColorConverters` functionality in the `src/display/display_utils.js` file, you end up including a *significant* chunk of the `pdf.js` file in the built `pdf.scripting.js`/`pdf.sandbox.js` files. Given that I cannot imagine that this was actually intended, since it inflates the built files with unnecessary/unused code, this moves `ColorConverters` to a new file instead (thus breaking the dependencies). To hopefully reduce the risk future bugs, along these lines, a big comment is also placed at the top of the new file. Finally, the `ColorConverters` is converted to a class with static methods, since this felt slightly cleaner overall.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing that.
I supposed that unused code was striped out, TIL.
/botio unittest |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/5c26286267f061f/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/05e464eda16efaf/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/05e464eda16efaf/output.txt Total script time: 3.58 mins
|
From: Bot.io (Windows)SuccessFull output at http://3.101.106.178:8877/5c26286267f061f/output.txt Total script time: 4.76 mins
|
Thanks! |
} | ||
|
||
static CMYK_HTML(components) { | ||
return this.RGB_HTML(this.CMYK_RGB(components)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
return this.RGB_HTML(this.CMYK_RGB(components).slice(1));
This is a recent regression, which I stumbled upon while working on cleaning-up the gulpfile related to
pdf.sandbox.js
building.By placing the
ColorConverters
functionality in thesrc/display/display_utils.js
file, you end up including a significant chunk of thepdf.js
file in the builtpdf.scripting.js
/pdf.sandbox.js
files.Given that I cannot imagine that this was actually intended, since it inflates the built files with unnecessary/unused code, this moves
ColorConverters
to a new file instead (thus breaking the dependencies).To hopefully reduce the risk future bugs, along these lines, a big comment is also placed at the top of the new file.
Finally, the
ColorConverters
is converted to a class with static methods, since this felt slightly cleaner overall.