Repository navigation
refactor(@schematics/angular): use oxc-parser in trust-proxy-headers migration - #34020
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 PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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.