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

B 21228 update pdfjs #9

Merged
merged 11 commits into from
Oct 16, 2024
Merged

B 21228 update pdfjs #9

merged 11 commits into from
Oct 16, 2024

Conversation

cameroncaci
Copy link

@cameroncaci cameroncaci commented Oct 15, 2024

B-21228

Summary

  • Upgrade node and pdfjs-dist.
  • Adjust babel and jest for transpiling ESM modules into CJS.
  • Miscellaneous changes due to transpiling adjustments (Fileviewer export syntax, add exports script to index.html, cheerio resolution, etc.)
  • Addition of Playwright to simulate real browser environment
    • Jest was upgraded in an attempt to be able to use a real pdfjs import rather than a mock, but this did not work as it is still experimental within Jest.
    • Persisting the Jest upgrade for better future support.
  • Added polyfills for future support of handling within the webpack bundle. This effort was halted due to discovery of mymove already handling polyfills.
    • Package upgrades persisted for future support.
  • Workaround of https://github.com/transcom/mymove/security/dependabot/146 has been removed due to it being OBE by the pdfjs-dist upgrade.
  • Upgraded three library and .eslintrc to provide current linter support.
  • Added error catching.
  • Adjusted dev webpack config to use chunks, this facilitates transpiling dependencies separately. This provided many benefits for use within the BundleAnalyzerPlugin.

How to analyze

  1. Clone locally
  2. Run yarn install
  3. Run yarn serve:dev
  4. Preview webpack bundle on http://127.0.0.1:8888/
  5. Preview app on http://localhost:8081/

How to test

  1. Clone locally
  2. Run yarn install
  3. Run yarn test
  4. Run yarn test:e2e
  5. Verify all tests pass

@cameroncaci cameroncaci added the enhancement New feature or request label Oct 15, 2024
@cameroncaci cameroncaci self-assigned this Oct 15, 2024
cameroncaci and others added 2 commits October 15, 2024 09:19
src/components/pdfjs.ts is a leftover of ESM testing
@cameroncaci cameroncaci added the dependencies Pull requests that update a dependency file label Oct 15, 2024
@cameroncaci cameroncaci marked this pull request as ready for review October 15, 2024 13:34
@deandreJones
Copy link

should we bump the version in the package.json file for this change

@cameroncaci
Copy link
Author

should we bump the version in the package.json file for this change

Yes, we should. Doing so now

@cameroncaci cameroncaci merged commit 249ce5a into main Oct 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants