Skip to content

TypeDoc v0.28 Beta #2868

Closed
Closed
@Gerrit0

Description

@Gerrit0

TypeDoc 0.28 is now in beta! 🎉

Please try it out and report any issues in new issues:

npm install --save-dev typedoc@beta

The full release is planned for 2025-03-14.

This release includes a major refactor to support a typedoc/browser import suitable for use in frontend code which interacts with TypeDoc's JSON output and an updated search dialog which behaves better on mobile devices.

Default Theme Changes

@phoneticallySAARTHaK rebuilt TypeDoc's search dialog, resulting in an implementation which behaves much better on mobile devices and improved accessibility for screen readers.

Image

Browser Entrypoint

TypeDoc's main entry point uses many node APIs during conversion making it unsuitable for usage in the browser. With this release, TypeDoc also provides typedoc/browser and typedoc/browser/(lang) entry points which can be used in a browser bundle which needs to parse TypeDoc's JSON output.

import {
    ConsoleLogger,
    Deserializer,
    FileRegistry,
    setTranslations,
} from "typedoc/browser";

// Similar paths are available for ja, ko, zh
import translations from "typedoc/browser/en";

// Before doing anything with TypeDoc, it should be configured with translations
setTranslations(translations);

const projectJson = await fetch("...").then(r => r.json());

const logger = new ConsoleLogger();
const deserializer = new Deserializer(logger);
const project = deserializer.reviveProject("API Docs", projectJson, {
    projectRoot: "/",
    registry: new FileRegistry(),
});

// Now we can use TypeDoc's models to more easily analyze the json
console.log(project.getChildByName("SomeClass.property"));
console.log(project.getChildByName("SomeClass.property").type.toString());

Change Log

Breaking Changes

  • TypeDoc now expects all input globs paths to be specified with / path separators, Unable to doc file located in a dir with [] #2825.
  • TypeDoc's --entryPointStrategy merge mode now requires JSON from at least version 0.28.0.
  • Removed jp translations from lang, to migrate switch to ja.
  • File name references in intentionallyNotExported now use a package name/package relative path instead of an absolute path for matching.
  • The source-order sort ordering now considers package names / package relative paths instead of using the absolute paths to a file.

API Breaking Changes

  • Path and PathArray parameter types now always contain normalized paths.
  • Introduced a Router which is used for URL creation. Reflection.url,
    Reflection.anchor, and Reflection.hasOwnDocument have been removed.
  • Deserializer.reviveProject(s) no longer accepts an option to add project documents.
  • Deserializer.reviveProjects now requires an alwaysCreateEntryPointModule option.
  • Comment.serializeDisplayParts no longer requires a serializer argument.
  • ReflectionSymbolId.fileName has been removed, TypeDoc now stores a combination of a package name and package relative path instead.
  • Removed DeclarationReflection.relevanceBoost attribute which was added for plugins, but never used.
  • i18n proxy is no longer passed to many functions, instead, reference i18n exported from the module directly.
  • ReflectionKind.singularString and ReflectionKind.pluralString now returns translated strings.
    The methods on Internationalization to do this previously have been removed.
  • The HTML output structure for the search box has changed to support the new modal.

Features

Bug Fixes

  • TypeDoc will now only create references for symbols re-exported from modules.
  • Variable-functions will now prefer placing the comment on the signature if there is only one signature present, #2521 changed the behavior of documented arrow function #2824.
  • User filter settings will no longer sometimes cause the search to have fewer visible results than expected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions