Repository navigation
fix: remove comments using language parsers - #603
Closed
majestic-owl448 wants to merge 2 commits into
Closed
majestic-owl448 wants to merge 2 commits into
majestic-owl448 wants to merge 2 commits into
Conversation
Keep TypeScript in the lazy-loaded Explorer chunk.
2 tasks done
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist:
Update index.md)Use language parsers and tokenizers to locate comments in HTML, CSS, JavaScript, and Python, then remove their ranges from the original source. This preserves formatting and literal content, including cases that the existing regex helpers misidentify as comments. JavaScript comment removal preserves line breaks and inserts separators where deletion would join tokens.
Use parse5 for HTML, @csstools/css-tokenizer for CSS, @lezer/python for Python, and Acorn with JSX and loose parsing for JavaScript. Add 70 regression cases and browser integration coverage. Package registry signatures, install scripts, and known advisories were checked before adopting the dependencies.
Keep this PR in draft because the eager parser imports increase every evaluator's startup bundle. The JavaScript evaluator grows from 38,661 to 201,875 bytes gzipped, about 159 KiB extra. The compressed npm package grows from 2.23 to 2.70 MiB. The loading design needs further work before this is ready to merge.