Skip to content

Remove non-ascii characters from internal code comments - #53608

Merged
Ryan Cavanaugh (RyanCavanaugh) merged 1 commit into
microsoft:mainfrom
dsherret:remove_non_ascii_chars_comments
Mar 31, 2023
Merged

Remove non-ascii characters from internal code comments#53608
Ryan Cavanaugh (RyanCavanaugh) merged 1 commit into
microsoft:mainfrom
dsherret:remove_non_ascii_chars_comments

Conversation

@dsherret

Copy link
Copy Markdown
Contributor

In Deno we now require 7-bit ascii for our internal code. When TypeScript builds, some of these characters end up in the build output. It seems like there weren't that many instances of non-ascii characters in TypeScript's comments so is it ok to remove them? It makes my life a little easier and makes the code a bit more consistent.

I only did a search for the characters that ended up in the build output in the "src" directory and nothing else.

@typescript-bot TypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Mar 31, 2023
@typescript-bot

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@jakebailey

Copy link
Copy Markdown
Member

This seems okay, but, why is it a requirement for Deno? Can you exempt vendored code? How can we make sure to not regress? What if we add special characters to document something?

@dsherret

David Sherret (dsherret) commented Mar 31, 2023

Copy link
Copy Markdown
Contributor Author

How can we make sure to not regress?

Don't worry about it on your side. Our code just fails to build and it's easy to workaround. Only about 4 of these comments actually ended up in the output so I think it's really rare.

What if we add special characters to document something?

At that point I'll just add something to transform them.

Why is it a requirement for Deno? Can you exempt vendored code?

No, it allows us to use v8 external one-byte strings which drastically reduces our snapshot size. Once one of these characters ends up in the code then it goes to utf-16.

@jakebailey

Copy link
Copy Markdown
Member

No, it allows us to use v8 external one-byte strings which drastically reduces our snapshot size. Once one of these characters ends up in the code then it goes to utf-16.

That's super interesting!

});
// No fix-all because it will already be included once with the use site fix,
// and for simplicity the fix-all doesnt let the user choose between use-site and declaration-site fixes.
// and for simplicity the fix-all doesn't let the user choose between use-site and declaration-site fixes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can't stop looking at this ‘ psuedoapostrophe

@RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh) merged commit 710e7d9 into microsoft:main Mar 31, 2023
@dsherret
David Sherret (dsherret) deleted the remove_non_ascii_chars_comments branch March 31, 2023 18:17
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants