Dendron Plugin Architecture

Summary

Describes Dendron Plugin Architecture

Design

The Dendron Plugin is designed with a client server architecture. The client in this case is the Code Plugin.
The server is a local express.js server that starts in a separate process when the extension first activates.

sequenceDiagram participant vscodePlugin participant localServer vscodePlugin->>localServer: methodCall: eg.lookup localServer->>vscodePlugin: response: eg. Notes

The reason we went with this design:

  • flexibility: this allows us to extend Dendron functionality with other clients (eg. different IDE's, vim, web extensions, native applications, etc)
    • NOTE: the Dendron CLI is the only official client for the server at this time
  • performance: we outsource computationaly expensive operations to the server running on a separate process which means that we don't block the main thread of the client during activation and regular usage

Startup

This goes into details of the startup sequence when Dendron first loads

sequenceDiagram participant vscodePlugin participant EngineAPIService participant apiServer participant engine participant store participant fileSystem participant noteParser rect rgb(150, 170, 150) vscodePlugin->>EngineAPIService: creates EngineAPIService->>apiServer: initialize note right of vscodePlugin: plugin end apiServer->>engine: initialize rect rgb(150, 170, 150) note right of engine: local server engine->>store: initialize store->>fileSystem: fetchAllnotes fileSystem->>store: sendNotes; store->>noteParser: parseAllNotes noteParser->>store: parsedNotes store->>engine: return resp end engine->>apiServer: return resp rect rgb(150, 170, 150) note right of vscodePlugin: plugin apiServer->>EngineAPIService: return resp EngineAPIService->>vscodePlugin: return resp end


Children
  1. Extension Hosts
  2. State

Backlinks