Skip to content
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

mermaid-cli v11 breaking changes #701

Merged
merged 14 commits into from
Sep 9, 2024

Conversation

aloisklink
Copy link
Member

@aloisklink aloisklink commented Jun 16, 2024

📑 Summary

Upgrade mermaid-cli to support Mermaid v11.

While I was at it, I've also taken the opportunity to make some breaking changes, now that we'll have a major version bump.

BREAKING CHANGES

📏 Design Decisions

I've also changed our package manger from yarn to npm (closes #529). Yarn v1 is quite outdated and newer versions of npm have similar features now. The latest versions of npm also support generating provenance statements, see https://docs.npmjs.com/generating-provenance-statements.

I know this is quite a big PR! @MindaugasLaganeckas, please let me know if you'd prefer me to break this up into smaller PRs! I was just a bit lazy and didn't want to have to constantly rebase my PRs to fix merge conflicts!

Thanks to @saurabhg772244 for helping me with upgrading to Mermaid v11 and using the new @mermaid-js/layout-elk package!

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added unit/e2e tests (if appropriate)
  • 🔖 targeted master branch

@aloisklink aloisklink changed the title [DRAFT] mermaid-cli v11 breaking changes mermaid-cli v11 breaking changes Aug 26, 2024
@aloisklink aloisklink marked this pull request as ready for review August 26, 2024 10:16
@aloisklink aloisklink mentioned this pull request Aug 26, 2024
3 tasks
@saurabhg772244
Copy link
Contributor

saurabhg772244 commented Aug 26, 2024

Request BLOCKING:
@aloisklink There are some parts missing for adding commander options for layout. This needs to be added and passed along as mermaidConfig

Discussed a bit more. we can have that in subsequent PR's

aloisklink and others added 14 commits September 3, 2024 14:32
This will be required by Vite v5.
This is used by corepack.
Node.JS v18.19 is the version of Node.JS that is available in Debian 12
and Ubuntu 24.04, so it's a good minumum version for us to support to.

BREAKING CHANGE: The minimum required Node.JS version is now 18.19.
                 Support for Node.JS v14, v15, v16, v17, and v19
                 have been dropped.
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD will be removed in Puppeteer v20.
BREAKING CHANGE: FontAwesome v6 shouldn't have many breaking changes,
                 but please see https://fontawesome.com/changelog for
                 a full list of breaking changes.
Make `puppeteer` a `peerDependency` so that users can pick which
versions of Puppeteer they want to install.

I've specified that the allowable versions are:
`^19 || ^20 || ^21 || ^22`. I've also upgraded our tests to run with
Puppeteer v22.

BREAKING CHANGE: Puppeteer is now a `peerDependency` instead of a
                 `dependency`. This means you may need to manually
                 install your own version of Puppeteer.
`headless: 'shell'` uses the old chrome headless mode, and is much
faster than the default new headless mode, see
https://pptr.dev/guides/headless-modes/
In Puppeteer v22, using `headless: 'shell'` is much faster than the new
headless mode.

It also works in Puppeteer v19, v20, and v21 (although it prints a
warning).
BREAKING CHANGE: The deprecated `parseMMD` function has been removed.
                 Please use the `data` property returned from
                 `renderMermaid()`.
Commander v12 drops Node.JS v16 support.
Mermaid v11 has a new `@mermaid-js/layout-elk` package that needs to be
setup for old `flowchart-elk` diagrams to continue to work.

BREAKING CHANGE: Mermaid v11 has some breaking changes, see
                 https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0

Co-authored-by: Alois Klink <alois@aloisklink.com>
Upgrade to Puppeteer v23 and drop support for previous Puppeteer
versions.

BREAKING CHANGE: The minimum supported version of Puppeteer is now v23.
BREAKING CHANGE: The `renderMermaid()` function now returns a
                 `Uint8Array` instead of a `Buffer`, as Puppeteer v23
                 now returns a `Uint8Array`.
Yarn v1 is quite outdated and newer versions of npm have similar
features now.
Mermaid v11.0.2 no longer allows the invalid comments in git graphs with
only one `%` character. You now need `%%`.
@aloisklink
Copy link
Member Author

Rebased to fix merge conflicts. @MindaugasLaganeckas, if you have time, would you mind reviewing and, if everything looks good, making a release (please copy the above list of BREAKING CHANGES into the release notes)?

I still unfortunately don't know the release process!

Copy link
Member

@MindaugasLaganeckas MindaugasLaganeckas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this awesome contribution!

@MindaugasLaganeckas MindaugasLaganeckas merged commit 0529bbe into mermaid-js:master Sep 9, 2024
4 of 5 checks passed
@aloisklink aloisklink deleted the v11 branch September 9, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants