-
Notifications
You must be signed in to change notification settings - Fork 767
Port --stripInternal #2267
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
Port --stripInternal #2267
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
This PR ports the --stripInternal compiler option from TypeScript, which removes declarations marked with @internal JSDoc comments from emitted declaration files. The implementation correctly identifies internal annotations in both regular declarations and constructor parameter properties.
Key Changes
- Adds
stripInternalflag toSymbolTrackerSharedStatefor tracking the compiler option - Implements
shouldStripInternal(),isInternalDeclaration(), andhasInternalAnnotation()methods for detecting internal declarations - Applies internal stripping at key transformation points: declaration subtrees, statements, top-level declarations, constructor parameter properties, and enum members
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
internal/transformers/declarations/transform.go |
Core implementation of stripInternal feature with detection logic for @internal annotations and integration into the declaration transformation pipeline |
internal/transformers/declarations/tracker.go |
Adds stripInternal boolean field to shared state for tracking the compiler option |
testdata/baselines/reference/submodule/conformance/declarationEmitWorkWithInlineComments.js |
Updated baseline showing correct removal of internal constructor parameter properties from declaration output |
testdata/baselines/reference/submodule/conformance/declarationEmitWorkWithInlineComments.js.diff |
Reduced diff indicating convergence with reference TypeScript implementation |
testdata/baselines/reference/submodule/compiler/stripInternal1.js |
Updated baseline showing correct removal of internal method declarations |
testdata/baselines/reference/submodule/compiler/stripInternal1.js.diff |
Eliminated diff indicating complete convergence with reference implementation |
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.
Looks good; I thought the builder had something special for stripInternal, but maybe the affectsBuildInfo flag on the option is sufficient.
|
I've also noticed that, weirdly, 7.0 will actually have better |
|
Yay better architecutre! |
No description provided.