Skip to content

Commit b5c8195

Browse files
committed
revert pdfjs-dist update
1 parent 5d29b3b commit b5c8195

File tree

3 files changed

+4730
-4331
lines changed

3 files changed

+4730
-4331
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@
7777
"style-loader": "^1.2.1",
7878
"url-loader": "^4.1.0",
7979
"webpack": "^5.75.0",
80-
"webpack-bundle-analyzer": "^4.10.2",
81-
"webpack-cli": "^5.1.4",
82-
"webpack-dev-server": "^5.0.4"
80+
"webpack-bundle-analyzer": "^3.8.0",
81+
"webpack-cli": "^3.3.12",
82+
"webpack-dev-server": "^3.11.0"
8383
},
8484
"dependencies": {
85-
"pdfjs-dist": "^4.2.67",
85+
"pdfjs-dist": "1.8.357",
8686
"prop-types": "^15.5.10",
8787
"react-visibility-sensor": "^5.0.2",
8888
"sass": "^1.77.2",

src/components/drivers/pdf-viewer.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
import React from 'react'
44
import VisibilitySensor from 'react-visibility-sensor'
5-
import * as PDFJS from 'pdfjs-dist'
5+
import { PDFJS } from 'pdfjs-dist/build/pdf.combined'
6+
import 'pdfjs-dist/web/compatibility'
67

78
const INCREASE_PERCENTAGE = 0.2
89
const DEFAULT_SCALE = 1.1
910
// eslint-disable-next-line no-import-assign
1011
PDFJS.isEvalSupported = false // DO NOT REMOVE THIS LINE OR ADJUST THE BOOLEAN VALUE ELSEWHERE IN THE CODE. This is a temporary workaround for https://github.com/transcom/mymove/security/dependabot/146
12+
PDFJS.disableWorker = true
1113

1214
export class PDFPage extends React.Component {
1315
constructor(props) {
@@ -181,19 +183,22 @@ export default class PDFDriver extends React.Component {
181183
<button
182184
type="button"
183185
className="view-control"
184-
onClick={this.increaseZoom}>
186+
onClick={this.increaseZoom}
187+
>
185188
<i className="zoom-in" />
186189
</button>
187190
<button
188191
type="button"
189192
className="view-control"
190-
onClick={this.resetZoom}>
193+
onClick={this.resetZoom}
194+
>
191195
<i className="zoom-reset" />
192196
</button>
193197
<button
194198
type="button"
195199
className="view-control"
196-
onClick={this.reduceZoom}>
200+
onClick={this.reduceZoom}
201+
>
197202
<i className="zoom-out" />
198203
</button>
199204
</div>

0 commit comments

Comments
 (0)