refactor(@schematics/angular): use oxc-parser in trust-proxy-headers migration - #34020
Open
clydin wants to merge 1 commit into
Open
refactor(@schematics/angular): use oxc-parser in trust-proxy-headers migration#34020clydin wants to merge 1 commit into
clydin wants to merge 1 commit into
Conversation
…migration Replaces the TypeScript AST API (`ts.createSourceFile`, `ts.Node`, and manual child traversal) in the `trust-proxy-headers` migration with `oxc-parser`. This introduces `oxc-parser` as a dependency to `@schematics/angular` and refactors the AST inspection in `trust-proxy-headers` to use `parseSync` and the `Visitor` class. Node ranges and AST structure continue to drive text insertions via the Schematics `UpdateRecorder`.
There was a problem hiding this comment.
Code Review
This pull request migrates the trust-proxy-headers migration from using the TypeScript compiler API to oxc-parser for AST parsing and traversal, updating dependencies and adding comprehensive unit tests. A critical issue was identified in the migration logic: the Visitor class from oxc-parser is designed to be subclassed and uses visit-prefixed methods (e.g., visitNewExpression) rather than being instantiated with a configuration object. As currently written, the visitor will not execute the custom logic, so a subclass implementation has been suggested to ensure the migration runs correctly.
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.
Replaces the TypeScript AST API (
ts.createSourceFile,ts.Node, and manual child traversal) in thetrust-proxy-headersmigration withoxc-parser.This introduces
oxc-parseras a dependency to@schematics/angularand refactors the AST inspection intrust-proxy-headersto useparseSyncand theVisitorclass. Node ranges and AST structure continue to drive text insertions via the SchematicsUpdateRecorder.