-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Saurabh/refactor/convert class db to class #6212
base: develop
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 90bbf90 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
commit: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6212 +/- ##
==========================================
- Coverage 4.47% 4.47% -0.01%
==========================================
Files 383 385 +2
Lines 54142 54189 +47
Branches 596 598 +2
==========================================
Hits 2425 2425
- Misses 51717 51764 +47
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
To avoid the ESLint @typescript-eslint/unbound-method
errors in the packages/mermaid/src/diagrams/class/classDiagram.spec.ts
file, I'd recommend just adding a comment in the file like /* eslint-disable @typescript-eslint/unbound-method -- Broken for Vitest mocks, see https://github.com/vitest-dev/eslint-plugin-vitest/pull/286 */
this.notes = []; | ||
this.interfaces = []; | ||
this.functions = []; | ||
this.functions.push(this.setupToolTips); |
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.
Can we turn setupToolTips
into a normal class method and use .bind(this);
here?
this.functions.push(this.setupToolTips); | |
this.functions.push(this.setupToolTips.bind(this)); |
See also
this.functions.push(this.setupToolTips); |
* @param type - The type to look for | ||
* @returns The arrow marker | ||
*/ | ||
private readonly getArrowMarker = (type: number) => { |
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.
Does this need to be an arrow function? Can we change it to a normal class method?
this.setTooltip = this.setTooltip.bind(this); | ||
this.setClickEvent = this.setClickEvent.bind(this); | ||
this.setCssStyle = this.setCssStyle.bind(this); | ||
this.setClickFunc = this.setClickFunc.bind(this); |
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.
Can you explain why this is needed? I can't see it being used in the JISON file.
|
||
private sanitizeText(txt: string) { | ||
return common.sanitizeText(txt, getConfig()); | ||
} |
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.
Since this function is private and doesn't need this
, should we move it out of the class?
public lineType = { | ||
LINE: 0, | ||
DOTTED_LINE: 1, | ||
}; | ||
|
||
public relationType = { | ||
AGGREGATION: 0, | ||
EXTENSION: 1, | ||
COMPOSITION: 2, | ||
DEPENDENCY: 3, | ||
LOLLIPOP: 4, | ||
}; |
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.
Can you make these readonly
so we can't change them?
📑 Summary
diagramObject.db
is called.Resolves #
📏 Design Decisions
📋 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:
.