Repository navigation
docs: refresh getting-started and guides - #1478
Conversation
The quick start asked for Node >= 20 while the packages declare node >= 18 and CI tests Node 18 through 26. Node 20 is itself past its end of life, so the recommendation now points at 22. The React Native >= 0.77.0 bullet contradicted the support policy two lines below it, so it is dropped and the policy is left to speak for itself. Also removes docs/getting-started/bundlers.md, a stub containing only a heading. It has no sidebar entry but rspress still published and sitemapped it at /docs/getting-started/bundlers.
A pass over every page in the guides section, checking what it says against what the code does. `getAssetsTransformRules` and `ReactNative.ASSET_EXTENSIONS` never existed: the helper is `getAssetTransformRules` and both utilities are exported as `Repack.*`. The configuration guide imports a `repack` package that is not published and shows a `--mode` flag the CLI does not have, since the mode comes from `--dev`. The remote assets guide left out the `assets` segment the URL always carries, and the custom `assetPath` sample called an undefined `getCustomHash`. Two samples had broken bracket nesting and used `path` and `context` without importing them. Links: the Zephyr recipe moved to /bundlers/repack, bundle-discovery's Re.Pack.md is now a docs page, `rspack.dev/config.html` is a 404, and the assets-loader anchor in the SVG guide pointed at a heading that does not exist. The `RsdoctorPlugin` name in the analysis guide never shipped; the plugins are `RsdoctorRspackPlugin` and `RsdoctorWebpackPlugin`. Plus the typos each page picked up along the way.
|
@gedu is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
|
dannyhw
left a comment
There was a problem hiding this comment.
automated review: Checked the guide changes against the code and live links. The helper renames, --dev precedence, remote asset URL (/assets/ segment, __packager_asset: true), sample fixes and link replacements are all correct. Three minor nits inline.
Rspack now serves from rspack.rs and Rsdoctor from rsdoctor.rs; the old domains only answer with a 301, so every link here was paying a redirect. A domain swap alone is not enough, because some paths moved as well and currently 404 after the redirect: - `/plugins/rspack/swc-js-minimizer-rspack-plugin` and `/plugins/webpack/module-federation-plugin-v1` lost their `/rspack` and `/webpack` segment. - The `Rule.test`, `Rule.include`, `Rule.exclude` and `Condition` sections moved out of `/config/module` into `/config/module-rules`, so those four anchors in the SVG guide would have silently stopped jumping anywhere. The rspack.config templates are included because `repack-init` downloads them into new projects and the docs pages also embed them verbatim, so the stale URL reached both users and the published site.
The sample called an undefined `getCustomHash`, and the version added to define it hashed the literal `"some-content"`, so every asset got the same URL and the name never changed with the file. The example is there to show path construction, so it now only builds a path, and cache-busting moved to a tip next to it. The tip gives the exact expression instead of a placeholder, because `assetPath` never receives the asset contents: hashing it means reading the file yourself. It also states the two properties that are not visible from the snippet and cannot be worked around inside `assetPath` — the call is synchronous, so the read has to be too, and it runs once per request against the base file while the `@2x`/`@3x` variants reuse the returned path.
The tip addresses readers who do not have an Assets loader rule yet, so the section they need is the one that shows adding it. `#excluding-assets` repeats the SVG exclusion the page already shows directly above the tip, so following the link answered a question the reader did not have. The link used to name `#migrating-from-assetsplugin`, a section v5 no longer has; repairing that dead anchor by picking the closest-sounding heading kept it pointing at the wrong place.
Summary
Went through the getting-started section and the guides and checked what they say against what the code does. Two commits: one per section.
Test plan
pnpm buildinsidewebsitepasses, 53 pages.