-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
feat: Add diagramType to RenderResult and ParseResult #5118
Conversation
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Two things:
- I'd like the
| false
to be moved out of theParseResult
type and instead into the ReturnType ofparse()
, since that will make it easier to work with. - Please add a
!
into the PR title, e.g.feat!: my description
, to further emphasise that there is a breaking change. I'd even recommend changing the name of this PR to something like:feat!: change `parse()` to return object on valid diagrams
to make it more obvious that there is a breaking change, and what it is.
Other than that, this PR looks good to me!
Co-authored-by: Alois Klink <alois@aloisklink.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## next #5118 +/- ##
=======================================
Coverage 44.50% 44.50%
=======================================
Files 25 25
Lines 5206 5206
Branches 25 25
=======================================
Hits 2317 2317
Misses 2888 2888
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. |
* next: chore: Fix import.meta.vitest warnings Update docs Update NiceGuy.io links in integrations-community.md
Co-authored-by: Alois Klink <alois@mermaidchart.com>
into sidv/diagramType * 'sidv/diagramType' of https://github.com/mermaid-js/mermaid: Update docs Update packages/mermaid/src/docs/config/usage.md
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.
Thanks for making those changes, I'll leave it open for a few days before merging, in case anybody else wants to review, but it looks good to me now!
📑 Summary
This allows users to get the type of the diagram without calling an extra function.
Resolves #5117
📏 Design Decisions
The return type of
parse
changes, so it is a breaking change. We decided that keeping the return type non-homogeneous is the best option in terms of forward and backwards compatibility.render
only has an additional parameter to the return type, so it is unlikely to cause issues.📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.next
branch