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

[api-extractor] Please support typescript 3.8 #1866

Closed
1 of 2 tasks
jrnail23 opened this issue May 12, 2020 · 9 comments
Closed
1 of 2 tasks

[api-extractor] Please support typescript 3.8 #1866

jrnail23 opened this issue May 12, 2020 · 9 comments
Labels
ae-ts-version Tracks API Extractor issues involving support for recent TypeScript versions enhancement The issue is asking for a new feature or design change help wanted If you're looking to contribute, this issue is a good place to start!

Comments

@jrnail23
Copy link

Is this a feature or a bug?

  • Feature
  • Bug

Please describe the actual behavior.

What is the expected behavior?

@octogonz
Copy link
Collaborator

Are there any new features in 3.8 that could potentially break API Extractor?

@jrnail23
Copy link
Author

Yes, it seems that import type { MyType } from "some-module" breaks it (or at least that's what I think broke my setup).
I kept getting warnings falsely complaining that my types were missing a release/scope annotation (i.e., @public).

@octogonz
Copy link
Collaborator

Yeah, if that gets emitted in the .d.ts file, it might be a new import pattern. API Extractor detects and walks each kind of import.

Some 3.8 features that might break something:

  • ECMAScript private fields class Person { #name: string }
  • export * as utilities from "./utilities.js"; - in the past this had to be an import/export pair instead of one statement

From a quick glance at the 3.9 features, I didn't see anything that looked like it would impact API Extractor.

@octogonz
Copy link
Collaborator

We can start work on a PR to add support for these issues. None of them seems particularly difficult.

But I should also point out:

  • Using any of these features in your API might make your library unusable by consumers who haven't upgraded to the latest TypeScript compiler.
  • A number of folks may be stuck on TypeScript 3.6 for a while, because TypeScript 3.7 broke compatibility with all previous compiler releases even for code that doesn't use any 3.7 language features (!)

@MattiasBuelens
Copy link
Contributor

Using any of these features in your API might make your library unusable by consumers who haven't upgraded to the latest TypeScript compiler.

That's where a tool like downlevel-dts can come in, to transform these new features into older syntax for older TypeScript versions. 😉 So you would first use API Extractor to create a .d.ts file for TypeScript 3.8, and then you would run downlevel-dts to create a variant for older TypeScript versions. 🙂

@octogonz
Copy link
Collaborator

TypeScript 3.9 introduces some new syntax also: #1914

@octogonz octogonz added enhancement The issue is asking for a new feature or design change help wanted If you're looking to contribute, this issue is a good place to start! labels Jun 11, 2020
@octogonz octogonz added the ae-ts-version Tracks API Extractor issues involving support for recent TypeScript versions label Jul 2, 2020
@octogonz
Copy link
Collaborator

octogonz commented Jul 3, 2020

Some progress on this:

@octogonz
Copy link
Collaborator

octogonz commented Jul 3, 2020

With these changes, I think we can resolve this issue. There are still some remaining unsupported language features like #1914, but they have reasonable workarounds.

@octogonz
Copy link
Collaborator

octogonz commented Jul 3, 2020

This fix was released with API Extractor 7.9.0

@octogonz octogonz closed this as completed Jul 3, 2020
oct16 added a commit to oct16/TimeCat that referenced this issue Jul 20, 2020
oct16 added a commit to oct16/TimeCat that referenced this issue Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ae-ts-version Tracks API Extractor issues involving support for recent TypeScript versions enhancement The issue is asking for a new feature or design change help wanted If you're looking to contribute, this issue is a good place to start!
Projects
None yet
Development

No branches or pull requests

3 participants