Skip to content

add pictures for module theory #66

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

Merged
merged 6 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Member

@awxiaoxian2020 awxiaoxian2020 Mar 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI tells us we need "permalink".

Could we add this folder in Localization site?

Ping @orta politely to get some ideas :)

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
Loading