Skip to content

Commit 1043874

Browse files
committed
fix
1 parent 94966cb commit 1043874

File tree

12 files changed

+170
-71
lines changed

12 files changed

+170
-71
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
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.
2+
3+
Example:
4+
5+
```sh
6+
npm install -g @mermaid-js/mermaid-cli
7+
cd packages/documentation/copy/en/modules-reference/diagrams
8+
mmdc -c mermaid.config.json -i esm-cjs-interop.md
9+
```
10+
11+
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.

docs/documentation/zh/modules-reference/diagrams/declaration-files.svg

Lines changed: 17 additions & 0 deletions
Loading
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
```mermaid
2+
graph TB
3+
subgraph Transpiled[ESM transpiled to CJS]
4+
direction TB
5+
C[Importing module] -- designed based on spec --> D[Imported module]
6+
end
7+
subgraph ESM
8+
direction TB
9+
A[Importing module] -- specified behavior --> B[Imported module]
10+
end
11+
```
12+
13+
```mermaid
14+
graph TD
15+
subgraph Transpiled[ESM transpiled to CJS]
16+
C[Importing module] -- designed based on spec --> D[Imported module]
17+
end
18+
subgraph CJS[True CJS]
19+
E[Imported module]
20+
end
21+
subgraph ESM
22+
A[Importing module] -- specified behavior --> B[Imported module]
23+
end
24+
A -. unspecified behavior .-> E
25+
C .->|"<span style='font-size: 3em'>❓🤷🏻‍♂️❓</span>"| E
26+
```
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)