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

fix: update dompurify to ^3.2.1 and remove @types/dompurify #6079

Merged

Conversation

aloisklink
Copy link
Member

📑 Summary

Update DOMPurify to ^3.2.1.

As DOMPurify 3.2.0 added TypeScript types, this means that we can remove our dependency on the @types/dompurify package.

DOMPurify 3.2.0 also adds the HTML_INTEGRATION_POINTS option, which adds back support for <foreignObject>, which broke in DOMPurify 3.1.7. (see

Fixes #6078, #5904 (comment)

📏 Design Decisions

N/A

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

As [DOMPurify 3.2.0 added TypeScript types][1], this means that we can
remove our dependency on the `@types/dompurify` package.

[DOMPurify 3.2.0 also adds the `HTML_INTEGRATION_POINTS` option][2],
which adds back support for `<foreignObject>`,
[which broke in DOMPurify 3.1.7.][3]

[1]: https://github.com/cure53/DOMPurify/releases/tag/3.2.0
[2]: cure53/DOMPurify@e4caa67
[3]: mermaid-js@de2c05c
@aloisklink aloisklink added the Type: Bug / Error Something isn't working or is incorrect label Nov 25, 2024
Copy link

changeset-bot bot commented Nov 25, 2024

🦋 Changeset detected

Latest commit: fe3cffb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mermaid Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the Type: Other Not an enhancement or a bug label Nov 25, 2024
Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit fe3cffb
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/674469462f006900088b0d09
😎 Deploy Preview https://deploy-preview-6079--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

pkg-pr-new bot commented Nov 25, 2024

Open in Stackblitz

npm i https://pkg.pr.new/mermaid-js/mermaid@6079
npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@6079
npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@6079
npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@6079

commit: fe3cffb

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 4.49%. Comparing base (8328f74) to head (fe3cffb).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
packages/mermaid/src/diagrams/common/common.ts 50.00% 2 Missing ⚠️
packages/mermaid/src/mermaidAPI.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6079   +/-   ##
=======================================
  Coverage     4.49%   4.49%           
=======================================
  Files          382     382           
  Lines        53914   53913    -1     
  Branches       621     621           
=======================================
  Hits          2425    2425           
+ Misses       51489   51488    -1     
Flag Coverage Δ
unit 4.49% <40.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
scripts/tsc-check.ts 0.00% <ø> (ø)
packages/mermaid/src/mermaidAPI.ts 0.00% <0.00%> (ø)
packages/mermaid/src/diagrams/common/common.ts 53.01% <50.00%> (+0.13%) ⬆️

Copy link
Collaborator

@knsv knsv left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @aloisklink!

@ashishjain0512 ashishjain0512 merged commit dfaaf36 into mermaid-js:develop Nov 26, 2024
16 of 22 checks passed
@aloisklink aloisklink deleted the chore/update-to-dompurify-3.2.1 branch November 26, 2024 10:35
@github-actions github-actions bot mentioned this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug / Error Something isn't working or is incorrect Type: Other Not an enhancement or a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript can't find dompurify type definition file when the package manager used is yarn
4 participants