Skip to content

refactor(@schematics/angular): use oxc-parser in trust-proxy-headers migration - #34020

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:feat/schematics-oxc-parser
Open

refactor(@schematics/angular): use oxc-parser in trust-proxy-headers migration#34020
clydin wants to merge 1 commit into
angular:mainfrom
clydin:feat/schematics-oxc-parser

Conversation

@clydin

@clydin clydin commented Sep 3, 2026

Copy link
Copy Markdown
Member

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.

…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`.
@clydin clydin added the target: minor This PR is targeted for the next minor release label Sep 3, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 3, 2026
@clydin
clydin requested a review from alan-agius4 September 3, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @schematics/angular target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant