[api-major] Remove support for calling getDocument without a parameter object, and remove the PDFDocumentProxy.prototype.destroy method#21245
Conversation
…ter object This is a left-over from very old code[1], before there were a lot of `getDocument` options and when most of the library configuration was done via the (since removed) `PDFJS` global. Given all the functionality added through the years, which require configuration[2], in practice it's now unlikely that calling `getDocument` without additional options will work except for the most trivial PDFs. --- [1] If the `getDocument` function was added today, there's no chance that it'd support anything other than a parameter object. [2] Note things such as CMaps, standard fonts, wasm-based image decoders, and ICC-based colour spaces.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21245 +/- ##
==========================================
+ Coverage 54.57% 56.03% +1.46%
==========================================
Files 216 220 +4
Lines 58860 58958 +98
==========================================
+ Hits 32120 33039 +919
+ Misses 26740 25919 -821
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This is a left-over from very old code, which pre-dates the introduction of the `PDFDocumentLoadingTask` and it's nothing more than an alias for its `destroy` method. Given that `PDFDocumentProxy` already provides a way to access the underlying `PDFDocumentLoadingTask` instance, it shouldn't be necessary to have an alias for one of its methods. *Please note:* For any existing code relying on the removed method, updating it should be as simple as replacing `pdfDocument.destroy()` with `pdfDocument.loadingTask.destroy()`. --- [1] If the `PDFDocumentProxy` class was added today, there's no chance that it'd include a `destroy` method.
614b6ed to
43ce1bb
Compare
|
/botio browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/dd473226009f94a/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/08e54aa35776b73/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/dd473226009f94a/output.txt Total script time: 18.15 mins
Image differences available at: http://54.241.84.105:8877/dd473226009f94a/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/08e54aa35776b73/output.txt Total script time: 24.11 mins
Image differences available at: http://54.193.163.58:8877/08e54aa35776b73/reftest-analyzer.html#web=eq.log |
timvandermeij
left a comment
There was a problem hiding this comment.
Good idea; thanks!
[api-major] Remove support for calling
getDocumentwithout a parameter objectThis is a left-over from very old code[1], before there were a lot of
getDocumentoptions and when most of the library configuration was done via the (since removed)PDFJSglobal.Given all the functionality added through the years, which require configuration[2], in practice it's now unlikely that calling
getDocumentwithout additional options will work except for the most trivial PDFs.[1] If the
getDocumentfunction was added today, there's no chance that it'd support anything other than a parameter object.[2] Note things such as CMaps, standard fonts, wasm-based image decoders, and ICC-based colour spaces.
[api-major] Remove the
PDFDocumentProxy.prototype.destroymethodThis is a left-over from very old code, which pre-dates the introduction of the
PDFDocumentLoadingTaskand it's nothing more than an alias for itsdestroymethod.Given that
PDFDocumentProxyalready provides a way to access the underlyingPDFDocumentLoadingTaskinstance, it shouldn't be necessary to have an alias for one of its methods.Please note: For any existing code relying on the removed method, updating it should be as simple as replacing
pdfDocument.destroy()withpdfDocument.loadingTask.destroy().[1] If the
PDFDocumentProxyclass was added today, there's no chance that it'd include adestroymethod.