-
-
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
chore: Deprecate mermaidAPI #4821
Conversation
✅ 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 #4821 +/- ##
=======================================
Coverage 5.73% 5.74%
=======================================
Files 279 280 +1
Lines 42022 41932 -90
Branches 517 492 -25
=======================================
- Hits 2409 2408 -1
+ Misses 39613 39524 -89
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.
Deprecating the init
, mermaidAPI.render
, mermaidAPI.initialize
, mermaidAPI.parse
functions make sense to me, although I'm uncertain if it makes sense to deprecate the entire mermaidAPI
object. My comments:
-
Instead of
@deprecate
-ing the entiremermaidAPI
object, would it make more sense to just@deprecate
mermaidAPI.render
andmermaidAPI.initialize
andmermaidAPI.parse
? The other functions inmermaidAPI
don't seem to have replacements (and if they do have replacements, it's probably easier to describe the replacements in a separate@deprecated Use <...> instead
line). -
We shouldn't mark the
mermaidAPI
as@internal
if it might be being used by third-parties. Using@internal
might even hide the@deprecated
warning for users. -
If we're
@deprecate
-ing functions that may be used by people (and I think it's likely that some people are using these functions), we might want to hold back on deprecating these functions until a v11 release.
Theeslint-plugin-deprecation
has 350,000 weekly downloads, so it's quite possible that adding@deprecated
will be a breaking change for some users.Although, SemVer just states we should make a MINOR release for deprecations, so 🤷, maybe it's overkill to wait until a MAJOR release.
-
We probably should also make a
Deprecation
label for this PR, and add a Deprecated entry in https://github.com/mermaid-js/mermaid/blob/develop/.github/release-drafter.yml.
Only The intention is to provide mermaid.ts as the only "official" entrypoint into mermaid, so that we have more flexibility internally to change things, while keeping the public API stable (with low surface area). |
We turned it around then. The idea with the mermaidAPI was to have one entry point into Mermaid, which users using their own bootstraps/integrations could use. The mermaid.js was just one reference implementation. I am little concerned by the potentially braking change though. This might be better in v11 |
There doesn't seem to be any replacements for /**
* {@inheritDoc ./config.js:getConfig} // not sure if this syntax will work?
* @deprecated This function may be removed in the future.
* Please comment in <GH discussion thread> if you use this feature.
*/
function getConfig() {
return getConfig();
} I could see mermaid.initialize({
secure: [
...myCustomSecureFields,
...mermaid.mermaidAPI.defaultConfig.secure,
],
}); |
@aloisklink we can add those if someone requests those, we are only deprecating |
* next: (387 commits) build(deps-dev): bump vite from 4.4.9 to 4.4.12 Changes to .prettierignore 1. Added 'demos/dev/**' to be ignored by Prettier. 2. Added '!/demos/dev/example.html' so that Prettier ensures no one changes the example.html in a way that doesn't obey the Prettier code formatting rules. build: use `tsx` instead of `ts-node-esm` chore: Downgrade node to 18.18.2 fix: #5100 Add viewbox to sankey chore(deps): update all minor dependencies chore: Rename test test: Add unit test for generic classname and namespace fix: Check if parentCommit is provided Split type from generic class name Condition of Parent Id Without Merge Commit Added Referenced the PmWiki's Cookbook recipe enabling MermaidJs schematics in wiki pages test(e2e): fix pie chart E2E tests for PR #4288 Add dummy commit to trigger GH checks chore: Revert unnecessary export refactor: Remove unnecessary calculations chore: Fix computeWidth function chore: Cleanup setupGraphViewbox Update docs update mermaidAPI to cleanup the text before passing to getDiagramFromText ...
In that case, I think we definitely need to at least improve the deprecation message, e.g. explaining that if A quick search of My gut feeling is also to add a And we need to remove the |
Ha from the beginning the mermaidAPI was intended to be the official API to use mermaid. The mermaid bootstrap was one reference implementation suing the API. |
* develop: (588 commits) Linting chore: temp fix for eslint OOM chore: Update error snapshots Fix ESLint chore: Prettier chore: YOLO `pnpm --recursive update` chore: Remove commitlint Fix flowchart-elk render test chore: Add example page link in index chore: Minor fixes chore: Build docs Use develop as base on develop branch. Update renovate json update link update announcement and blog pages Remove `--force` flag Tweak editor.bash update link chore: update browsers list Update integrations-community: add Drupal and module. ...
* develop: (138 commits) chore: Update docs chore: Add argos token to cypress config. chore: Remove cy.get('svg') calls chore: fix Argos parallel chore: Support local screenshot testing without applitools or argos chore: Skip checking drupal links chore: Remove reference screenshot generation from E2E chore: Remove cytoscape patch. chore(argos): disable matchImageSnapshot chore(argos): put parallel mode only when necessary chore(argos): setup parallel mode chore: setup Argos Visual Testing on E2E Fixed linters Added more specs for elk detector Fixed wrong elk detector, check only beginning of the line for diagram keywords Removed unused patch Fix cytoscape patch chore: Remove cytoscape patch. docs: fix node version in CONTRIBUTING.md Explain line breaks in `sequenceDiagram.md` ...
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
* develop: (21 commits) chore: update browsers list chore(deps): update all patch dependencies docs: Added demo diagram of bidirectional arrows for sequence diagrams fix(deps): update all patch dependencies chore: Update drupal regex chore: Update pnpm rebuild chore: Use string templates chore: Fix docs fix tests update arrow startx position move arrowhead adjustment to buildMessageModel fixed incorrect spacing, added e2e-test Format Replace regex with contain match Format Fix test Add charset=UTF-8 Encode string to UTF-8 before encoding to Base64 fix arrow pointer x position ...
* develop: chore: Stricter TS version
* develop: chore Add vitest.workspace.js
* develop: chore: Prettier format
📑 Summary
Deprecates the use of mermaidAPI.
Update docs to remove references to mermaidAPI.
Add docs for mermaid object.
mermaid.parse
andmermaid.render
should be used instead ofmermaid.mermaidAPI.parse
andmermaid.mermaidAPI.render
.📏 Design Decisions
Using MermaidAPI directly could cause issues, and making it internal lets us make changes easily.
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.develop
branch