diff --git a/docs/technical/architecture.md b/docs/technical/architecture.md index b6f0bf5945..289b7cfdef 100644 --- a/docs/technical/architecture.md +++ b/docs/technical/architecture.md @@ -46,33 +46,18 @@ the `.jj/repo/store/type` file. There are similar files for the other backends ### Overview -Here's a diagram showing some important types in the library crate. The -following sections describe each component. - -```mermaid -graph TD; - ReadonlyRepo-->Store; - ReadonlyRepo-->OpStore; - ReadonlyRepo-->OpHeadsStore; - ReadonlyRepo-->ReadonlyIndex - MutableIndex-->ReadonlyIndex; - Store-->Backend; - GitBackend-->Backend; - LocalBackend-->Backend; - LocalBackend-->StackedTable; - MutableRepo-->ReadonlyRepo; - MutableRepo-->MutableIndex; - Transaction-->MutableRepo; - WorkingCopy-->TreeState; - Workspace-->WorkingCopy; - Workspace-->RepoLoader; - RepoLoader-->Store; - RepoLoader-->OpStore; - RepoLoader-->OpHeadsStore; - RepoLoader-->ReadonlyRepo; - Git-->GitBackend; - GitBackend-->StackedTable; -``` +Here's a diagram showing some important types in the library crate, and how they +relate. For example, given a `Workspace`, you can use it to get a `WorkingCopy` +or a `RepoLoader`. A `Transaction` is required to acquire a `MutableRepo`, etc. +The following sections describe each component. + +![Type diagram](types.svg) + +_This diagram was created with [Excalidraw]. You can get a copy of it [at this +location][types-drawing], and Right Click > "Copy to Clipboard as SVG"._ + +[Excalidraw]: https://excalidraw.com/ +[types-drawing]: https://excalidraw.com/#json=wuOSusqzm6MjoXatFk1kn,aCySj27AVmQMf7aJdMzMCw ### Backend diff --git a/docs/technical/types.svg b/docs/technical/types.svg new file mode 100644 index 0000000000..94c816db12 --- /dev/null +++ b/docs/technical/types.svg @@ -0,0 +1,10 @@ + + + + + + + + WorkspaceWorkingCopyTreeStateRepoLoaderTransactionStoreOpStoreOpHeadsStoreGitBackendGitReadOnlyRepoMutableRepoMutableIndexReadOnlyIndexLocalBackendStackedTableBackendLocalWorkingCopyLegend:Concrete RootTypeInterface(trait)Concrete TypeTrait Impl"A depends on type B"BA"A depends on trait B"BA"A implements trait B"BAWorking Copy MgmtCommit BackendJujutsu: type-oriented structure