docs(dev): sync developer docs with current codebase by Jocs · Pull Request #4299 · marktext/marktext · GitHub
Skip to content

docs(dev): sync developer docs with current codebase - #4299

Merged
Jocs merged 2 commits into
developfrom
docs/dev-accuracy-pass
May 28, 2026
Merged

Jocs merged 2 commits into
developfrom
docs/dev-accuracy-pass

Conversation

@Jocs

@Jocs Jocs commented May 28, 2026

Copy link
Copy Markdown
Member

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.

  • IPC.md — rewritten around the sandboxed renderer (window.electron.ipcRenderer.*) and the typed contract in src/shared/types/ipc.ts. Drops the old import { ipcRenderer } from 'electron' examples that no longer work in renderer code.
  • TYPESCRIPT.md — flips the documented allowJs to false (matches tsconfig.base.json since commit 8587435) and rewrites the single-project rationale to reflect the post-migration reality.
  • ARCHITECTURE.md — corrects the outdated .js entry-point paths (src/main/index.ts, src/renderer/src/main.ts, src/renderer/src/store/editor.ts), notes the deliberate Node zlib import in src/muya/lib/parser/render/plantuml.js, and updates the "HTML / JS / CSS" line to mention TypeScript.
  • INTERFACE.md — fixes the pannel typo and mentions the collapsible Opened Files subsection added in feat(sidebar): add toggle to hide Opened Files + cap list to 4 items #4278.
  • BUILD.md — clarifies that electron-builder output lands in dist/ (the out/ directory is the electron-vite intermediate) and adds a link to the spectre-mitigated MSVC note in dev/README.md §1.3.
  • PERFORMANCE.md — describes pnpm run start accurately: it's electron-vite preview of the existing build, not a fresh production build.
  • dev/README.md — adds IPC.md and TYPESCRIPT.md to 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

  • Skim the rendered Markdown on GitHub
  • rg "from 'electron'" docs/dev/ only matches the example labelled "Don't ..." and the main-side ipcMain example
  • rg "src/renderer/main\.js|src/main/index\.js|src/renderer/store/editor\.js" docs/dev/ is empty
  • pnpm run lint (unrelated to docs but confirms the worktree is clean)

🤖 Generated with Claude Code

- 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>
Copilot AI review requested due to automatic review settings May 28, 2026 15:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.md around the typed window.electron.* preload bridge and the four channel categories in src/shared/types/ipc.ts.
  • Corrects TYPESCRIPT.md (allowJs: false), ARCHITECTURE.md (TS entry points, language stack), BUILD.md (dist/ vs out/), PERFORMANCE.md (electron-vite preview), and the pannel→panel typo in INTERFACE.md.
  • Adds IPC.md and TYPESCRIPT.md to the docs/dev/README.md index.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/dev/IPC.md Rewritten for sandboxed renderer + typed IPC contract; some example shapes don't match the real contract.
docs/dev/TYPESCRIPT.md Updates allowJs to false and rewords the single-project rationale.
docs/dev/ARCHITECTURE.md Updates entry-point paths to .ts; muya note about Node zlib is inaccurate (uses pako).
docs/dev/INTERFACE.md Fixes pannel typo and mentions the collapsible Opened Files subsection.
docs/dev/BUILD.md Clarifies dist/ is electron-builder output vs out/ intermediate; links spectre-mitigated MSVC note.
docs/dev/PERFORMANCE.md Describes pnpm run start accurately as electron-vite preview.
docs/dev/README.md Adds links to IPC.md and TYPESCRIPT.md.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/dev/ARCHITECTURE.md Outdated
- `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.
Comment thread docs/dev/IPC.md Outdated

```ts
'mt::fs::stat': { args: [path: string]; ret: SerializedStat }
'mt::format-link-click': [data: unknown, dirname: string] // send shape
Comment thread docs/dev/IPC.md Outdated
})

ipcRenderer.send('mt::some-event-name-response', 'arg 1', 'arg 2')
ipcMain.on('mt::format-link-click', (_event, payload, dirname) => {
@github-actions

github-actions Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Build artifacts for PR #4299:

Run: https://github.com/marktext/marktext/actions/runs/26586148519

Artifact Size Link
marktext-macos-x64 272.5 MB Download
marktext-linux 594.3 MB Download
marktext-windows-arm64 271.4 MB Download
marktext-windows-x64 272.7 MB Download
marktext-macos-arm64 262.3 MB Download

- 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>
@Jocs
Jocs merged commit 0b0affb into develop May 28, 2026
10 checks passed
@Jocs
Jocs deleted the docs/dev-accuracy-pass branch May 28, 2026 16:16
thimbleberrysystems pushed a commit to thimbleberrysystems/WordBird that referenced this pull request Jun 21, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants