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

Replace dagre/dagre-d3 with dagre-d3-es #3809

Merged
merged 5 commits into from
Nov 21, 2022

Commits on Nov 18, 2022

  1. Configuration menu
    Copy the full SHA
    6e234f1 View commit details
    Browse the repository at this point in the history
  2. test(e2e): move mindmap tests to mindmap.spec.js

    Currently, we have mindmap tests in the
    cypress/integration/rendering/mermaid.spec.js which is a bit
    odd. They should probably all be in the mindmap.spec.js file.
    aloisklink committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    b9dcdb0 View commit details
    Browse the repository at this point in the history
  3. test(e2e): remove unused mermaid.spec.js file

    All tests have been moved to `mindmap.spec.js` in a previous commit.
    aloisklink committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    57edcfe View commit details
    Browse the repository at this point in the history
  4. test(e2e): test for mindmap before snapshot

    Sometimes, the mindmap e2e tests take a snapshot when the mindmap
    SVG has been created, but hasn't yet been fully rendered.
    
    This adds a quick check for a mindmap section root, so that the
    snapshot is only taken after the mindmap diagram has started
    rendering.
    
    I was also running into JSDoc ESLint warnings, so I moved the file
    into a TypeScript file to fix those warnings.
    aloisklink committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    537a627 View commit details
    Browse the repository at this point in the history
  5. chore: replace dagre/dagre-d3 with dagre-d3-es

    Replace the dagre and dagre-d3 libraries with dagre-d3-es.
    
    Both dagre and dagre-d3 are deprecated and unmaintained,
    and haven't been updated for more than 3 years.
    
    Since dagre-d3 still requires an old version of d3, this causes
    a bunch of security warnings,
    e.g. GHSA-36jr-mh4h-2g58
    
    The [dagre-d3-es](https://github.com/tbo47/dagre-es) package is a fork
    that contains support for `"d3": "^7.6.1"`. Also, it's ESM, so we will
    hopefully get smaller bundle sizes too. The only issue is that this
    fork isn't very well used (only has 3000 weekly downloads),
    compared to `dagre-d3`'s 250,000 weekly downloads.
    
    (although to be fair, a large proportion of dagre-d3's downloads
     probably come from mermaid)
    
    Since it's is a less popular package,
    **I've pinned `dagre-d3-es` to `"7.0.2"` instead of `"^7.0.2"`**.
    This does mean if there is a bug in `dagre-d3-es`, we will have to
    manually bump it ourselves, but it also means we won't accidentally
    be sending a buggy version of `dagre-d3-es` out to users in cases
    something changes (it might be worth disabling renovate for this
    if we're feeling paranoid!)
    aloisklink committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    fd76e0e View commit details
    Browse the repository at this point in the history