-
-
Notifications
You must be signed in to change notification settings - Fork 750
Description
Recent upgrade to typescript 4.*.* in 0.19.0 broke backward-compatibility for typescript 3.9.7 due to the unchecked usage of ts.isNamedTupleMember call: e136469#diff-b580b34740b3647ff5b29f4cb299a61aR77
which results in the following output when trying to generate documentation with TS 3.9.7:
C:\projects\tesler-ui\node_modules\typedoc\dist\lib\converter\types\tuple.js:44
return ts.isNamedTupleMember(node);
^
TypeError: ts.isNamedTupleMember is not a function
I believe the change was introduced due to #1357.
Investigating further I've also found that the 0.17.0 also broke support for typescript 3.7.3 (which is version used in create-react-app
typescript template) due to the unchecked usage of ts.isIdentifierOrPrivateIdentifier: 5d41a2e#diff-560fefcd039cbf06578d6f95c3e57753R413
I've prepared a PR to restore backward compatibility.
I've also found following issues warning about not following declared peer dependency: #1240, #1257, #979
Although I'll agree that backward compatibility might be not a requirement for 0.*.* library and peer dependency are indeed warn you, broken typescript versions are pretty recent and the fix is pretty simple and non-invasive so it'll be nice to support those versions until typescript 4 stabilizes a bit so majority typedoc users may migrate to 4.*.*
Search terms
isNamedTupleMember, isIdentifierOrPrivateIdentifier, typescript 3
Expected Behavior
typedoc is backward compatible for typescript versions 3.7.3 and 3.9.7
Actual Behavior
yarn typedoc command results in the following output on the project with typescript 3.9.7:
Using TypeScript 3.9.7 from C:\projects\tesler-ui\node_modules\typescript\lib
C:\projects\tesler-ui\node_modules\typedoc\dist\lib\converter\types\tuple.js:44
return ts.isNamedTupleMember(node);
^
TypeError: ts.isNamedTupleMember is not a function
Steps to reproduce the bug
I've prepared an example project to reproduce the bug:
https://github.com/Dergash/typedoc-tamed-tuples (master branch for 3.7.3 example, 3.9.7 branch for 3.9.7)
Just clone it, yarn install, yarn typedoc and you'll receive the output
Environment
- Typedoc version: 0.19.0, https://registry.yarnpkg.com/typedoc/-/typedoc-0.19.0.tgz#438ae5a8e631322e3fc21f6068f2729ff15b18b9
- TypeScript version: 3.9.7, 3.7.4
- Node.js version: v14.5.0
- OS: Windows 10 Pro 19041.450