Commit 76beaba
authored
Upgrade Docusaurus 2.0.0-beta.5 → 3.10.2 (#186)
* Upgrade Docusaurus 2.0.0-beta.5 -> 3.10.2
The docs site was pinned to a 2021 Docusaurus beta, which held the entire
JS dependency tree in place and made most of the docs/yarn.lock security
advisories unfixable individually. Dependabot had been reporting
security_update_not_possible for exactly this reason, e.g.
decode-uri-component could not move past 0.2.0 because
@docusaurus/core@2.0.0-beta.5 required it transitively.
Changes:
- @docusaurus/core and preset-classic 2.0.0-beta.5 -> ^3.10.2
- react/react-dom ^17 -> ^18.3.1, @mdx-js/react ^1 -> ^3 (v3 peer deps)
- clsx ^1 -> ^2, prism-react-renderer added (required by v3 preset)
- dropped @svgr/webpack, file-loader, url-loader and the stray 'yarn'
dependency: all unused here, every svg import in src/ is commented out
- engines.node >=20.0, matching Docusaurus 3's own requirement
- CI node-version 14.x -> 20.x in documentation.yml (14 is EOL, and
Docusaurus 3 will not run on it)
Two config migrations were needed:
markdown.format: 'detect' - MDX v3 is stricter than v1 and tried to
evaluate literal braces in the generated API docs as JSX expressions,
failing on "{ id: string, url: string }" in mapillary.interface.md.
'detect' parses .md as CommonMark and reserves MDX for .mdx. Escaping the
braces instead would have been undone by the next scripts/documentation.py
run, since those files are generated from Python docstrings.
onBrokenMarkdownLinks moved under markdown.hooks, where v3 expects it;
the top-level option is deprecated and removed in v4.
Verified locally on Node 20: build succeeds, 43 HTML pages generated, and
the page that previously failed to compile now renders its braces as
literal text.
Notable transitive results: webpack 5.74.0 -> 5.110.3 (the bump #175
attempted and could not land, since 5.110.3 is incompatible with the
beta), websocket-driver 0.7.4 -> 0.7.5, svgo 1.3.2 -> 3.3.5, browserslist
4.14.2 -> 4.28.9, shell-quote 1.7.2 -> 1.10.0, postcss 8.4.16 -> 8.5.28,
and axios, ua-parser-js and decode-uri-component dropped entirely.
* Add client redirects for the seven doc URLs the upgrade moves
Docusaurus treats a doc whose filename matches its folder as that
category's index page, a convention introduced after 2.0.0-beta.5.
Upgrading therefore shortens seven API doc URLs, e.g.
/docs/mapillary.config/mapillary.config -> /docs/mapillary.config
Nothing in the repo references the old paths and every internal link
regenerates, but external bookmarks and inbound links would 404. This
adds @docusaurus/plugin-client-redirects and maps each old path to its
new one.
Verified by building and following each redirect: all seven stubs are
emitted with the correct target, and the content reached through them
matches what the old URL served. The only differences are chrome the
v3 theme renders differently (prev/next arrows, dark-mode toggle icons).
Build output goes 43 -> 50 pages: 43 real pages plus 7 redirect stubs.
Internal link check still reports 0 unresolvable across 49 links.
docs/tags is intentionally not redirected. It existed in v2 as an empty
tag index with no tags to list; v3 omits it rather than emitting an
empty page.1 parent 0e8e2db commit 76beaba
4 files changed
Lines changed: 7472 additions & 5984 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
| |||
139 | 150 | | |
140 | 151 | | |
141 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
142 | 176 | | |
143 | 177 | | |
144 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
0 commit comments