mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Break import cycles, in the viewer, for PDFViewerApplication
Currently the `web/app.js` file pulls in various build-specific dependencies, via the use of import maps, and those files in turn import from `web/app.js` thus creating undesirable import cycles. To avoid this we instead pass in a `PDFViewerApplication`-reference, immediately after it's been created, to the relevant code. Note that we use an ESLint plugin rule, see `import/no-cycle`, that is normally able to catch import cycles. However, in this case import maps are involved which is why this wasn't caught.
This commit is contained in:
parent
6da9448f6c
commit
e98b9b019a
6 changed files with 49 additions and 34 deletions
|
@ -25,7 +25,7 @@ if (typeof PDFJSDev !== "undefined" && !PDFJSDev.test("GENERIC")) {
|
|||
);
|
||||
}
|
||||
|
||||
const GenericCom = {};
|
||||
function initCom(app) {}
|
||||
|
||||
class Preferences extends BasePreferences {
|
||||
async _writeToStorage(prefObj) {
|
||||
|
@ -47,4 +47,4 @@ class ExternalServices extends BaseExternalServices {
|
|||
}
|
||||
}
|
||||
|
||||
export { ExternalServices, GenericCom, Preferences };
|
||||
export { ExternalServices, initCom, Preferences };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue