Skip to content

Conversation

@Dergash
Copy link
Contributor

@Dergash Dergash commented Sep 1, 2020

Fix backward compatibility for typescript 3.7.5 and 3.9.7 by checking the existence of missing ts methods before calling them.
See #1362

…ier` before calling to restore backward compatibility with typescript 3.7.5 and 3.9.7 respectively
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Sep 1, 2020

I'm not against backwards compatibility in theory, but in practice it is a nightmare that I don't really have time to maintain.

You fixed the two points that generally cause crashes when running with an unsupported version... but there are at least three more that I remember off the top of my head.

  • ts.TupleTypeNode changed the property that contained elements are within, so it still doesn't work in 3.x.
  • ts.KeywordTypeNode doesn't include the same set of types across 3.x and 4.x.
  • ts.isPrivateIdentifier is used within the class (property?) converter, and will crash that.

... and that's just what I remember. There are probably another half dozen breaking changes that I don't remember in the past couple of TS version upgrades.

Another problem with trying to continue supporting old versions is that if we do that, we also need to test with old versions and have some process for deciding when to stop supporting them.

@Dergash
Copy link
Contributor Author

Dergash commented Sep 1, 2020

Your points are perfectly valid and I probably wouldn't even bother with creating an issue if I've had noticed the peer dependency warning before I went to fix it, so I haven't any arguments for the change anymore aside of 'it's really two lines and support for popular create-react-template tool is back'.

Feel free to close.

P.S. Another option is that I can go back to typescript 3.0.0 and fix all other compatibility problems and test them and return to you with this PR updated after that, but of course it doesn't remove the question when support should be dropped. Major + 1?

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Sep 5, 2020

Major + 1 is a long time. 3.0 was more than 2 years ago. I can see supporting 3.9 until 4.1 comes out, but I really don't want to go further back than one minor version. The TS team only releases one every 3 months or so... create-react-app should upgrade their TypeScript version. There's already enough cruft in this codebase without trying to support multiple versions. It's fine for ts-node to support back to 2.7... they just use the transpilation API, which hasn't really changed... but nearly every version of TypeScript has some change that breaks TypeDoc.

I've made the necessary changes to work with TypeScript 3.9 in 833ebb8 + added you as an author. 3.9 support is included in version 0.19.1

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 this pull request may close these issues.

2 participants