dengliming opened a new issue, #1143:
URL: https://github.com/apache/shenyu-website/issues/1143
Build / tooling / asset hygiene items found while auditing the site. None of
them is user-facing on its own, but several make the project harder to build or
hide real problems.
## Build & tooling
- **README.md is out of date**: it says "Docusaurus 2" and "Node.js version
>= 12.13.0". The project uses `@docusaurus/core ^3.9.2`, which requires Node >=
20 (a plain `yarn build` on Node 18 fails with "Minimum Node.js version not
met"). CI and the devcontainer already use Node 20.
- No `engines` field in `package.json` and no `.nvmrc`. Suggest `"engines":
{ "node": ">=20" }` plus `.nvmrc`.
- `yarn.lock` is gitignored (`.gitignore:11`), so installs are not
reproducible. Commit a lockfile.
- `yarn lint` depends on `markdownlint`, which is not in `package.json` (CI
installs `[email protected]` globally), so it fails locally. Add it as a
devDependency.
- `onBrokenLinks: "log"` in `docusaurus.config.js` is why broken internal
links have gone unnoticed. Consider `"warn"` (or `"throw"` once the current
breakages are fixed).
- `static/pdf/*.pdf` (4.8 MB) were last committed in March 2023; CI
regenerates them on every deploy (`deploy.yml` "Generate PDF" step, then `cp -r
pdf/ static/`). Untrack them and add `static/pdf` to `.gitignore`.
## `static/js/error-suppression.js`
Loaded synchronously on every page (`docusaurus.config.js:14`). Besides
swallowing the benign ResizeObserver loop error, it monkey-patches
`console.error` / `console.warn` to hide React dev warnings ("LoadableComponent
legacy contextTypes", any message containing "key" and "prop is being spread")
and JSON-stringifies every logged object. React strips these dev warnings in
production anyway, and the key-spread warning points at a real bug that should
be fixed at the source. Suggest keeping only the ResizeObserver handler.
## Static assets
- `static/img` is 193 MB / 1,320 files. About 200 files (~38 MB) are
referenced nowhere outside `static/`, mostly `static/img/soul/blog5/*`
(zk*.png, ns*.png, 0.6–1.5 MB each), `soul/blog6`, `soul/blog8`, `soul/01`,
`soul/activite`, plus `activities/apache-open-shenyu-01.jpg` (828 KB) and
`shenyu/agent/shenyu-agent-plugin-metrics-prometheus.png` (825 KB).
- 54 groups of byte-identical duplicate images (mostly `shenyu/*` vs
`soul/*`, `activities/*` vs `blog/*`).
- Home page carousel image `static/img/home/2_1.jpg` is 2.1 MB and
uncompressed; other large referenced images (`context-path/invoke-interface*`,
`grafana-loki-gateway`, `offline-api-cn/en`, `news/ospp/ospp-2023.jpg`,
`baota/20241010102246.png`, `aapanel/console.png`) could be compressed /
converted to WebP.
- `static/.htaccess` could carry `RedirectMatch` rules for `/docs/index` →
`/docs/` and the `namepsace` → `namespace` rename instead of the JS redirect
page at `static/docs/user-guide/admin-usage/namepsace/index.html`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]