Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeDoc v0.28 Beta #2868

Open
Gerrit0 opened this issue Feb 23, 2025 · 2 comments
Open

TypeDoc v0.28 Beta #2868

Gerrit0 opened this issue Feb 23, 2025 · 2 comments
Assignees
Milestone

Comments

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Feb 23, 2025

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.
@Gerrit0 Gerrit0 added this to the v0.28.0 milestone Feb 23, 2025
@Gerrit0 Gerrit0 self-assigned this Feb 23, 2025
@Gerrit0 Gerrit0 pinned this issue Feb 23, 2025
@felipecrs
Copy link

I think there's another breaking change that wasn't listed:

TypeError: context.project.getSymbolFromReflection is not a function

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Feb 24, 2025

Technically that one shouldn't need a breaking change notice as it was marked internal, but I agree, it deserves one and basically every non-trivial plugin uses it... it moved to Context

Gerrit0 added a commit that referenced this issue Feb 25, 2025
Also add note to changelog a bout breaking change
Ref: #2868 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants