diff --git a/CHANGELOG.md b/CHANGELOG.md index a6632f75d..8f0c8ee9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ title: Changelog ## Unreleased +## v0.27.9 (2025-02-25) + +This will be the last v0.27.x release, see #2868 for discussion on the 0.28 beta. + +### Features + +- Added support for TypeScript 5.8 + ## v0.27.8 (2025-02-21) ### Features diff --git a/package-lock.json b/package-lock.json index a35223759..ffae24ec2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "typedoc", - "version": "0.27.8", + "version": "0.27.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "typedoc", - "version": "0.27.8", + "version": "0.27.9", "license": "Apache-2.0", "dependencies": { "@gerrit0/mini-shiki": "^1.24.0", @@ -32,14 +32,14 @@ "puppeteer": "^23.6.1", "semver": "^7.6.3", "tsx": "^4.19.2", - "typescript": "5.7.2", + "typescript": "5.8.1-rc", "typescript-eslint": "^8.15.0" }, "engines": { "node": ">= 18" }, "peerDependencies": { - "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x" + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -4575,9 +4575,9 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", - "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "version": "5.8.1-rc", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.1-rc.tgz", + "integrity": "sha512-D8IlSOUk1E08jpFdK81reYkA1a/4XtEdV6MElOGdbu/uOy1RpEDqNO/onWmqUaLkTyeHmmU/QlWvjcM9cqF85g==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index b517d0bea..88333e2e3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "typedoc", "description": "Create api documentation for TypeScript projects.", - "version": "0.27.8", + "version": "0.27.9", "homepage": "https://typedoc.org", "type": "module", "exports": { @@ -33,7 +33,7 @@ "yaml": "^2.6.1" }, "peerDependencies": { - "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x" + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x" }, "devDependencies": { "@types/lunr": "^2.3.7", @@ -49,7 +49,7 @@ "puppeteer": "^23.6.1", "semver": "^7.6.3", "tsx": "^4.19.2", - "typescript": "5.7.2", + "typescript": "5.8.1-rc", "typescript-eslint": "^8.15.0" }, "files": [ diff --git a/site/development/index.md b/site/development/index.md index 22be00802..5cb5ea31c 100644 --- a/site/development/index.md +++ b/site/development/index.md @@ -5,6 +5,7 @@ children: - themes.md - internationalization.md - third-party-symbols.md + - local-storage.md --- # Development diff --git a/site/development/local-storage.md b/site/development/local-storage.md new file mode 100644 index 000000000..699d723f3 --- /dev/null +++ b/site/development/local-storage.md @@ -0,0 +1,19 @@ +--- +title: Disabling Local Storage +--- + +# Disabling Local Storage + +TypeDoc uses local storage by default to retain operational state information across page loads for components such as side menus, site menus, and generated pages. To comply with certain functional cookie requirements, local storage usage can be toggled using the `window.TypeDoc` object. + +To disable local storage, use: + +`window.TypeDoc.disableLocalStorage();` + +**Note:** Disabling local storage will clear its contents. + +To enable local storage, use: + +`window.TypeDoc.enableLocalStorage();` + +**Note:** Local storage is enabled by default. diff --git a/site/overview.md b/site/overview.md index c246a96df..907b41cff 100644 --- a/site/overview.md +++ b/site/overview.md @@ -19,7 +19,7 @@ the supported version range will generally not include versions not supported by | TypeDoc Version | TypeScript Version | Status | | --------------- | ------------------ | ------------------- | -| 0.27 | 5.0 through 5.7 | ✅ Maintained | +| 0.27 | 5.0 through 5.8 | ✅ Maintained | | 0.26 | 4.6 through 5.6 | ⚠️ Security Updates | | 0.25 | 4.6 through 5.4 | ❌ Unmaintained | | 0.24 | 4.6 through 5.1 | ❌ Unmaintained | diff --git a/src/lib/output/themes/default/assets/typedoc/Application.ts b/src/lib/output/themes/default/assets/typedoc/Application.ts index fa26210d4..ae3e99bf8 100644 --- a/src/lib/output/themes/default/assets/typedoc/Application.ts +++ b/src/lib/output/themes/default/assets/typedoc/Application.ts @@ -1,4 +1,5 @@ import type { IComponentOptions } from "./Component.js"; +import { storage } from "./utils/storage.js"; declare global { interface Window { @@ -13,9 +14,22 @@ declare global { folder: string; [k: `kind_${number}`]: string; }; + TypeDoc: { + disableLocalStorage: () => void; + enableLocalStorage: () => void; + }; } } +window.TypeDoc ||= { + disableLocalStorage: () => { + storage.disable(); + }, + enableLocalStorage: () => { + storage.enable(); + }, +}; + // For debugging with a watch build window.translations ||= { copy: "Copy", diff --git a/src/lib/output/themes/default/assets/typedoc/utils/storage.ts b/src/lib/output/themes/default/assets/typedoc/utils/storage.ts index b2a34a1bd..d35da5f9a 100644 --- a/src/lib/output/themes/default/assets/typedoc/utils/storage.ts +++ b/src/lib/output/themes/default/assets/typedoc/utils/storage.ts @@ -9,15 +9,31 @@ export interface MinimalStorage { let _storage: MinimalStorage; +const noOpStorageImpl: MinimalStorage = { + getItem() { + return null; + }, + setItem() {}, +}; + +let localStorageImpl: MinimalStorage; + try { - _storage = localStorage; + localStorageImpl = localStorage; + _storage = localStorageImpl; } catch { - _storage = { - getItem() { - return null; - }, - setItem() {}, - }; + localStorageImpl = noOpStorageImpl; + _storage = noOpStorageImpl; } -export const storage = _storage; +export const storage = { + getItem: (key: string) => _storage.getItem(key), + setItem: (key: string, value: string) => _storage.setItem(key, value), + disable() { + localStorage.clear(); + _storage = noOpStorageImpl; + }, + enable() { + _storage = localStorageImpl; + }, +}; diff --git a/src/lib/output/themes/default/partials/navigation.tsx b/src/lib/output/themes/default/partials/navigation.tsx index 54e64b3f5..49ef8e305 100644 --- a/src/lib/output/themes/default/partials/navigation.tsx +++ b/src/lib/output/themes/default/partials/navigation.tsx @@ -89,7 +89,6 @@ export function settings(context: DefaultThemeRenderContext) { } // Settings panel above navigation - return (