-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94966cb
commit 2650d3d
Showing
11 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
17 changes: 17 additions & 0 deletions
17
docs/documentation/zh/modules-reference/diagrams/declaration-files.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
docs/documentation/zh/modules-reference/diagrams/esm-cjs-interop.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
1 change: 1 addition & 0 deletions
1
docs/documentation/zh/modules-reference/diagrams/esm-cjs-interop.md-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.