Skip to content

Docs vitepress - #972

Open
kurkle wants to merge 2 commits into
chartjs:masterfrom
kurkle:docs-vitepress
Open

kurkle wants to merge 2 commits into
chartjs:masterfrom
kurkle:docs-vitepress

Conversation

@kurkle

@kurkle kurkle commented Sep 17, 2026

Copy link
Copy Markdown
Member

No description provided.

kurkle and others added 2 commits September 17, 2026 09:39
TypeScript 6 is the newest version the toolchain allows: typedoc 0.28 and
@typescript-eslint both stop at <6.1, so 7 has to wait for them.

Three things had to move with it.

TypeScript 6 no longer includes every @types package automatically, so
tsconfig.json now names the two this project relies on. The same change also
showed that test/types was only ever green by accident: its target and lib
were ES6, and nothing there resolved Object.values until an automatically
included @types/node widened the lib set. Its config now matches the root one,
and node10 module resolution goes with it, being deprecated in 6 and removed
in 7.

@typescript-eslint 5 refuses to run on anything past TypeScript 5.2, so it
moves to 8, which needs eslint 8.57. Version 8 also promotes no-unused-vars
from a warning to an error, which fails the fenced examples in the docs that
exist precisely to show a callback signature, so the rule is turned off for
markdown code blocks.

The emitted declarations are unchanged apart from TypeScript 6 no longer
printing the redundant `| undefined` on optional properties; checked by
building dist with both versions and diffing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
VuePress 1 is Vue 2 and webpack, and is no longer maintained; this drops about
1350 packages from a fresh install, which is the docs half of chartjs#812.

None of the VuePress plugins have a VitePress counterpart, because VitePress
has no plugin API at all, so each one is replaced rather than ported:
flexsearch by the built-in local search, vuepress-plugin-typedoc by
typedoc-vitepress-theme, the redirect plugin by a page under docs/samples, and
@simonbrunel/vuepress-plugin-versions by docs/.vitepress/versions.ts, which
builds the same menu from the jsDelivr listing at build time instead of
refetching it in the browser on every page load.

vuepress-theme-chartjs is vendored into docs/.vitepress/theme as Vue 3. The
markdown-it rule that turns a ```js chart-editor fence into a component is
plain markdown-it and carries over almost unchanged, but the components are
Vue 2 and two of their dependencies are Vue 2 only, so they are rewritten:
perfect-scrollbar gives way to CSS scrollbar styling, vue-prism-editor (whose
Vue 3 release never left alpha) to a textarea over a highlighted layer, and
the Font Awesome stylesheet to three inline icons. The palette moves onto
VitePress' own custom properties. The site stays light only, as it was --
Chart.js resolves its own tick and grid colours and several samples hard-code
them, so a dark page would need the samples taught about the theme first.

Reassembling an edited sample joined the blocks with an empty string, which
glued a closing brace to the next const: editing any sample with more than one
block failed with a SyntaxError, which is every sample but one. They are
joined with a newline now.

scripts/docs-config.sh writes docs/.vitepress/docs-version.json instead of
sed-ing the config in place, so a local build and the dev server work without
running it first.

Verified against the built site in a browser: every page hydrates with no
console errors, all 19 editors draw their chart, editing code redraws it, the
action buttons, the Output tab, wheel zoom and the /samples redirect all work.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kurkle
kurkle requested a review from etimberg September 17, 2026 06:59
@kurkle

kurkle commented Sep 17, 2026

Copy link
Copy Markdown
Member Author

@etimberg I was thinking something like this could be the way out from vuepress for chart.js. WDYT?

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