Skip to content

Commit

Permalink
Update pdfjs-dist to 2.4.456 (#583)
Browse files Browse the repository at this point in the history
* Update pdfjs-dist to 2.4.456

Co-authored-by: Kyle Mellander <kylemellander@users.noreply.github.com>

* Continue using ES5 builds by default

Co-authored-by: Kyle Mellander <kylemellander@users.noreply.github.com>
  • Loading branch information
wojtekmaj and kylemellander committed Jul 27, 2020
1 parent f8eaf96 commit 70cc38e
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}],
"jsx-a11y/label-has-associated-control": ["error", { "required": { "some": ["id", "nesting"] }}],
"no-param-reassign": ["error", { "props": true, "ignorePropertyModificationsFor": ["canvas", "element", "svg"] }],
"no-underscore-dangle": ["error", { "allow": ["_pdfInfo", "_pageInfo"] }],
"no-underscore-dangle": ["error", { "allow": ["_pdfInfo", "_pageIndex", "_pageInfo"] }],
"react/jsx-props-no-spreading": "off",
"react/jsx-sort-props": ["error", {
"reservedFirst": ["key"]
Expand Down
2 changes: 1 addition & 1 deletion __mocks__/_silently_failing_pdf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RenderingCancelledException } from 'pdfjs-dist';
import { RenderingCancelledException } from 'pdfjs-dist/es5/build/pdf';

export default {
_pdfInfo: {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@
"make-cancellable-promise": "^1.0.0",
"make-event-props": "^1.1.0",
"merge-class-names": "^1.1.1",
"pdfjs-dist": "2.3.200",
"prop-types": "^15.6.2"
"pdfjs-dist": "2.4.456",
"prop-types": "^15.6.2",
"worker-loader": "^2.0.0"
},
"devDependencies": {
"@babel/cli": "^7.8.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Document.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import makeEventProps from 'make-event-props';
import makeCancellable from 'make-cancellable-promise';
import mergeClassNames from 'merge-class-names';
import pdfjs, { PDFDataRangeTransport } from 'pdfjs-dist';
import pdfjs, { PDFDataRangeTransport } from 'pdfjs-dist/es5/build/pdf';

import DocumentContext from './DocumentContext';

Expand Down
10 changes: 5 additions & 5 deletions src/Page.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ describe('Page', () => {
pdf = await pdfjs.getDocument({ data: pdfFile.arrayBuffer }).promise;

const page = await pdf.getPage(1);
desiredLoadedPage.pageIndex = page.pageIndex;
desiredLoadedPage._pageIndex = page._pageIndex;
desiredLoadedPage._pageInfo = page._pageInfo;

const page2 = await pdf.getPage(2);
desiredLoadedPage2.pageIndex = page2.pageIndex;
desiredLoadedPage2._pageIndex = page2._pageIndex;
desiredLoadedPage2._pageInfo = page2._pageInfo;

pdf2 = await pdfjs.getDocument({ data: pdfFile2.arrayBuffer }).promise;

const page3 = await pdf2.getPage(1);
desiredLoadedPage3.pageIndex = page3.pageIndex;
desiredLoadedPage3._pageIndex = page3._pageIndex;
desiredLoadedPage3._pageInfo = page3._pageInfo;

registerPageArguments.push(
page.pageIndex,
page._pageIndex,
undefined, // Page reference is not defined in Enzyme
);
unregisterPageArguments = page.pageIndex;
unregisterPageArguments = page._pageIndex;
});

describe('loading', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Page/AnnotationLayer.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import pdfjs from 'pdfjs-dist';
import pdfjs from 'pdfjs-dist/es5/build/pdf';
import makeCancellable from 'make-cancellable-promise';

import DocumentContext from '../DocumentContext';
Expand Down
2 changes: 1 addition & 1 deletion src/Page/PageSVG.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import pdfjs from 'pdfjs-dist';
import pdfjs from 'pdfjs-dist/es5/build/pdf';

import PageContext from '../PageContext';

Expand Down
2 changes: 1 addition & 1 deletion src/entry.jest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pdfjs from 'pdfjs-dist';
import pdfjs from 'pdfjs-dist/es5/build/pdf';
import Document from './Document';
import Outline from './Outline';
import Page from './Page';
Expand Down
2 changes: 1 addition & 1 deletion src/entry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pdfjs from 'pdfjs-dist';
import pdfjs from 'pdfjs-dist/es5/build/pdf';
import Document from './Document';
import Outline from './Outline';
import Page from './Page';
Expand Down
2 changes: 1 addition & 1 deletion src/entry.parcel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pdfjs from 'pdfjs-dist';
import pdfjs from 'pdfjs-dist/es5/build/pdf';
import Document from './Document';
import Outline from './Outline';
import Page from './Page';
Expand Down
2 changes: 1 addition & 1 deletion src/entry.webpack.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pdfjs from 'pdfjs-dist';
import pdfjs from 'pdfjs-dist/es5/build/pdf';
import Document from './Document';
import Outline from './Outline';
import Page from './Page';
Expand Down
2 changes: 1 addition & 1 deletion src/pdf.worker.entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* See: https://github.com/parcel-bundler/parcel/issues/670
*/

(typeof window !== 'undefined' ? window : {}).pdfjsWorker = require('pdfjs-dist/build/pdf.worker.js');
(typeof window !== 'undefined' ? window : {}).pdfjsWorker = require('pdfjs-dist/es5/build/pdf.worker.js');
16 changes: 4 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4850,11 +4850,6 @@ nice-try@^1.0.4:
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==

node-ensure@^0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/node-ensure/-/node-ensure-0.0.0.tgz#ecae764150de99861ec5c810fd5d096b183932a7"
integrity sha1-7K52QVDemYYexcgQ/V0Jaxg5Mqc=

node-int64@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
Expand Down Expand Up @@ -5276,13 +5271,10 @@ pbkdf2@^3.0.3:
safe-buffer "^5.0.1"
sha.js "^2.4.8"

pdfjs-dist@2.3.200:
version "2.3.200"
resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-2.3.200.tgz#2920dc28ae7f2b8313cd6d6223c97ae85ac07eac"
integrity sha512-+8wBjU5h8LPZOIvR9X2uCrp/8xWQG1DRDKMLg5lzGN1qyIAZlYUxA0KQyy12Nw5jN7ozulC6v97PMaDcLgAcFg==
dependencies:
node-ensure "^0.0.0"
worker-loader "^2.0.0"
pdfjs-dist@2.4.456:
version "2.4.456"
resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-2.4.456.tgz#0eaad2906cda866bbb393e79a0e5b4e68bd75520"
integrity sha512-yckJEHq3F48hcp6wStEpbN9McOj328Ib09UrBlGAKxvN2k+qYPN5iq6TH6jD1C0pso7zTep+g/CKsYgdrQd5QA==

performance-now@^2.1.0:
version "2.1.0"
Expand Down

0 comments on commit 70cc38e

Please sign in to comment.