You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In each of these repositories there are duplicated or near-duplicated resources:
An update-pdfjs script that fetches the latest version of PDF.js, in the repo's directory for miscellaneous scripts (eg. tools/, scripts/ or bin/)
A vendored copy of PDF.js and its viewer application with some resources stripped out and minor modifications to the viewer's HTML
A pdfjs-init.js script that loads Hypothesis into the viewer once the viewer has fully initialized
The process of updating PDF.js involves creating a branch, running the update-pdfjs script (or make update-pdfjs in the case of Via), testing the changes and creating a PR with the results.
This status quo has some downsides:
The process of updating the PDF viewer is different than updating other dependencies, so it is less obvious how to do it
Changes to the PDF.s initialization script (pdfjs-init.js) and the tools that update PDF.js (update-pdfjs and the viewer HTML generator) have to be applied separately in each of the repositories, and there is a risk that this doesn't happen
There isn't an obvious central place to document things related to how the Hypothesis-augmented PDF.js viewer works
The update-pdfjs script currently fetches whatever the latest PDF.js build is from PDF.js' GitHub Pages site, which means that when it is run separately in each of the repos it can end up fetching slightly different versions, if changes are happening upstream
It would be worth looking into ways to reduce this duplication. One possibility is to make pdf.js-hypothesis the canonical repo for the Hypothesis-augmented PDF.js viewer and build an npm package from that repo containing a PDF.js build along with the pdfjs-init.js script. Other repositories could then consume the npm package as they do for other dependencies. A variation on this would be to create a new repository for a packaged PDF viewer, which is then consumed by all the other repositories.
The text was updated successfully, but these errors were encountered:
Hypothesis currently includes builds of the PDF.js library and viewer application in four separate repositories:
In each of these repositories there are duplicated or near-duplicated resources:
update-pdfjs
script that fetches the latest version of PDF.js, in the repo's directory for miscellaneous scripts (eg.tools/
,scripts/
orbin/
)pdfjs-init.js
script that loads Hypothesis into the viewer once the viewer has fully initializedThe process of updating PDF.js involves creating a branch, running the
update-pdfjs
script (ormake update-pdfjs
in the case of Via), testing the changes and creating a PR with the results.This status quo has some downsides:
It would be worth looking into ways to reduce this duplication. One possibility is to make pdf.js-hypothesis the canonical repo for the Hypothesis-augmented PDF.js viewer and build an npm package from that repo containing a PDF.js build along with the
pdfjs-init.js
script. Other repositories could then consume the npm package as they do for other dependencies. A variation on this would be to create a new repository for a packaged PDF viewer, which is then consumed by all the other repositories.The text was updated successfully, but these errors were encountered: