Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hanyujie2002 committed Mar 20, 2024
1 parent 94966cb commit 2650d3d
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/documentation/zh/modules-reference/diagrams/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Some of this content uses mermaid diagrams. We could render them as part of the website build with gatsby-remark-mermaid, but that requires puppeteer/Chromium, which has historically caused a lot of cross-platform build issues. These diagrams should not change often, so I’m just going to store the source here and generate the SVGs manually.

Example:

```sh
npm install -g @mermaid-js/mermaid-cli
cd packages/documentation/copy/en/modules-reference/diagrams
mmdc -c mermaid.config.json -i esm-cjs-interop.md
```

declaration-files.svg is a non-Mermaid replacement for theory.md-4.svg. I made it for a talk one time and it’s better than what Mermaid can do with a flowchart.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```mermaid
graph TB
subgraph Transpiled[ESM transpiled to CJS]
direction TB
C[Importing module] -- designed based on spec --> D[Imported module]
end
subgraph ESM
direction TB
A[Importing module] -- specified behavior --> B[Imported module]
end
```

```mermaid
graph TD
subgraph Transpiled[ESM transpiled to CJS]
C[Importing module] -- designed based on spec --> D[Imported module]
end
subgraph CJS[True CJS]
E[Imported module]
end
subgraph ESM
A[Importing module] -- specified behavior --> B[Imported module]
end
A -. unspecified behavior .-> E
C .->|"<span style='font-size: 3em'>❓🤷🏻‍♂️❓</span>"| E
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2650d3d

Please sign in to comment.