-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Bump TS devDep to 5.3, hack dtsBundler to remove new comments #56554
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.
wow, that is hacky!
@@ -78,7 +78,7 @@ | |||
"playwright": "^1.38.0", |
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.
this reminds me that we devdep on playwright =(
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.
It's not a big deal; as of 1.38 the package only depends on playwright-core
(which is dependency free) and does not install browsers unless requested. The pair of packages is 2-3x smaller than the TypeScript package itself. I actually added this intentionally to simplify our builds once the change was made.
Sounds suspiciously like #38427 |
Funkily we already emitted some comments in places like parameter lists even in declaration emit, so this is nothing new: Playground Link Since the dts bundler works off of the dts code that tsc emits, these comments are all actually appearing in the real dts files. The dts bundler does not actually run off of the original source at all. |
The package-lock bumper is failing because it sees that tests fail after updating deps.
This was caused by #50097 which started emitting more comments. Since our dts bundler is very naive and just prints nodes as-is, this means that we'll include non-JSDoc comments too, which isn't super desirable.
This turns out to probably not be super great for dts emit; see the dts emit here: Playground Link
For now, I've just used internal APIs to override the comment writing function to avoid emitting
//
comments entirely, which lets us bump TS. Thankfully, I chose todprint
the output of the bundler, so the hack doesn't cause a diff due to stray spaces left in after my hack.Probably we should be figuring out if dts emit should even output these kinds of comments, and also if the printing system should let you disable the emitting of non-jsdoc comments. That or I've missed something and that other PR was just wrong.