Skip to content

Commit

Permalink
Merge pull request #54250 from callstack-internal/Update-react-fast-p…
Browse files Browse the repository at this point in the history
…df-to-use-modern-pdfjs-dist

Update react-fast-pdf to use modern pdfjs-dist
  • Loading branch information
mountiny authored Dec 19, 2024
2 parents 6e42dfe + fa08125 commit e42622c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/webpack/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
// We are importing this worker as a string by using asset/source otherwise it will default to loading via an HTTPS request later.
// This causes issues if we have gone offline before the pdfjs web worker is set up as we won't be able to load it from the server.
{
test: new RegExp('node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs'),
test: new RegExp('node_modules/pdfjs-dist/build/pdf.worker.min.mjs'),
type: 'asset/source',
},

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"react-content-loader": "^7.0.0",
"react-dom": "18.3.1",
"react-error-boundary": "^4.0.11",
"react-fast-pdf": "1.0.20",
"react-fast-pdf": "1.0.21",
"react-map-gl": "^7.1.3",
"react-native": "0.75.2",
"react-native-android-location-enabler": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/PDFThumbnail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'core-js/proposals/promise-with-resolvers';
// eslint-disable-next-line import/extensions
import pdfWorkerSource from 'pdfjs-dist/legacy/build/pdf.worker.min.mjs';
import pdfWorkerSource from 'pdfjs-dist/build/pdf.worker.min.mjs';
import React, {useMemo, useState} from 'react';
import {View} from 'react-native';
import {Document, pdfjs, Thumbnail} from 'react-pdf';
Expand Down
2 changes: 1 addition & 1 deletion src/types/modules/pdf.worker.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module 'pdfjs-dist/legacy/build/pdf.worker.min.mjs';
declare module 'pdfjs-dist/build/pdf.worker.min.mjs';

0 comments on commit e42622c

Please sign in to comment.