pdf.js/examples
Jonas Jenwald aab0f91740 [api-minor] Simplify the *fallback* fake worker loader code in src/display/api.js
For performance reasons, and to avoid hanging the browser UI, the PDF.js library should *always* be used with web workers enabled.
At this point in time all of the supported browsers should have proper worker support, and Node.js is thus the only environment where workers aren't supported. Hence it no longer seems relevant/necessary to provide, by default, fake worker loaders for various JS builders/bundlers/frameworks in the PDF.js code itself.[1]

In order to simplify things, the fake worker loader code is thus simplified to now *only* support Node.js usage respectively "normal" browser usage out-of-the-box.[2]

*Please note:* The officially intended way of using the PDF.js library is with workers enabled, which can be done by setting `GlobalWorkerOptions.workerSrc`, `GlobalWorkerOptions.workerPort`, or manually providing a `PDFWorker` instance when calling `getDocument`.

---
[1] Note that it's still possible to *manually* disable workers, simply my manually loading the built `pdf.worker.js` file into the (current) global scope, however this's mostly intended for testing/debugging purposes.

[2] Unfortunately some bundlers such as Webpack, when used with third-party deployments of the PDF.js library, will start to print `Critical dependency: ...` warnings when run against the built `pdf.js` file from this patch. The reason is that despite the `require` calls being protected by *runtime* `isNodeJS` checks, it's not possible to simply tell Webpack to just ignore the `require`; please see [Webpack issue 8826](https://github.com/webpack/webpack) and libraries such as [require-fool-webpack](https://github.com/sindresorhus/require-fool-webpack).
2019-12-20 17:36:08 +01:00
..
acroforms Clarify that gulp dist-install should be used for the AcroForms example 2019-01-05 15:20:50 +01:00
browserify [api-minor] Simplify the *fallback* fake worker loader code in src/display/api.js 2019-12-20 17:36:08 +01:00
components [api-minor] Change the getViewport method, on PDFPageProxy, to take a parameter object rather than a bunch of (randomly) ordered parameters 2018-12-21 11:55:20 +01:00
create-react-app Add Create React App example with TypeScript and basic usage 2019-10-10 23:25:41 +02:00
image_decoders Manually fix remaining ESLint errors 2018-12-11 15:23:26 +01:00
learning Update remaining examples, and docs, to utilize current API functionality (issue 10377) 2018-12-24 12:33:39 +01:00
mobile-viewer Add a reset method to the PDFHistory implementation 2019-12-13 10:38:39 +01:00
node Add missing hasChildNodes polyfill to domstubs.js (PR 10022 follow-up) 2019-04-01 23:23:50 +02:00
svgviewer ESLint --fix 2018-12-11 15:23:26 +01:00
text-only [api-minor] Change the getViewport method, on PDFPageProxy, to take a parameter object rather than a bunch of (randomly) ordered parameters 2018-12-21 11:55:20 +01:00
webpack [api-minor] Simplify the *fallback* fake worker loader code in src/display/api.js 2019-12-20 17:36:08 +01:00
.eslintrc Upgrade to eslint version 6 2019-08-24 20:21:10 +02:00