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

Update dev dependency "@microsoft/api-extractor" #9121

Closed
wants to merge 3 commits into from

Conversation

mikeharder
Copy link
Member

@mikeharder mikeharder commented May 27, 2020

@ramya-rao-a
Copy link
Contributor

Do we know if the problems described in #8400 is resolved in the latest api extractor?

@KarishmaGhiya
Copy link
Member

The api-extractor step is failing with the error - Error: The expression contains an import() type, which is not yet supported by API Extractor

@mikeharder
Copy link
Member Author

Do we know if the problems described in #8400 is resolved in the latest api extractor?

@ramya-rao-a: This PR was an experiment to answer this question (and see if anything else broke).

@KarishmaGhiya: Was an issue filed against api-extractor for #8400?

@mikeharder
Copy link
Member Author

The error The expression contains an import() type, which is not yet supported by API Extractor appears to be a known issue where api-extractor does not yet support TS 3.8:

microsoft/rushstack#1866

However, this comment suggests the fact we are hitting this error might be an anti-pattern in our code:

microsoft/rushstack#1866 (comment)

@xirzec: Can you please read this comment and suggest what we should do going forward? We can certainly stay pinned on an older version of api-extractor, but eventually we may want/need fixes that will require upgrading to latest.

@jeremymeng
Copy link
Member

The error The expression contains an import() type, which is not yet supported by API Extractor appears to be a known issue where api-extractor does not yet support TS 3.8:

This is strange. We upgraded to TS 3.8 three weeks ago, and the version of api-extractor in our repo has been working. Could be a regression in the new version?

@mikeharder
Copy link
Member Author

The error The expression contains an import() type, which is not yet supported by API Extractor appears to be a known issue where api-extractor does not yet support TS 3.8:

This is strange. We upgraded to TS 3.8 three weeks ago, and the version of api-extractor in our repo has been working. Could be a regression in the new version?

This error message was added in 7.8.2, though it sounds like "import() type" was never supported, it just wasn't an explicit error before:

microsoft/rushstack#1867
https://github.com/microsoft/rushstack/blob/master/apps/api-extractor/CHANGELOG.md#782

We were unable to use versions 7.7.12 and 7.7.13 due to other issues. I will try pinning to 7.8.1 to see what happens.

But I would still like @xirzec to weigh in on whether this is something api-extractor needs to fix, or if we shouldn't be using this "import() type" as this comment suggests:

microsoft/rushstack#1866 (comment)

@jeremymeng
Copy link
Member

We have this code in identity logging.ts

import { createClientLogger } from "@azure/logger";

/**
 * The AzureLogger used for all clients within the identity package
 */
export const logger = createClientLogger("identity");

TypeScript (3.6, 3.7, 3.8) all generates the same typing file as

/**
 * The AzureLogger used for all clients within the identity package
 */
export declare const logger: import("@azure/logger").AzureLogger;

So we are not using the new import type feature in 3.8 at all.

As for the breaking change in the comment I think we solved it using the downlevel-dts package, at least for the getter syntax, for lower version of TypeScript.

@xirzec
Copy link
Member

xirzec commented May 27, 2020

I'm not sure what is broken here. I tried to use the 'import type' syntax but because API extractor broke I wasn't able to. We shouldn't be using that style of import anywhere.

@mikeharder mikeharder force-pushed the update-api-extractor branch from b8f0513 to 88b0e0e Compare May 27, 2020 21:47
@mikeharder
Copy link
Member Author

The "import() type" issue is fixed for identity by this commit:

88b0e0e

Similar changes will be needed in other packages.

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.

5 participants