diff --git a/V10-BreakingChanges.md b/V10-BreakingChanges.md index e3322a3a1..121fdd596 100644 --- a/V10-BreakingChanges.md +++ b/V10-BreakingChanges.md @@ -2,7 +2,7 @@ ## Async -`init`, `parse`, `render` are now async. +`parse`, `render` are now async. ## Lazy loading and asynchronisity @@ -23,3 +23,36 @@ try { 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, +}); +``` diff --git a/cypress/integration/rendering/flowchart-elk.spec.js b/cypress/integration/rendering/flowchart-elk.spec.js index 0d4ec4211..ee803b0d8 100644 --- a/cypress/integration/rendering/flowchart-elk.spec.js +++ b/cypress/integration/rendering/flowchart-elk.spec.js @@ -133,7 +133,7 @@ describe('Flowchart ELK', () => { }); }); - it('V2 elk - 16: Render Stadium shape', () => { + it.skip('V2 elk - 16: Render Stadium shape', () => { imgSnapshotTest( ` flowchart-elk TD A([stadium shape test]) diff --git a/cypress/platform/external-diagrams-example-diagram.html b/cypress/platform/external-diagrams-example-diagram.html index a1339d4e6..b5b716ff8 100644 --- a/cypress/platform/external-diagrams-example-diagram.html +++ b/cypress/platform/external-diagrams-example-diagram.html @@ -17,7 +17,7 @@ example-diagram await mermaid.registerExternalDiagrams([exampleDiagram]); await mermaid.initialize({ logLevel: 0 }); - await mermaid.initThrowsErrors(); + await mermaid.run(); if (window.Cypress) { window.rendered = true; } diff --git a/cypress/platform/render-after-error.html b/cypress/platform/render-after-error.html index 72ccac34c..2334158c2 100644 --- a/cypress/platform/render-after-error.html +++ b/cypress/platform/render-after-error.html @@ -11,7 +11,8 @@