-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Try to, completely, avoid loading the ReadableStream
polyfill in MOZCENTRAL builds
#10470
Try to, completely, avoid loading the ReadableStream
polyfill in MOZCENTRAL builds
#10470
Conversation
…ZCENTRAL builds With https://bugzilla.mozilla.org/show_bug.cgi?id=1505122 landing in Firefox 65, the native `ReadableStream` implementation is now enabled by default in Firefox. Obviously it would be nice to simply stop bundling the polyfill in MOZCENTRAL builds altogether, however given that it's still possible to disable[1] `ReadableStream` this is probably not a good idea just yet. Nonetheless, now that native support is available, it seems unnecessary (and wasteful) to keep bundling the polyfill twice[2] in MOZCENTRAL builds. Hence this patch, which contains a suggest approach for packing the polyfill in a *separate* file which is then *only* loaded if/when needed. With this patch, the size of the `gulp mozcentral` build target is thus reduced accordingly: | | `build/mozcentral` |-------|------------------- |master | 3 461 089 |patch | 3 340 268 Besides the PDF.js files taking up less space in Firefox this way, the additional benefit is that there's (by default) less code that needs to be loaded and parsed when the PDF Viewer is used which also cannot hurt. --- [1] In `about:config`, by toggling the `javascript.options.streams` preference. [2] Once in the `build/pdf.js` file, and once in the `build/pdf.worker.js` file.
Hmm, what's up with Travis!? /botio lint |
From: Bot.io (Linux m4)ReceivedCommand cmd_lint from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/caf9857d7abf7ca/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_lint from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/cb3aee2c65a39dd/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/caf9857d7abf7ca/output.txt Total script time: 0.81 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/cb3aee2c65a39dd/output.txt Total script time: 2.38 mins
|
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/ce95777007b17a2/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/64ad7bd7163f110/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/ce95777007b17a2/output.txt Total script time: 2.65 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/64ad7bd7163f110/output.txt Total script time: 5.12 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/c1b951cabe371ed/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/c1b951cabe371ed/output.txt Total script time: 1.68 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.215.176.217:8877/99bf70ac9ca66e3/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/58e4d148d7359b7/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/58e4d148d7359b7/output.txt Total script time: 18.02 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/99bf70ac9ca66e3/output.txt Total script time: 25.01 mins
|
I really like this idea; thank you! |
With https://bugzilla.mozilla.org/show_bug.cgi?id=1505122 landing in Firefox 65, the native
ReadableStream
implementation is now enabled by default in Firefox.Obviously it would be nice to simply stop bundling the polyfill in MOZCENTRAL builds altogether, however given that it's still possible to disable[1]
ReadableStream
this is probably not a good idea just yet.Nonetheless, now that native support is available, it seems unnecessary (and wasteful) to keep bundling the polyfill twice[2] in MOZCENTRAL builds. Hence this patch, which contains a suggest approach for packing the polyfill in a separate file which is then only loaded if/when needed.
With this patch, the size of the
gulp mozcentral
build target is thus reduced accordingly:build/mozcentral
Besides the PDF.js files taking up less space in Firefox this way, the additional benefit is that there's (by default) less code that needs to be loaded and parsed when the PDF Viewer is used which also cannot hurt.
Edit: Smaller diff with https://github.com/mozilla/pdf.js/pull/10470/files?w=1.
[1] In
about:config
, by toggling thejavascript.options.streams
preference.[2] Once in the
build/pdf.js
file, and once in thebuild/pdf.worker.js
file.