Repository navigation
docs(dev): sync developer docs with current codebase - #4299
Conversation
- IPC.md: rewrite around the sandboxed renderer (window.electron.*) and
the typed contract in src/shared/types/ipc.ts; drop the old
`import { ipcRenderer } from 'electron'` renderer examples.
- TYPESCRIPT.md: flip the documented `allowJs` to `false` and refresh
the single-project rationale to match reality.
- ARCHITECTURE.md: correct outdated `.js` entry-point paths (main,
renderer, editor store) and note the deliberate Node `zlib` import
in muya/lib/parser/render/plantuml.js; tweak the high-level
"built with HTML/JS/CSS" line to reflect the TS migration.
- INTERFACE.md: fix `pannel` typo and mention the new collapsible
Opened Files subsection in the files panel.
- BUILD.md: clarify that electron-builder output goes to `dist/` (out/
is the electron-vite intermediate); link the spectre-mitigated MSVC
note from dev/README §1.3.
- PERFORMANCE.md: describe `pnpm run start` accurately as an
electron-vite preview of the latest build, not a rebuild.
- dev/README.md: add IPC.md and TYPESCRIPT.md to the sub-sections list.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Documentation-only refresh of docs/dev/* to align with the post-TypeScript-migration codebase, the sandboxed renderer (#4244), and the recent sidebar/preferences work (#4278). Fixes stale entry-point paths, the allowJs value, IPC examples that no longer compile under sandboxing, a typo, build/output paths, and the pnpm run start description; also links IPC.md and TYPESCRIPT.md from the dev README index.
Changes:
- Rewrites
IPC.mdaround the typedwindow.electron.*preload bridge and the four channel categories insrc/shared/types/ipc.ts. - Corrects
TYPESCRIPT.md(allowJs: false),ARCHITECTURE.md(TS entry points, language stack),BUILD.md(dist/vsout/),PERFORMANCE.md(electron-vite preview), and thepannel→paneltypo inINTERFACE.md. - Adds
IPC.mdandTYPESCRIPT.mdto thedocs/dev/README.mdindex.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `common/`: Common source files that only require Node.js APIs. Code from this folder can be used in all other folders except `muya`. | ||
| - `main/`: Main process source files that require Electron main-process APIs. `main` files can use `common` source code. | ||
| - `muya/`: MarkTexts backend that only allow pure JavaScript, BOM and DOM APIs. Don't use Electron or Node.js APIs! | ||
| - `muya/`: MarkTexts backend, primarily pure JavaScript, BOM and DOM APIs. Don't use Electron APIs; the only intentional Node.js dependency is `src/muya/lib/parser/render/plantuml.js`, which uses `zlib` to encode PlantUML payloads. |
|
|
||
| ```ts | ||
| 'mt::fs::stat': { args: [path: string]; ret: SerializedStat } | ||
| 'mt::format-link-click': [data: unknown, dirname: string] // send shape |
| }) | ||
|
|
||
| ipcRenderer.send('mt::some-event-name-response', 'arg 1', 'arg 2') | ||
| ipcMain.on('mt::format-link-click', (_event, payload, dirname) => { |
|
Build artifacts for PR #4299: Run: https://github.com/marktext/marktext/actions/runs/26586148519 |
- ARCHITECTURE.md: drop the incorrect zlib claim. muya/plantuml.js
uses pako's `deflate` and `btoa`, not Node's `zlib` — muya truly
has no Node.js dependency. Restore the original "Don't use
Electron or Node.js APIs" line.
- IPC.md: fix the `mt::format-link-click` example shape. The
channel is `[payload: { data: unknown; dirname: string }]` (a
single object), not two positional args. Update both the type
table example and the `ipcMain.on` handler example to match.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs(dev): sync developer docs with current codebase
- IPC.md: rewrite around the sandboxed renderer (window.electron.*) and
the typed contract in src/shared/types/ipc.ts; drop the old
`import { ipcRenderer } from 'electron'` renderer examples.
- TYPESCRIPT.md: flip the documented `allowJs` to `false` and refresh
the single-project rationale to match reality.
- ARCHITECTURE.md: correct outdated `.js` entry-point paths (main,
renderer, editor store) and note the deliberate Node `zlib` import
in muya/lib/parser/render/plantuml.js; tweak the high-level
"built with HTML/JS/CSS" line to reflect the TS migration.
- INTERFACE.md: fix `pannel` typo and mention the new collapsible
Opened Files subsection in the files panel.
- BUILD.md: clarify that electron-builder output goes to `dist/` (out/
is the electron-vite intermediate); link the spectre-mitigated MSVC
note from dev/README §1.3.
- PERFORMANCE.md: describe `pnpm run start` accurately as an
electron-vite preview of the latest build, not a rebuild.
- dev/README.md: add IPC.md and TYPESCRIPT.md to the sub-sections list.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs(dev): address Copilot review on PR marktext#4299
- ARCHITECTURE.md: drop the incorrect zlib claim. muya/plantuml.js
uses pako's `deflate` and `btoa`, not Node's `zlib` — muya truly
has no Node.js dependency. Restore the original "Don't use
Electron or Node.js APIs" line.
- IPC.md: fix the `mt::format-link-click` example shape. The
channel is `[payload: { data: unknown; dirname: string }]` (a
single object), not two positional args. Update both the type
table example and the `ipcMain.on` handler example to match.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Summary
A correctness pass on
docs/dev/*to bring the developer docs back in line with the codebase after the TypeScript migration, the renderer sandbox switch (#4244), and the recent sidebar / preferences work.window.electron.ipcRenderer.*) and the typed contract insrc/shared/types/ipc.ts. Drops the oldimport { ipcRenderer } from 'electron'examples that no longer work in renderer code.allowJstofalse(matchestsconfig.base.jsonsince commit 8587435) and rewrites the single-project rationale to reflect the post-migration reality..jsentry-point paths (src/main/index.ts,src/renderer/src/main.ts,src/renderer/src/store/editor.ts), notes the deliberate Nodezlibimport insrc/muya/lib/parser/render/plantuml.js, and updates the "HTML / JS / CSS" line to mention TypeScript.panneltypo and mentions the collapsible Opened Files subsection added in feat(sidebar): add toggle to hide Opened Files + cap list to 4 items #4278.dist/(theout/directory is the electron-vite intermediate) and adds a link to the spectre-mitigated MSVC note indev/README.md§1.3.pnpm run startaccurately: it'selectron-vite previewof the existing build, not a fresh production build.IPC.mdandTYPESCRIPT.mdto the sub-sections list (they already exist on disk but weren't linked from the index).Companion PR for
docs/end-user/and the top-level README is opened separately.Test plan
rg "from 'electron'" docs/dev/only matches the example labelled "Don't ..." and the main-sideipcMainexamplerg "src/renderer/main\.js|src/main/index\.js|src/renderer/store/editor\.js" docs/dev/is emptypnpm run lint(unrelated to docs but confirms the worktree is clean)🤖 Generated with Claude Code