8000 Handle StateDB `.extract()` properly by saurabhg772244 · Pull Request #6293 · mermaid-js/mermaid · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handle StateDB .extract() properly #6293

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

Conversation

saurabhg772244
Copy link
Collaborator

Fix the StateDB properly for stateDiagram-v1 vs stateDiagram-v2.

📑 Summary

  • Added a version parameter to the StateDB constructor.
  • Modified the setRootDoc method to handle multiple versions.
  • Updated tests and diagrams to support the new version in StateDB.
  • Removed unnecessary extract calls.

📏 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:.

Fix the StateDB properly for stateDiagram-v1 vs stateDiagram-v2.
Copy link
changeset-bot bot commented Feb 17, 2025

🦋 Changeset detected

Latest commit: cfd84e5

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 Feb 17, 2025
Copy link
netlify bot commented Feb 17, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit cfd84e5
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/67b313340d74360008493813
😎 Deploy Preview https://deploy-preview-6293--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 Feb 17, 2025

Open in StackBlitz

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

commit: cfd84e5

Copy link
codecov bot commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Project coverage is 4.46%. Comparing base (5482565) to head (cfd84e5).
Report is 577 commits behind head on develop.

Files with missing lines Patch % Lines
packages/mermaid/src/diagrams/state/stateDb.js 0.00% 21 Missing ⚠️
...ages/mermaid/src/diagrams/state/stateDiagram-v2.ts 0.00% 1 Missing ⚠️
...ackages/mermaid/src/diagrams/state/stateDiagram.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #6293      +/-   ##
==========================================
- Coverage     4.47%   4.46%   -0.01%     
==========================================
  Files          385     385              
  Lines        54244   54262      +18     
  Branches       598     598              
==========================================
  Hits          2425    2425              
- Misses       51819   51837      +18     
Flag Coverage Δ
unit 4.46% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
...ckages/mermaid/src/diagrams/state/stateRenderer.js 0.00% <ø> (ø)
...ages/mermaid/src/diagrams/state/stateDiagram-v2.ts 0.00% <0.00%> (ø)
...ackages/mermaid/src/diagrams/state/stateDiagram.ts 0.00% <0.00%> (ø)
packages/mermaid/src/diagrams/state/stateDb.js 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
argos-ci bot commented Feb 17, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Feb 17, 2025, 10:59 AM

Copy link
Member
@aloisklink aloisklink left a comment

Choose a reason for hiding this comment

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

Looks good to me (although I don't know if I can approve it since I was the author of cfe710f)

@@ -136,7 +136,6 @@ const renderDoc = (doc, diagram, parentId, altBkg, root, domDocument, diagObj) =
return {};
});

diagObj.db.extract(doc);
Copy link
Member

Choose a reason for hiding this comment

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

Great, I was planning to remove this duplicate extraction in the TS conversion.

@sidharthv96 sidharthv96 merged commit 62edea6 into develop Feb 17, 2025
25 checks passed
@sidharthv96 sidharthv96 deleted the saurabh/refactor/handle-StateDB-.extract-properly branch February 17, 2025 15:43
@github-actions github-actions bot mentioned this pull request Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sponsored by MermaidChart Type: Other Not an enhancement or a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0