Skip to content

chore(deps): drop dependencies the desktop app no longer uses - #5681

Merged
Jocs merged 1 commit into
developfrom
chore/drop-unused-deps
Oct 9, 2026
Merged

Jocs merged 1 commit into
developfrom
chore/drop-unused-deps

Conversation

@Jocs

@Jocs Jocs commented Oct 9, 2026

Copy link
Copy Markdown
Member

Closes #

Summary

Sweeps every workspace package's declared dependencies for references in its own sources, tests and configs, then hand-checks the misses so implicit use is not mistaken for dead weight.

Removed from packages/desktop — nothing under src/, test/ or the build configs mentions them:

  • @electron-toolkit/preload — only @electron-toolkit/utils is imported (src/main/index.ts)
  • @popperjs/core — element-plus brings its own
  • element-resize-detector, html-tags, turndown, joplin-turndown-plugin-gfm, vega-embed — the desktop renders these through the muya engine, which declares its own copies; the only vega-embed match was a .vega-embed CSS selector in printService.css
  • cross-env — no script uses it
  • @vitest/coverage-v8 — the package has no coverage script and vitest.config.ts does not enable coverage
  • @types/turndown and @types/element-resize-detector came with the two runtime packages, and the now-pointless declare module 'joplin-turndown-plugin-gfm' shim in src/types/shims.d.ts goes with them

Kept on purpose:

  • eslint-plugin-format (packages/muya) — an optional peer of @antfu/eslint-config, required because the config enables formatters
  • @electron/rebuild, patch-package — used through their CLI names (electron-rebuild, patch-package), which a name-based sweep misses
  • @types/* — resolved implicitly by TypeScript for the matching runtime import
  • stylelint-config-standard, stylelint-order (packages/muya) — referenced from the .stylelintrc dotfile
  • react-dom (packages/website) — required by Next

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

No box ticked: this is dependency hygiene with no behaviour change.

Test plan

  • New tests added (or explain why not needed): nothing new to test — the change only removes declarations that no code path reached.
  • Manually tested on: macOS (arm64, 27.2) — pnpm run dev and the built out/ bundle both run.
Command Result
pnpm install clean lockfile, no workspace holds the removed packages except where muya declares them
pnpm typecheck pass
pnpm lint 0 errors
pnpm test 92 files / 1068 tests pass
pnpm validate-licenses pass
pnpm build:unpack pass
desktop e2e smoke (launch, view-modes, media-ipc, diagram-viewer) 27 passed / 1 skipped

Notes for reviewers [optional]

  • electron in the root package.json looks redundant too — scripts/postinstall.ts resolves the binary from packages/desktop/node_modules, and every CI-facing script proxies to the desktop package. I left it alone because I cannot see why it was added in the first place; say the word and it can go in a follow-up.
  • The removals were verified by building and running the app plus the e2e smoke that exercises the diagram viewer, so a missing runtime import would have shown up.
  • Overlaps with chore(deps): bump the postcss override to 8.5.29 #5674: that branch is based on the same develop tip and also touches dependency versions, so whichever lands second may need a trivial pnpm install (no manual conflict expected).

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Swept every workspace package's declared dependencies for references in
its own sources and configs, then hand-checked the hits to separate
genuine dead weight from implicit use (`@types/*` resolution, CLIs whose
binary name differs from the package name, dotfile configs, optional
peers).

`packages/desktop` loses `@electron-toolkit/preload` (only the `utils`
package is imported), `@popperjs/core`, `element-resize-detector`,
`html-tags`, `turndown`, `joplin-turndown-plugin-gfm`, `vega-embed` (its
only match was a `.vega-embed` CSS selector), `cross-env` and
`@vitest/coverage-v8` — the engine keeps its own copies of the ones it
does render. The matching `@types/*` entries and the now-dead
`declare module 'joplin-turndown-plugin-gfm'` shim go with them.

Deliberately kept: `eslint-plugin-format` in `packages/muya` is an
optional peer of `@antfu/eslint-config`, which the config's `formatters`
option requires, and `@electron/rebuild` / `patch-package` are used
through their CLI names.
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Website preview ready: https://pr-5681-marktext-website.ransixi.workers.dev

Built from e55382af1d4521ca2b836e3ffd9bb2913ba5a782 · Worker: marktext-website · Version: 1f533df8-4651-4b61-99a2-e2340a2eb47e · Alias: pr-5681

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Build artifacts for PR #5681:

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

Artifact Size Link
marktext-windows-x64 286.1 MB Download
marktext-linux 634.6 MB Download
marktext-macos-x64 298.8 MB Download
marktext-macos-arm64 285.5 MB Download
marktext-windows-arm64 277.9 MB Download

@Jocs
Jocs merged commit ce807d5 into develop Oct 9, 2026
19 checks passed
Zane-0x5a added a commit to Zane-0x5a/marktext that referenced this pull request Oct 9, 2026
Takes upstream's Node 25 web storage probe from marktext#5666 over the fork's
earlier spelling, and regenerates the lockfile from upstream's with
pdfjs-dist added for the print preview.
@Jocs
Jocs deleted the chore/drop-unused-deps branch October 23, 2026 08:32
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.

1 participant