-
-
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
Release/10.0.0 #4108
Release/10.0.0 #4108
Changes from all commits
08ac411
004432f
ac23194
17238c0
ccaa999
4ed6ec1
fec193e
e31924e
3c4a6a1
0f36bbf
bd98f14
ea8128e
2c062d6
735faa8
31629fe
631ff8f
c1aad59
45adc5f
d22e8d9
eaa84d2
d292743
735aceb
6aa3ea4
1684faf
6e3d96e
8c64a90
8363552
57fd3e5
4ea7294
83f3ceb
8469e72
1691d48
db8a14c
4a721a2
77207e0
e22171c
5de5598
4c7306d
40b5f86
38b2cbc
68cdc75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,58 @@ | ||
# A collection of updates that change the behaviour | ||
# A collection of updates that change the behavior | ||
|
||
## Async | ||
|
||
`parse`, `render` are now async. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be worth having some examples here, since this is probably one of the most important changes! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I'll add documentation soon (with examples and live editor commits for migration) |
||
|
||
## Lazy loading and asynchronisity | ||
|
||
- Invalid dates are rendered as syntax error instead of returning best guess or the current date | ||
|
||
## ParseError is removed | ||
|
||
```js | ||
//< v10.0.0 | ||
mermaid.parse(text, parseError); | ||
|
||
//>= v10.0.0 | ||
await mermaid.parse(text).catch(parseError); | ||
// or | ||
try { | ||
await mermaid.parse(text); | ||
} catch (err) { | ||
parseError(err); | ||
} | ||
``` | ||
|
||
## Init deprecated and InitThrowsErrors removed | ||
|
||
The config passed to `init` was not being used eariler. | ||
It will now be used. | ||
The `init` function is deprecated and will be removed in the next major release. | ||
init currently works as a wrapper to `initialize` and `run`. | ||
|
||
```js | ||
//< v10.0.0 | ||
mermaid.init(config, selector, cb); | ||
|
||
//>= v10.0.0 | ||
mermaid.initialize(config); | ||
mermaid.run({ | ||
querySelector: selector, | ||
postRenderCallback: cb, | ||
suppressErrors: true, | ||
}); | ||
``` | ||
|
||
```js | ||
//< v10.0.0 | ||
mermaid.initThrowsErrors(config, selector, cb); | ||
|
||
//>= v10.0.0 | ||
mermaid.initialize(config); | ||
mermaid.run({ | ||
querySelector: selector, | ||
postRenderCallback: cb, | ||
suppressErrors: false, | ||
}); | ||
``` |
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.
We need to document that Mermaid is now ESM only.
Ideally we should show some example usage too.