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

chore: update PDF package #15760

Merged
merged 7 commits into from
Sep 11, 2024
Merged

chore: update PDF package #15760

merged 7 commits into from
Sep 11, 2024

Conversation

disaerna
Copy link
Member

@disaerna disaerna commented Aug 22, 2024

PDF package update ✨

Some letters were not rendering correctly in previous version when users were opening documents in service portal.

"Þið eruð að nota react-pdf 7.5.0 sem notar undirliggjandi pdf-js, það notar útgáfu 3.11.174 af PDF-JS.
Eftir að við fórum í pdf-js 4.x ( sem nýjasta útgáfa af React-pdf notar ) þá höfum við ekki lent í þessu vandamáli.
Er möguleiki að þið getið uppfært PDF viewerinn ykkar. Sá að dependabot er búið að gera þessu PR hjá ykkur á github"

#15546

Hopefully this update will fix this issue 🙏🏼

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Updated the react-pdf library to version 9.1.0, potentially introducing new features and performance improvements.
  • Bug Fixes

    • Improved compatibility and performance of the PdfViewer component by updating the worker source to use ES module format.

dependabot bot and others added 2 commits August 22, 2024 14:51
Bumps [react-pdf](https://github.com/wojtekmaj/react-pdf/tree/HEAD/packages/react-pdf) from 7.5.0 to 9.1.0.
- [Release notes](https://github.com/wojtekmaj/react-pdf/releases)
- [Commits](https://github.com/wojtekmaj/react-pdf/commits/v9.1.0/packages/react-pdf)

---
updated-dependencies:
- dependency-name: react-pdf
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Copy link
Contributor

coderabbitai bot commented Aug 22, 2024

Walkthrough

The changes involve two main updates: the PdfViewer component's worker source URL has been modified to use an ES module format by changing the file extension from .min.js to .min.mjs. Additionally, the react-pdf package version has been updated from 7.5.0 to 9.1.0 in the package.json file.

Changes

File Path Change Summary
libs/island-ui/core/src/lib/PdfViewer/... Updated worker source URL in PdfViewer from .min.js to .min.mjs for ES module support.
package.json Updated react-pdf package version from 7.5.0 to 9.1.0.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@disaerna disaerna added the deploy-feature Deploys features to dev label Aug 22, 2024
Copy link
Contributor

github-actions bot commented Aug 22, 2024

Affected services are: air-discount-scheme-api,air-discount-scheme-backend,api,application-system-api,download-service,financial-aid-api,financial-aid-backend,financial-aid-open-api,github-actions-cache,icelandic-names-registry-backend,judicial-system-api,judicial-system-digital-mailbox-api,judicial-system-backend,judicial-system-message-handler,judicial-system-robot-api,judicial-system-scheduler,judicial-system-xrd-api,license-api,reference-backend,regulations-admin-backend,services-auth-admin-api,services-auth-ids-api,services-auth-delegation-api,services-auth-personal-representative,services-auth-personal-representative-public,services-auth-public-api,services-contentful-entry-tagger,services-documents,services-endorsements-api,services-form-system,services-search-indexer,services-sessions,services-university-gateway,services-user-notification,services-user-profile,services-xroad-collector,skilavottord-ws,air-discount-scheme-web,auth-admin-web,consultation-portal,contentful-apps,financial-aid-web-osk,financial-aid-web-veita,judicial-system-web,skilavottord-web,web,application-system-form,island-ui-storybook,portals-admin,service-portal,system-e2e,external-contracts-tests,
Feature deployment of your services will begin shortly. Your feature will be accessible here:
https://choreupdate-pdf-package-api-catalogue.dev01.devland.is/api
https://choreupdate-pdf-package-api.dev01.devland.is/download
https://choreupdate-pdf-package-application-callback-xrd.internal.dev01.devland.is/application-payment
https://choreupdate-pdf-package-application-callback-xrd.internal.dev01.devland.is/applications
https://choreupdate-pdf-package-application-payment-callback-xrd.internal.dev01.devland.is/application-payment
https://choreupdate-pdf-package-application-payment-callback-xrd.internal.dev01.devland.is/applications
https://choreupdate-pdf-package-beta.dev01.devland.is/
https://choreupdate-pdf-package-beta.dev01.devland.is/api
https://choreupdate-pdf-package-beta.dev01.devland.is/app/skilavottord/
https://choreupdate-pdf-package-beta.dev01.devland.is/app/skilavottord/api/graphql
https://choreupdate-pdf-package-beta.dev01.devland.is/minarsidur
https://choreupdate-pdf-package-beta.dev01.devland.is/samradsgatt
https://choreupdate-pdf-package-beta.dev01.devland.is/stjornbord
https://choreupdate-pdf-package-beta.dev01.devland.is/umsoknir
https://choreupdate-pdf-package-license-api-xrd.internal.dev01.devland.is/
https://choreupdate-pdf-package-loftbru-cf.dev01.devland.is/
https://choreupdate-pdf-package-loftbru-cf.dev01.devland.is/api/graphql
https://choreupdate-pdf-package-loftbru-cf.dev01.devland.is/api/public
https://choreupdate-pdf-package-loftbru-cf.dev01.devland.is/api/swagger
https://choreupdate-pdf-package-loftbru.dev01.devland.is/
https://choreupdate-pdf-package-loftbru.dev01.devland.is/api/graphql
https://choreupdate-pdf-package-loftbru.dev01.devland.is/api/public
https://choreupdate-pdf-package-loftbru.dev01.devland.is/api/swagger
https://choreupdate-pdf-package-service-portal-api.internal.dev01.devland.is/
https://choreupdate-pdf-package-services-university-gateway.internal.dev01.devland.is/api
https://choreupdate-pdf-package-sessions-api.internal.dev01.devland.is/
https://choreupdate-pdf-package-ui.dev01.devland.is/

Deployed services: application-system-api,application-system-form,service-portal,service-portal-api,portals-admin,consultation-portal,api,web,xroad-collector,skilavottord-web,skilavottord-ws,services-documents,island-ui-storybook,download-service,icelandic-names-registry-backend,endorsement-system-api,air-discount-scheme-web,air-discount-scheme-backend,air-discount-scheme-api,regulations-admin-backend,external-contracts-tests,application-system-api-worker,license-api,services-sessions,services-sessions-worker,services-sessions-cleanup,services-university-gateway,services-university-gateway-worker.
Excluded services: search-indexer-service,github-actions-cache,user-notification,user-notification-worker,user-notification-cleanup-worker,contentful-entry-tagger-service,contentful-apps

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 36.76%. Comparing base (9b9610e) to head (2f05cfe).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ibs/island-ui/core/src/lib/PdfViewer/PdfViewer.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15760      +/-   ##
==========================================
- Coverage   36.80%   36.76%   -0.05%     
==========================================
  Files        6692     6692              
  Lines      137152   137642     +490     
  Branches    38992    39426     +434     
==========================================
+ Hits        50478    50599     +121     
- Misses      86674    87043     +369     
Flag Coverage Δ
air-discount-scheme-backend 54.03% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.39% <ø> (ø)
api-catalogue-services 77.85% <ø> (ø)
api-domains-air-discount-scheme 36.75% <ø> (ø)
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 53.90% <ø> (ø)
api-domains-communications 40.51% <ø> (ø)
api-domains-criminal-record 47.77% <ø> (ø)
api-domains-driving-license 44.22% <ø> (ø)
api-domains-education 31.22% <ø> (ø)
api-domains-health-insurance 34.58% <ø> (ø)
api-domains-mortgage-certificate 35.73% <ø> (ø)
api-domains-payment-schedule 41.05% <ø> (ø)
application-api-files 57.49% <ø> (ø)
application-core 71.28% <ø> (-1.01%) ⬇️
application-system-api 41.67% <ø> (ø)
application-template-api-modules 23.52% <ø> (-0.02%) ⬇️
application-templates-accident-notification 19.83% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 22.12% <ø> (ø)
application-templates-driving-license 15.58% <ø> (ø)
application-templates-estate 11.86% <0.00%> (ø)
application-templates-example-payment 20.79% <ø> (ø)
application-templates-financial-aid 12.09% <ø> (ø)
application-templates-general-petition 18.86% <ø> (ø)
application-templates-health-insurance 23.27% <ø> (ø)
application-templates-inheritance-report 4.63% <ø> (ø)
application-templates-marriage-conditions 10.47% <ø> (ø)
application-templates-mortgage-certificate 44.03% <ø> (ø)
application-templates-parental-leave 28.40% <ø> (ø)
application-types 6.74% <ø> (ø)
application-ui-components 1.52% <ø> (ø)
application-ui-shell 21.08% <0.00%> (ø)
auth-admin-web 2.43% <ø> (ø)
auth-nest-tools 30.44% <ø> (ø)
auth-react 22.82% <0.00%> (ø)
auth-shared 75.00% <ø> (ø)
clients-charge-fjs-v2 24.11% <ø> (ø)
clients-driving-license 40.56% <ø> (ø)
clients-driving-license-book 43.85% <ø> (ø)
clients-financial-statements-inao 49.10% <ø> (ø)
clients-license-client 1.83% <ø> (ø)
clients-middlewares 72.44% <ø> (-0.26%) ⬇️
clients-regulations 42.54% <ø> (ø)
clients-rsk-company-registry 29.76% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.75% <ø> (ø)
clients-zendesk 55.65% <ø> (ø)
cms 0.42% <ø> (ø)
cms-translations 39.66% <ø> (ø)
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.50% <ø> (ø)
contentful-apps 6.05% <ø> (ø)
dokobit-signing 62.85% <ø> (ø)
download-service 44.51% <ø> (ø)
email-service 60.65% <ø> (ø)
feature-flags 90.69% <ø> (ø)
file-storage 53.01% <ø> (ø)
financial-aid-backend 56.48% <ø> (ø)
financial-aid-shared 19.03% <ø> (ø)
icelandic-names-registry-backend 54.53% <ø> (+0.17%) ⬆️
infra-nest-server 48.95% <ø> (+0.61%) ⬆️
infra-tracing 43.24% <ø> (ø)
island-ui-core 28.59% <0.00%> (ø)
judicial-system-api 19.35% <ø> (+1.49%) ⬆️
judicial-system-audit-trail 68.53% <ø> (ø)
judicial-system-backend 55.87% <ø> (ø)
judicial-system-formatters 79.83% <ø> (ø)
judicial-system-message 66.79% <ø> (ø)
judicial-system-message-handler 47.61% <ø> (ø)
judicial-system-scheduler 68.98% <ø> (ø)
judicial-system-types 48.34% <ø> (ø)
judicial-system-web 28.71% <0.00%> (ø)
license-api 42.88% <ø> (+0.15%) ⬆️
localization 10.15% <ø> (ø)
logging 48.43% <ø> (ø)
message-queue 68.50% <ø> (+0.78%) ⬆️
nest-audit 68.20% <ø> (ø)
nest-config 78.07% <ø> (ø)
nest-feature-flags 51.91% <ø> (ø)
nest-problem 46.48% <ø> (+0.29%) ⬆️
nest-sequelize 94.44% <ø> (ø)
nest-swagger 51.71% <ø> (ø)
nova-sms 62.18% <ø> (ø)
portals-admin-regulations-admin 1.96% <ø> (ø)
portals-core 16.14% <0.00%> (ø)
reference-backend 50.57% <ø> (+0.25%) ⬆️
regulations 16.78% <ø> (ø)
residence-history 85.00% <ø> (ø)
services-auth-admin-api 51.01% <ø> (ø)
services-auth-delegation-api 61.50% <ø> (-0.08%) ⬇️
services-auth-ids-api 53.77% <ø> (-0.04%) ⬇️
services-auth-personal-representative 48.03% <ø> (ø)
services-auth-personal-representative-public 43.89% <ø> (-0.05%) ⬇️
services-auth-public-api 51.89% <ø> (ø)
services-documents 61.19% <ø> (+0.09%) ⬆️
services-endorsements-api 54.94% <ø> (ø)
services-sessions 65.66% <ø> (+0.05%) ⬆️
services-university-gateway 48.39% <ø> (ø)
services-user-notification 47.69% <ø> (+<0.01%) ⬆️
services-user-profile 62.22% <ø> (ø)
shared-components 27.65% <0.00%> (ø)
shared-form-fields 31.58% <0.00%> (ø)
shared-mocking 64.62% <ø> (ø)
shared-pii 92.85% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 29.26% <ø> (ø)
skilavottord-ws 23.51% <ø> (ø)
web 1.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ibs/island-ui/core/src/lib/PdfViewer/PdfViewer.tsx 5.88% <0.00%> (ø)

... and 28 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da94571...2f05cfe. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Aug 22, 2024

Datadog Report

All test runs 1342d8b 🔗

101 Total Test Services: 0 Failed, 99 Passed
🔻 Test Sessions change in coverage: 4 decreased, 8 increased, 188 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
air-discount-scheme-backend 0 0 0 81 0 30.67s N/A Link
air-discount-scheme-web 0 0 0 2 0 8.63s N/A Link
api 0 0 0 4 0 2.82s N/A Link
api-catalogue-services 0 0 0 23 0 11.76s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 20.32s N/A Link
api-domains-assets 0 0 0 3 0 12.23s N/A Link
api-domains-auth-admin 0 0 0 18 0 12.68s N/A Link
api-domains-communications 0 0 0 5 0 32.63s N/A Link
api-domains-criminal-record 0 0 0 5 0 9.71s N/A Link
api-domains-driving-license 0 0 0 23 0 30.29s N/A Link

🔻 Code Coverage Decreases vs Default Branch (4)

  • services-auth-delegation-api - jest 60.11% (-0.26%) - Details
  • clients-middlewares - jest 75.15% (-0.1%) - Details
  • services-auth-personal-representative-public - jest 45.94% (-0.02%) - Details
  • application-template-api-modules - jest 25.59% (-0.01%) - Details

@disaerna disaerna marked this pull request as ready for review September 4, 2024 11:00
@disaerna disaerna requested review from a team as code owners September 4, 2024 11:00
@disaerna disaerna requested a review from stjanilofts September 4, 2024 11:00
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7fd1639 and 413de25.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (2)
  • libs/island-ui/core/src/lib/PdfViewer/PdfViewer.tsx (1 hunks)
  • package.json (1 hunks)
Additional context used
Path-based instructions (1)
libs/island-ui/core/src/lib/PdfViewer/PdfViewer.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
Additional comments not posted (2)
libs/island-ui/core/src/lib/PdfViewer/PdfViewer.tsx (1)

48-48: LGTM!

The change to use an ES module format for the worker source URL is a good practice and aligns with modern JavaScript environments.

package.json (1)

261-261: Verify that updating the react-pdf package version does not introduce any breaking changes.

Ensure that the application code is compatible with the changes introduced in react-pdf version 9.1.0, especially the modifications related to the PdfViewer component and the worker source URL.

Run the following script to search for any issues related to the react-pdf package update:

Verification successful

Verification successful: No breaking changes found with the react-pdf package update.

The update to react-pdf version 9.1.0 appears to be compatible with the existing codebase. The PdfViewer component and the worker source URL are correctly configured to use the ES module format. No issues were identified in the search results.

  • The PdfViewer component is used in multiple files without issues.
  • The worker source URL is set using the ES module format in PdfViewer.tsx.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any issues related to the react-pdf package update.

# Test: Search for the PdfViewer component usage. Expect: No issues with the worker source URL.
rg --type typescript --type javascript --glob '!node_modules' -A 5 $'PdfViewer'

# Test: Search for any other usage of the react-pdf package. Expect: No breaking changes.
rg --type typescript --type javascript --glob '!node_modules' -A 5 $'react-pdf'

Length of output: 227


Script:

#!/bin/bash
# Description: Search for any issues related to the react-pdf package update.

# Test: Search for the PdfViewer component usage. Expect: No issues with the worker source URL.
rg --type js --type ts --glob '!node_modules' -A 5 $'PdfViewer'

# Test: Search for any other usage of the react-pdf package. Expect: No breaking changes.
rg --type js --type ts --glob '!node_modules' -A 5 $'react-pdf'

Length of output: 36137

@disaerna disaerna removed the deploy-feature Deploys features to dev label Sep 5, 2024
Copy link
Member

@baering baering left a comment

Choose a reason for hiding this comment

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

LGTM.

We trust you to do proper testing before this goes live 🙏

@disaerna disaerna added the automerge Merge this PR as soon as all checks pass label Sep 10, 2024
@oddsson oddsson added automerge Merge this PR as soon as all checks pass and removed automerge Merge this PR as soon as all checks pass labels Sep 10, 2024
@kodiakhq kodiakhq bot merged commit 2aae5e1 into main Sep 11, 2024
255 checks passed
@kodiakhq kodiakhq bot deleted the chore/update-pdf-package branch September 11, 2024 00:06
jonnigs pushed a commit that referenced this pull request Sep 12, 2024
* chore(deps): bump react-pdf from 7.5.0 to 9.1.0

Bumps [react-pdf](https://github.com/wojtekmaj/react-pdf/tree/HEAD/packages/react-pdf) from 7.5.0 to 9.1.0.
- [Release notes](https://github.com/wojtekmaj/react-pdf/releases)
- [Commits](https://github.com/wojtekmaj/react-pdf/commits/v9.1.0/packages/react-pdf)

---
updated-dependencies:
- dependency-name: react-pdf
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: update pdf package

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants