-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Upgrade react-fast-pdf and webpack
#80160
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
Merged
roryabraham
merged 11 commits into
Expensify:main
from
andriivitiv:76303-upgrade-react-fast-pdf-and-webpack
Apr 6, 2026
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d9564d2
Upgrade `react-fast-pdf` and `webpack`
andriivitiv 7b9232e
Merge branch 'main' of github.com:Expensify/App into 76303-upgrade-re…
andriivitiv 2a32a51
Merge branch 'main' of github.com:Expensify/App into 76303-upgrade-re…
andriivitiv e031ca1
Upgrade `pdfjs-dist` and remove patch
andriivitiv 4342062
Merge branch 'main' of github.com:Expensify/App into 76303-upgrade-re…
andriivitiv a178522
Switch to legacy build of pdf.js
andriivitiv be31af9
Merge branch 'main' of github.com:Expensify/App into 76303-upgrade-re…
andriivitiv 8001a2c
Add polyfills instead of using legacy PDF worker
andriivitiv 196040b
Add polyfill for Uint8Array.toHex
andriivitiv 6996e7d
Revert "Add polyfill for Uint8Array.toHex"
andriivitiv 0064ae7
Revert "Add polyfills instead of using legacy PDF worker"
andriivitiv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where was this discussed? Which older browsers specificallly are we talking about? We can check production data to see if it matters for us.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was discussed here. The new features are supported from Chrome 145, released last month.
getOrInsert
getOrInsertComputed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would an alternate solution be to polyfill these browser APIs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's polyfillable: https://github.com/tc39/proposal-upsert?tab=readme-ov-file#polyfill.
@andriivitiv what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible for normal compile-time imports, but not for the worker because it is being bundled as a text file (
type: 'asset/source'), which bypasses Babel and its polyfills. And changing this will cause issues while offlineApp/config/webpack/webpack.common.ts
Lines 260 to 265 in 59fe031
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andriivitiv is it possible to put polyfills in
src/polyfillsinstead of using babel?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
claude seems to think we can make the polyfill work without using a legacy version of pdfjs:
diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as suggested.
Tested this on
src/polyfills/ReadableStream.jsto fix it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s add the polyfill. I think generally we want to support major browsers going back 2-3 years