-
Notifications
You must be signed in to change notification settings - Fork 655
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
Conversation
There was a problem hiding this 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 | |
There was a problem hiding this comment.
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.
Actually, it seems like declaration support for JS files / JSDoc is working; a fresh build of tsgo transforms this /**
* @param {number} a
* @param {number} b
*/
export function func1(a, b) {
return a + b;
}
export function func2() {
const a = 1;
return a;
} into this /**
* @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
|
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. |
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. |
got it, awesome! I did notice that tsgo emits |
I removed the part of the note that makes claims about JS/JSDoc for now, since it seems untrue that it doesn’t work.
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. |
thanks @weswigham Co-authored-by: Wesley Wigham <wwigham@gmail.com>
grammar fix; compound adjective should not be hyphenated when it follows the noun
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.