Skip to content

Update “Declaration emit” in README progress table #975

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

Merged
merged 4 commits into from
Jun 2, 2025

Conversation

controversial
Copy link
Contributor

Follow up to update the README now that #791 is merged!

I tried to write notes based on the TODOs in the PR but please correct me if I’m misrepresenting the status of this feature.

@Copilot Copilot AI review requested due to automatic review settings May 29, 2025 15:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Updates the README progress table to reflect the mergedDeclaration emit feature status.

  • Changed “Declaration emit” status from not ready to done
  • Updated notes to indicate partial limitations (JS/JSDoc support)

README.md Outdated
@@ -84,7 +84,7 @@ This is still a work in progress and is not yet at full feature parity with Type
| Type checking | done | Same errors, locations, and messages as TS5.8. Types printback in errors may display differently (in progress) |
| JavaScript-specific inference and JS Doc | not ready | - |
| JSX | done | - |
| Declaration emit | not ready | Coming soon |
| Declaration emit | done | Emit for JS files / JSDoc not yet supported. Some types may be formatted slightly differently |
Copy link
Preview

Copilot AI May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The status is marked as “done” but notes indicate incomplete JS/JSDoc support. Consider using a status like “partial” or “limited” to avoid implying full feature parity.

Copilot uses AI. Check for mistakes.

@jakebailey jakebailey requested a review from weswigham May 29, 2025 15:57
@controversial
Copy link
Contributor Author

Actually, it seems like declaration support for JS files / JSDoc is working; a fresh build of tsgo transforms this .js file

/**
 * @param {number} a
 * @param {number} b
 */
export function func1(a, b) {
    return a + b;
}
export function func2() {
    const a = 1;
    return a;
}

into this .d.ts file:

/**
 * @param {number} a
 * @param {number} b
 */
export declare function func1(a: number, b: number): number;
export declare function func2(): unknown;

so maybe I’m misinterpreting

  • JS declaration emit support (will need to be substantively rewritten given different upfront parsing and checking of JSDoc structures - likely for the better)

@jakebailey
Copy link
Member

The new codebase uses an all-new method to handle JSDoc where we actually rewrite the AST during parse to inject type nodes where TS files would have them, so some JS stuff is likely to "just work" without any other work. But, not everything works with that method.

@jakebailey
Copy link
Member

jakebailey commented May 29, 2025

It's not incorrect; it's definitely not thoroughly tested. We're not even claiming JS/JSDoc is done, so it would be weird to say that its declaration emit is already done.

@controversial
Copy link
Contributor Author

got it, awesome!

I did notice that tsgo emits export declare function statements for that .js file, where tsc emitted plain export function statements (but both use export declare in declarations for typescript source files)

@controversial
Copy link
Contributor Author

We're not even claiming JS/JSDoc is done, so it would be weird to say that its declaration emit is already done

I removed the part of the note that makes claims about JS/JSDoc for now, since it seems untrue that it doesn’t work.

it's definitely not thoroughly tested

Understand if you want to hold off on making claims about declaration emit in the status table until there’s been more thorough testing! Excited about the progress here.

controversial and others added 2 commits June 2, 2025 15:38
thanks @weswigham

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
grammar fix; compound adjective should not be hyphenated when it follows the noun
@weswigham weswigham enabled auto-merge June 2, 2025 19:52
@weswigham weswigham added this pull request to the merge queue Jun 2, 2025
Merged via the queue into microsoft:main with commit 7a17117 Jun 2, 2025
23 checks passed
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.

3 participants