-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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: Support Iconify Icons #5793
Conversation
* develop: [autofix.ci] apply automated fixes test: Skip architecture diagram [autofix.ci] apply automated fixes fix: Update diagram keyword
🦋 Changeset detectedLatest commit: e44cdbd The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5793 +/- ##
==========================================
- Coverage 5.02% 5.01% -0.01%
==========================================
Files 336 337 +1
Lines 48061 48085 +24
Branches 575 550 -25
==========================================
Hits 2413 2413
- Misses 45648 45672 +24
Flags with carried forward coverage won't be shown. Click here to find out more.
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
…into sidv/iconify * 'sidv/iconify' of https://github.com/mermaid-js/mermaid: [autofix.ci] apply automated fixes
Currently we're adding a new function, but, what if we pass promises that resolve to JSON to mermaid.initialize? This would allow us to avoid the following issue. But, it'll mean mermaid.initialize will have to return a promise, so it'll be a breaking change. So maybe for v12? import mermaid from 'CDN/mermaid.esm.mjs';
// You have to call `initialize` with startOnLoad:false before calling `registerIconPacks`,
// to prevent mermaid from starting before the icons are loaded
mermaid.initialize({
startOnLoad: false,
logLevel: 0,
});
const logos = await fetch('https://unpkg.com/@iconify-json/logos/icons.json');
mermaid.registerIconPacks(await logos.json());
mermaid.init(); Proposed solution, where mermaid waits internally for all the promises to be resolved, before rendering. import mermaid from 'CDN/mermaid.esm.mjs';
const logos = fetch('https://unpkg.com/@iconify-json/logos/icons.json').then(res => res.json());
mermaid.initialize({
startOnLoad: true,
logLevel: 0,
iconPacks: [ logos ]
}); |
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.
LGTM, tested by checking out locally.
I like the proposed unified approach. @knsv what do you think? |
Co-authored-by: Alois Klink <alois@aloisklink.com>
📑 Summary
Adds support for Iconify in mermaid.
Currently, only Architecture diagram has support, but it will be extended to others soon.
📏 Design Decisions
Instead of creating and maintaining a different Icon pack format for mermaid, adopting Iconify allows the users to enable support for the 200,000+ icons available in iconify.
📋 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:
.