-
-
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
Cleanup prior to making logic changes #6041
base: develop
Are you sure you want to change the base?
Conversation
… unnecessary function
|
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
commit: |
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
@sidharthv96 @ashishjain0512 Can one of you please review? I would like to get this in place before I work on all of the pending classDiagram issues |
members: ClassMember[]; | ||
attributes: ClassMember[]; |
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.
This change needs to be documented in a changeset. I'm not really sure if we should consider this as breaking or not, but it should atleast be a minor version bump. @aloisklink wdyt?
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.
I don't see why it should be documented in a changeset.
Are we exposing the class types externally to any users of Mermaid?
The only thing I can exported that is potentially risky is the InternalHelpers
type:
mermaid/packages/mermaid/src/internals.ts
Line 33 in 037ba2f
export type InternalHelpers = typeof internalHelpers; |
@mermaid-js/layout-elk
package:
mermaid/packages/mermaid/src/internals.ts
Lines 15 to 33 in 037ba2f
/** | |
* Internal helpers for mermaid | |
* @deprecated - This should not be used by external packages, as the definitions will change without notice. | |
*/ | |
export const internalHelpers = { | |
common, | |
getConfig, | |
insertCluster, | |
insertEdge, | |
insertEdgeLabel, | |
insertMarkers, | |
insertNode, | |
interpolateToCurve, | |
labelHelper, | |
log, | |
positionEdgeLabel, | |
}; | |
export type InternalHelpers = typeof internalHelpers; |
But it doesn't look like this ClassNode
is being exported anywhere.
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.
Although we are not exporting it, it's being used by others like excalidraw. So it's good to be documented in the changelog.
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.
Ah, we are exporting it, just not via the import XXX from 'mermaid';
entry-point.
We should probably ban import type XXX from 'mermaid/dist/xxxxx'
by removing this line in our package.json
:
mermaid/packages/mermaid/package.json
Line 14 in d4e5acc
"./*": "./*" |
Maybe we can create a separate entry-point like import type XXX from 'mermaid/internal-types'
where all these types are explicitly marked as not covered by SemVer and may change even between patch releases?
Or we could use something like https://api-extractor.com/ to mark types as @alpha
/@beta
/@internal
and warn us about breaking changes to the types automatically.
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.
Should it? Agree with Alois that internal names should not be an issue that causes a version bump.
Co-authored-by: Sidharth Vinod <[email protected]>
Co-authored-by: Sidharth Vinod <[email protected]>
📑 Summary
This PR is for small cleanup to code before making larger changes to address multiple issues related to class diagrams.
Ensure consistent naming between documentation and code, and remove an unnecessary function
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.