draw.io webapp integration
Overview
The desktop project treats the upstream draw.io web application as a Git submodule at drawio/. The submodule metadata in .gitmodules maps drawio to https://github.com/jgraph/drawio.git and tracks the upstream dev branch. In this checkout, drawio/ exists but is empty; git submodule status -- drawio reports the recorded submodule commit c72c9a98b7a6ce392556ed04c05e0ff19f43f5c3 with a leading -, meaning the submodule is registered in the superproject but not initialized in the working tree. That observed empty state is expected when the repository was not cloned recursively or git submodule update --init has not been run.
The user-facing setup path is documented in README.md: draw.io Desktop is an Electron wrapper around the core editor from https://github.com/jgraph/drawio, and developers are told to clone with git clone --recursive https://github.com/jgraph/drawio-desktop.git. README.md also notes that if a symlink is used instead of the submodule, node_modules inside drawio/src/main/webapp must also be symlinked, because the embedded webapp expects its own dependency tree at that location.
Repository synchronization is handled by sync.cjs, exposed as npm run sync in package.json. The script reads drawio/VERSION, validates it as a three-component semantic version (x.y.z), writes that value into the root package.json version field, and rewrites src/…/disableUpdate.js based on whether it was invoked with the literal disableUpdate argument. If drawio/VERSION is missing, sync.cjs stops immediately with the explicit message to clone recursively or run git submodule update --init. This makes the submodule's VERSION file the desktop package version source for sync/build preparation, while the root package metadata continues to define the Electron app, scripts, and desktop dependencies.
DEVELOPMENT.md is older release/setup documentation and still describes the intended relationship: draw.io/ is the draw.io repository as a submodule, CI/builds take the version from ./draw.io/VERSION, and dependencies from the webapp package are expected to be included in installers while webapp-only development dependencies should not be packaged. The path spelling in this file (draw.io/ and sync.js) predates the current .gitmodules/sync.cjs names (drawio/ and sync.cjs), so treat it as historical guidance rather than the exact current path map.
dependency-diagram.png is a repository-level diagram asset covered by this integration area. It is present as an image file, but this environment could not inspect image contents; there is no executable integration behavior in the image itself.
Coupling
- If the submodule path, branch, or remote changes in
.gitmodules, also update README.md setup instructions and sync.cjs: sync.cjs hard-codesdrawio/VERSION, and a path drift will fail sync before builds can align the desktop version with the embedded editor. - If the upstream draw.io app changes the format or location of its version file, update sync.cjs and any release notes that reference version sourcing. sync.cjs accepts only
^\d+\.\d+\.\d+$, so prerelease/build metadata or a movedVERSIONfile will stop the sync step. - If build packaging begins installing dependencies from a different webapp package location, revisit the warning in DEVELOPMENT.md and the symlink note in README.md; both assume the embedded webapp has dependencies under
drawio/src/main/webappand that those dependencies can affect what gets packaged. - If
npm run syncis used in release automation, remember that it mutates two repository files: root package.json and src/…/disableUpdate.js. Reviewers should check both generated outputs when changing the sync invocation or thedisableUpdateargument.
Risks
drawio/being uninitialized leavesdrawio/VERSIONabsent, and sync.cjs exits with an error. Any local build or release path that callsnpm run syncwill fail until the submodule is initialized with recursive clone orgit submodule update --init.- The submodule has churn in project history: covered-file history includes
5351667 Removed draw.io submodule,379904f Put submodule back, andff575bb Update .gitmodules. If submodule metadata is edited again, verify both the Git submodule state and the README.md clone instructions, because past changes have removed and restored this integration point. - DEVELOPMENT.md still references obsolete names (
draw.io/and sync.js) while current code usesdrawio/and sync.cjs. Following only DEVELOPMENT.md can send maintainers to the wrong path unless they cross-check.gitmodulesand sync.cjs.