Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Update react-pdf to 5.7.2 #2413

Merged
merged 2 commits into from
Apr 17, 2023
Merged

Conversation

cballevre
Copy link
Member

@cballevre cballevre commented Apr 13, 2023

This update provides version 2.12.313 of pdfjs-dist. This version resolves rendering issues with some PDFs like the screenshot above. There is two breaking change on the way to import react-pdf into final application. All the detail can be found into the commit message of c0d7441

Development notes :
I tried to upgrade to the latest version of react-pdf which is currently 6.2.2. But I encountered a problem related to this issue: wojtekmaj/react-pdf#1043 from the pdf.js lib. It seems that there is a link with our webpack configuration. I modified the babel configuration to transcompile the pdf.js module without success.

@bundlemon
Copy link

bundlemon bot commented Apr 13, 2023

BundleMon

Unchanged files (2)
Status Path Size Limits
dist/cozy-ui.min.css
19.67KB +5%
dist/cozy-ui.utils.min.css
9.99KB +5%

No change in files bundle size

Unchanged groups (1)
Status Path Size Limits
transpiled/react/**
576.93KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@cballevre cballevre force-pushed the feat/update-react-pdf-to-5.7.2 branch 2 times, most recently from db24a93 to ca11c18 Compare April 17, 2023 06:55
@@ -247,7 +247,7 @@ For performance reasons, it is important to use a web worker when showing PDF fi
```diff
+ resolve: {
+ alias: {
+ 'react-pdf$' : 'react-pdf/dist/entry.webpack.js'
+ 'react-pdf$' : 'react-pdf/dist/esm/entry.webpack'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

il y a un souci dans le commit message au niveau du BC je crois, dans le before on devrait avoir react-pdf/dist/entry.webpack.js non ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh oui tous juste une erreur de copier-coller je corrige ça de suite

This update provides version 2.12.313 of pdfjs-dist. This version resolves rendering issues with some PDFs.

BREAKING CHANGE: This update requires the two changes above in your application if you use the `Viewer` to display PDF. You can find more detail in `Viewer` documentation : https://docs.cozy.io/cozy-ui/react/#!/Viewer

Before :
- react-pdf alias : `react-pdf/dist/entry.webpack.js`
- public import for pdf worker : `react-pdf/dist/pdf.worker.entry.js`

After :
- react-pdf alias : `react-pdf/dist/esm/entry.webpack`
- public import for pdf worker : `react-pdf/dist/esm/pdf.worker.entry`
@cballevre cballevre force-pushed the feat/update-react-pdf-to-5.7.2 branch from ca11c18 to 174bd4d Compare April 17, 2023 07:18
@cballevre cballevre merged commit 8ead538 into master Apr 17, 2023
@cballevre cballevre deleted the feat/update-react-pdf-to-5.7.2 branch April 17, 2023 08:29
@cozy-bot
Copy link

🎉 This PR is included in version 83.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants