Release Notes
What changed in the v2.2.x line of @viteplus/versions. For the lines before it see Earlier releases.
INFO
This line is archived and no longer maintained. See the current release notes for the v2.3.x line, which added a translatable label to the version switcher.
v2.2.0
Versioned links to the current version, a (latest) tag in the version switcher, and a fix for sites whose TypeScript no longer exposes ts.sys.
Added: A URL that names the
currentversion now lands on the page. The current version is served at the root, so/v2.2.x/guide/named no page and answered 404. A one-line script in the page<head>now replaces it with/guide/, keeping the locale, the query string and the hash. Once the version is archived, the archive serves that path itself, so a link in a README or a changelog keeps pointing at the version it was written for. On a built site the script runs on404.html, so the host must serve that page for unknown paths, as GitHub Pages, Netlify, Vercel and Cloudflare Pages do. It is left out when an archived version carries the same label ascurrent. (#43)Added: The
VersionSwitchercomponent tags the current version as the latest one, sov2.2.xreads asv2.2.x (latest)on the flyout button and in both menus. AlatestLabelprop on the nav item changes the tag, for example to translate it, and an empty string turns it off. A current version that already reads as the tag, such as the defaultcurrent: 'latest', is shown as it is. (#44)Added:
useVersionSwitcherexposesactiveVersionText, the active version with the tag applied, so a custom switcher built on the composable shows the same label.Fixed: The
VersionSwitchercomponent compiles again under TypeScript 7, or with no TypeScript installed.defineProps<PropsInterface>()imports its type from another file, and@vue/compiler-sfcreads that file throughts.syswhen it is given nofsoption. TypeScript 7 no longer shipsts.sys, so the build failed withNo fs option provided to compileScript.defineVersionedConfignow passes Node's file system asvue.script.fs, and a site that sets its own keeps it. (#42)Changed:
vueandvitepressare added tovite.resolve.dedupe, so a linked copy of the package resolves both from the site and shares its Vue app and router.
🏷️ Upgrading
The (latest) tag is on by default. Pass props: { latestLabel: '' } on the VersionSwitcher nav item to keep the switcher as it was.
Earlier releases
- v2.1.x - the 2.1 line (archived docs).
- v2.0.x - the 2.0 line (archived docs).
- v1.0.0 - initial release (archived docs).
