-
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
[api-minor] Add the Babel targets
-option to avoid transpiling code for unsupported browsers
#15332
Conversation
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/164b055ddd61940/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/164b055ddd61940/output.txt Total script time: 2.08 mins Published |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/b5d616cdd4582e6/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/87bca583424b6e9/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/b5d616cdd4582e6/output.txt Total script time: 27.11 mins
Image differences available at: http://54.241.84.105:8877/b5d616cdd4582e6/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/87bca583424b6e9/output.txt Total script time: 28.82 mins
Image differences available at: http://54.193.163.58:8877/87bca583424b6e9/reftest-analyzer.html#web=eq.log |
…for unsupported browsers Currently we simply use the Babel `preset-env` in the `legacy`-builds of the PDF.js library. This has the side-effect of transpiling the code for *very old* browsers/environments, including ones that we (since many years) no longer support which unnecessarily bloats the size of the `legacy`-builds. For the CSS files we're only targeting *the supported browsers*, and it's thus possible to extend that to also apply to Babel. One of the most significant changes, with this patch, is that we'll no longer polyfill `async`/`await` in the `legacy`-builds. However, this shouldn't be an issue given the browsers that we currently support in PDF.js; please refer to: - https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function#browser_compatibility
bb519f9
to
6e31799
Compare
Looks good to me; thanks! |
Currently we simply use the Babel
preset-env
in thelegacy
-builds of the PDF.js library. This has the side-effect of transpiling the code for very old browsers/environments, including ones that we (since many years) no longer support which unnecessarily bloats the size of thelegacy
-builds.For the CSS files we're only targeting the supported browsers, and it's thus possible to extend that to also apply to Babel.
One of the most significant changes, with this patch, is that we'll no longer polyfill
async
/await
in thelegacy
-builds. However, this shouldn't be an issue given the browsers that we currently support in PDF.js; please refer to: