mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
72.27k stars 6.58k forks source link

`@khanacademy/simple-markdown` imposes peer dependency on an old version of react #4302

Closed segevfiner closed 10 months ago

segevfiner commented 1 year ago

Description

When using pnpm:

 WARN  Issues with peer dependencies found
packages/swmd
└─┬ mermaid 10.1.0
  └─┬ @khanacademy/simple-markdown 0.8.6
    ├── ✕ missing peer react@16.14.0
    └── ✕ missing peer react-dom@16.14.0
Peer dependencies that should be installed:
  react-dom@16.14.0  react@16.14.0  

This is annoying, it forces projects to bring in react, and it forces them to an ancient version.

Steps to reproduce

  1. Install mermaid using pnpm <=7: pnpm i mermaid.

Screenshots

No response

Code Sample

No response

Setup

Additional Context

No response

sidharthv96 commented 1 year ago

@knsv

knsv commented 1 year ago

@segevfiner Thanks of reporting, we are not using react so we don't need to have it in the dependencies!

sidharthv96 commented 1 year ago

React seems to be a critical dependency for the package. We'll have to figure out alternatives.

remcohaszing commented 1 year ago

I recommend to have a look at the unified ecosystem. I haven’t really looked at how @khanacademy/simple-markdown is used, but my guess is Mermaid needs something like:

sidharthv96 commented 1 year ago

@knsv we're already using mdast in docs.mts. Works very well.

@remcohaszing would micromark be enough for the usecase?

nathanlesage commented 1 year ago

I can chime in that this issue prevents Zettlr from upgrading to Mermaid v10.x.

Additionally, I have just had a look at the repo, and noticed two issues:

  1. It hasn't been updated in >2 years
  2. It even has a deprecation notice, indicating that it should no longer be used by developers

I can also recommend unified's remark. Depending on how it is being used, however, it is important to have a look here: https://github.com/micromark/micromark-extension-frontmatter/issues/5

YAML frontmatter syntax can currently cause errors in properly building the Markdown AST for unified.

jgreywolf commented 12 months ago

Is this still an open issue? I see one PR was merged to address SimpleMarkdown

jgreywolf commented 10 months ago

Closing due to no response