-
Robert Knight authored
Replace the "plugin" functionality in the Guest that indirectly instantiates the `DocumentMeta`, `PDF` and `CrossFrame` classes with direct instantiation of those classes. The annotator part of the Hypothesis client is no longer a pluggable toolbox which can be arbitrarily extended by user-provided plugins. Removing the "plugins" logic and replacing it with direct construction of the necessary classes removes a lot of indirection that made the code harder to follow and also makes it easier for TypeScript to statically check the code. It will also enable the `config` object that is passed to `Guest` to be paired down to just the fields that are actually needed and properly typed. In future we will need some kind of plugin/integration facility to support different document viewers. For we will build a more specific document type integration facility when the time comes. - Remove `this.plugins` field from `Guest` class and `pluginClasses` config and replace with direct construction of `PDFIntegration`, `DocumentMeta` and `CrossFrame` classes - Update the `AnchoringImpl` typedef to correctly reflect that some anchoring implementations (HTML) have a synchronous `describe` method - Remove unnecessary `config` argument to `PDF` constructor - Replace the `PDF: {}` content in the guest config with `documentType: 'pdf'` as a more obvious way for the annotator entry point to configure which document viewer integration is loaded. In future we can generalize this to support different types of viewer integration.
bcd65da1
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
cross-frame-test.js | ||
document-test.js | ||
pdf-metadata-test.js | ||
pdf-test.js |