-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Upgrade TypeDoc #9483
Upgrade TypeDoc #9483
Conversation
It has now been out about a month, and we are up to 4.1.3.
It looks like typedoc 0.20 beta may now support the library mode that was keeping us on 0.17.0-3: see TypeStrong/typedoc#1184 (comment). See also TypeStrong/typedoc#1364
There still are some errors, which will hopefully at least partly be solved by judicious exclusion of unnecessary files in the typedoc compilation.
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
Hmm, so far I've been able to locally reproduce the same error we're seeing in the CI for
Probably 600 of those seconds were spent just in @jasongrout Have you noticed any increase in build times or resources used during build after upgrading typescript to 4.1.3? |
- hacks (hopefully temporary) - no `@jupyterlab/application-extension` docs - all test-related `.ts` sources have to be temporarily deleted immediately before the typedoc build and then restored immediately afterwards
@jasongrout The v0.20.0-beta.27 typedoc build works! You probably won't love what I had to do to make it work, though:
update: that second (extra ugly) hack is thankfully no longer needed, due to @Gerrit0's very helpful suggestion about the For now I think the above is liveable. As for the docs themselves, they look good. So far I've noticed a few regressions (eg there's some kind of issue with cross-package inheritance, so some parent classes aren't listed/linked correctly), and a few improvements (eg the TOC is slightly nicer), so I think it's fine. Longer term, I'll be submitting related issues upstream to typedoc, so all of this can eventually get cleaned up |
I just closed my other programs and tried another clean build. This time it was only 148 s, which yeah, pretty normal What I saw before during the slow build was 4 separate node procs that were using > 100% CPU and also sucked up all available system memory (which is prob where the real slowdown came from). This time there was only one high cpu node. So I think what I saw before might have actually been the anyway, I can't repro it, so it's a non-issue |
This worried me, so I spent some time looking into it. TypeDoc's behavior with errors should be identical to either If I add an exclude section to the tsconfig to tell it to ignore those files - both tsc and typedoc will run as expected. diff --git a/tsconfigdoc.json b/tsconfigdoc.json
index bf46a7779..7f959a811 100644
--- a/tsconfigdoc.json
+++ b/tsconfigdoc.json
@@ -1,6 +1,7 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "./tsconfigbase",
+ "exclude": ["**/test/**", "**/testutils/**"],
"compilerOptions": {
"paths": {
"@jupyterlab/*": [ beta 27 doesn't remove diff --git a/packages/application/src/index.ts b/packages/application/src/index.ts
index 3ed540439..f3571ff9f 100644
--- a/packages/application/src/index.ts
+++ b/packages/application/src/index.ts
@@ -1,3 +1,5 @@
+/** @packageDocumentation
+@module application */
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License. It looks like I need to introduce more logic for determining references, application -> ILabShell has the same TS symbol as the interface, which results in the variable type linking to the variable instead of the interface. Hopefully this helps a bit! Probably won't have time to look at any other issues until the weekend... |
Wow, @Gerrit0, thank you very much for not only your great work on typedoc, but also for coming over to look at the issues we've been having! The other day, when initially working on upgrading from 0.17.0-3 to 0.20 beta, I was trying to ignore these test files by adding to our exclude section of typedoc.js, but it didn't seem to do anything. I didn't think about changing the tsconfig that typedoc was using. |
@Gerrit0 This is awesome, thank you for coming to help! 👍 to everything @jasongrout just said
Yeah I had the same experience. The |
@Gerrit0's Your explanation about
might also explain why I was seeing several dozen strange type errors when including the
The issue here seems to boil down to an jupyterlab/packages/application-extension/src/index.tsx Lines 92 to 112 in 979dd37
As far as I can tell the |
- and remove my hack of deleting then restoring the test srcs
@@ -1,6 +1,7 @@ | |||
{ | |||
"$schema": "http://json.schemastore.org/tsconfig", | |||
"extends": "./tsconfigbase", | |||
"exclude": ["**/test/**", "**/testutils/**"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can also delete the exclude settings in typedoc.js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. But I still want to know more about exactly what exclude
in tsconfigdoc.json
(which presumably is just acting as the standard tsconfig option here) is supposed to do vs exclude
in typedoc-specific config
@telamonian - I think this looks good now. Do you think it is ready to go? We'll be missing the application-extension docs until we solve that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks! |
give me a couple more hours with this. The more I look at the generated docs, the more issues I see. For example, in some places it's pulling defs from whelp, I guess maybe that fix can be a new PR. But yeah, I think the current state is good enough for 3.0.0, but not for, say, 3.0.1 |
Sorry for rushing this, and thanks for follow-up PRs to fix those sorts of issues. |
actually, for some reason it looks like all of the |
The From the documentation side of things - The errors with application-extension... no idea there. As a wild guess, typedoc probably does something wrong with project references so the program isn't created correctly. |
@Gerrit0 Yes, "go to def" works very reliably (at least in vscode and intellij, which both use the standard On the other hand, there are at least some language service features that are a bit spottier. For example, in order to get "find all references" to actually search in all of the packages in our monorepo, I've found that I have to have at least one file open from each package. But even with our weird project structure "go to def" has always worked well |
I opened #9495 to deal with the broken links in the docs. |
This follows the suggestion from the typedoc maintainer at jupyterlab#9483 (comment)
References
After the upgrade to TypeScript 4.1 in #9476, I think we need to upgrade TypeDoc. This PR does that.
Code changes
Upgrade TypeDoc to 0.20.0-beta.27.
Previously we had pinned to exactly 0.17.0-3 since that was the version that had the
library
mode.This includes #9476, so that should be merged first.
User-facing changes
Backwards-incompatible changes