-
Notifications
You must be signed in to change notification settings - Fork 0
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
B 21230 resolve dependencies #12
Conversation
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.
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.
Worked great and I could see the signatures!
The only thing I wondered about was whether the orientation of the PDF should persist when swapping between multiple files (like rotating it one way, swapping to the other file, then swapping back to the rotated file but it's no longer rotated) - but that is such a nitpick I am leaving it up to you because I think it's fine :)
Looks good!
Oh no it absolutely should be a feature, it was missed when rotation saving was first added to milmove. I figured I'd at least restore some of the missing functionality while I was at it. Saving the persisting is def another enhancement BLI though |
Agree that would be an enhancement! |
Ref for future in case we return to this. This is where rotation and rotation saving was added to milmove transcom/mymove#13572 |
Would this be a possible enhancement to mention to Paul/Wendy as they plan upcoming features? |
Yes, good idea. I will mention this to them |
Important
Jest does not support testing anything with pdfjs-dist
Jest's jsdom environment relies on jest-canvas-mock, and even then it's limited due to the canvas dependency. Canvas's pre-built binary is only supported in the pre-release and I have not seen Jest support for it
Please see the associated milmove playwright test for coverage at transcom/mymove#14218
Ticket
B-21230
Summary
Fixed webpack chunking to enable MyMove support. Previously, when MyMove would import this exact branch, it was not possible to reach our webpack chunks. Since we dynamically import pdfjs-dist, webpack bundlers make it an entirely separate chunk, which is good. But MyMove just needed a unique output path and a script to handle the
/dist/
output. See more in the MyMove PR transcom/mymove#14218Fixed web worker support by enabling better pdfjs task and lifecycle handling. This allows MyMove to swap between more than 1 PDF doc per orders without anything breaking.
Added rotation support for the PDF driver.
Technical Details
Unable to find node on an unmounted component
yarn install
'ing, you get the canvas dependency. MyMove still has some trouble and requires a manualnpm rebuild canvas
command to be run as it doesn't support pre-built binaries/static/react-file-viewer/
which, when imported by MyMove, triggers a file lookup API call to the MyMove server.How to test
Note
The MyMove yarn portion will sound jank, and that's because it is and I don't know how to fix it. Here are the steps
Warning
Do not share the file or image of your locally CAC signed document. It contains PII
brew install pkg-config cairo pango libpng jpeg giflib librsvg
per https://github.com/Automattic/node-canvas/wiki/Installation:-Mac-OS-Xyarn install && export NODE_OPTIONS=--openssl-legacy-provider && yarn build
rm -rf node_modules && yarn install && ./scripts/copy-react-file-viewer && ./scripts/rebuild-dependencies-without-binaries && make client_run
a. One can be found here
Success!
test.pdf.screen.recording.mov