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

v0.24 Beta Release #2197

Closed
6 of 8 tasks
Gerrit0 opened this issue Mar 10, 2023 · 10 comments · Fixed by #2210
Closed
6 of 8 tasks

v0.24 Beta Release #2197

Gerrit0 opened this issue Mar 10, 2023 · 10 comments · Fixed by #2210
Milestone

Comments

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 10, 2023

TypeDoc 0.24 is the next major release of TypeDoc. Please try it out and report any issues either as comments in this issue or as new issues.

npm install --save-dev typedoc@beta

This release includes two major features, support for reviving a project from previously serialized json, and a complete rework of the packages mode. See the changelog for notes on API breaking changes.

JSON Deserialization

TypeDoc has been able to output JSON files describing the converted project in previous releases, but these JSON files were originally intended only for use by external programs to generate custom documentation sites. With this release, TypeDoc can read JSON files produced in a previous run and create a rendered HTML site from them.

To support this feature, the serialized form of a project was updated to include more information about unresolved symbols, which makes it possible for cross-project type links to be resolved even after serialization if TypeScript's declarationMap option was enabled when compiling the dependency.

While useful, the largest benefit from this feature comes from the way JSON files are consumed. There is a new --entryPointStrategy value, merge, which accepts one or more JSON files and creates a single project with the content of all files. This feature means that it is now possible to generate documentation for completely unrelated packages and merge it together into a single site.

# docs for project 1
npx typedoc src/index.ts --json project1.json
# docs for project 2
npx typedoc src/index.ts --json project2.json
# create merged site
npx typedoc --entryPointStrategy merge path/to/project1.json path/to/project2.json

Reworked packages mode

TypeDoc's packages mode, introduced in v0.22.0, was intended to improve documentation generation for monorepos by treating each package individually while still producing a single site. It achieved this goal in some cases, but the implementation required keeping an instance of the TS compiler in memory for all packages in order to generate documentation. This led to major memory issues (#1606), and since symbol resolution still relied on ts.Symbol identity, meant that TypeDoc was still unable to create links to types declared in a different package, even if it was included in the documentation. It also frequently required custom configuration in the package.json files of packages with option names that were different than TypeDoc's normal options.

v0.24 completely overhauls how packages mode works. Packages mode now uses the JSON deserialization feature to convert each project and then convert it to JSON. Once all projects have been converted, it merges the simple objects into a single project and renders that project. With this method, only one ts.Program is kept in memory at a time. This method also benefits from the work to enable cross-project type links in JSON deserialization, and since TypeDoc runs in each project, TypeDoc can be configured with the standard options available when running on a single project.

Important Breaking Changes

  • Dropped support for legacy [[link]]s and link resolution.
  • TypeDoc no longer automatically loads plugins from node_modules, specify the plugins you want to load with the --plugin option.
  • Reworked packages mode, the old packages mode will be available as legacy-packages until v0.25.

Remaining Work

Will be included in this release:

May be included in this release:

@Gerrit0 Gerrit0 pinned this issue Mar 10, 2023
@Gerrit0 Gerrit0 added this to the v0.24 milestone Mar 11, 2023
@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Mar 12, 2023

v0.24.0-beta.3

@matteobruni
Copy link
Collaborator

matteobruni commented Mar 12, 2023

Hi @Gerrit0, I've tested the 0.24.0-beta.3 but I think there's an improvement to do:

Screenshot 2023-03-13 alle 00 40 59

The modules are not collapsible in the sidebar, only the Modules menu, which can be hard to navigate if you have a long export list or many modules.

I've installed the beta version in the v2 branch, if you need to check that.

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Mar 24, 2023

I'm probably not going to get to adjusting that behavior for this release, it's the same as the previous versions, and frontend isn't really what I enjoy doing - PR welcome if you have a better way!

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Mar 25, 2023

v0.24.0-beta.4 (based on 0.23.28)

  • Introduced a new option, useTsLinkResolution which defaults to true. When set, TypeDoc will use TypeScript's resolution of @link/@linkcode/@linkplain links if possible before falling back to declaration reference resolution.
  • Fixed @inheritDoc on signatures being unable to inherit from reflections not containing signatures
  • Added @overload to default ignored tags
  • Support TS 5.0

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Mar 25, 2023

v0.24.0-beta.5/6 (based on 0.23.28)

I think this may be the last beta release of 0.24, useTsLinkResolution was the last big feature I wanted to get in, #2056 and #2084 will likely end up waiting for 0.25.

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Mar 26, 2023

.. okay, this should be the last one.

v0.24.0-beta.7

  • Fixed an issue when useTsLinkResolution is on and scoped links ({@link Foo.bar | text}) were used (would be rendered as .bar | text instead of text)

@Gerrit0 Gerrit0 mentioned this issue Mar 26, 2023
@RunDevelopment
Copy link
Contributor

includeVersion: true doesn't work. Here's the diff between 0.23.28 and 0.24.0-beta.7:

image

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Apr 1, 2023

It seems to work properly for me - could you share a reproduction, or at least what entry point strategy you're using?

@RunDevelopment
Copy link
Contributor

Sure. I found this issue in this repo. Install 0.24.0-beta.7 there, and you should be able to reproduce it. typedoc.json for reference.

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Apr 3, 2023

Ah, I forgot to update a couple places in the UI to display versions, thanks!

Turns out that there's an extra feature coming in 0.24, #2218 led to my getting nerd sniped by the navigation.. Assuming nothing badly broken turns up, 0.24 should fully release next weekend.

v0.24.0-beta.8

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

Successfully merging a pull request may close this issue.

3 participants