Skip to content

feat: integrate oxc_transformer for TypeScript-to-JS post-processing#62

Closed
Brooooooklyn wants to merge 1 commit intomainfrom
feat/integrate-oxc-transformer
Closed

feat: integrate oxc_transformer for TypeScript-to-JS post-processing#62
Brooooooklyn wants to merge 1 commit intomainfrom
feat/integrate-oxc-transformer

Conversation

@Brooooooklyn
Copy link
Member

@Brooooooklyn Brooooooklyn commented Mar 4, 2026

Non-Angular class decorators (e.g., @UntilDestroy()) were left as raw
decorator syntax in the compiled output because the Angular compiler
only strips Angular-specific decorators. Since the Vite plugin's
transform hook replaces default TS→JS processing, these decorators
never get lowered, causing parse errors downstream.

Add an optional typescript transform step that runs oxc_transformer

  • oxc_codegen after Angular compilation to strip TypeScript types and
    lower decorators. Supports auto-discovery of tsconfig.json via
    oxc_resolver, explicit tsconfig paths, or pre-resolved options.

Closes #44

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Note

Cursor Bugbot is generating a summary for commit fe15097. Configure here.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Brooooooklyn Brooooooklyn force-pushed the feat/integrate-oxc-transformer branch from fe15097 to a543ad1 Compare March 4, 2026 13:43
@Brooooooklyn Brooooooklyn force-pushed the feat/integrate-oxc-transformer branch from a543ad1 to 21fe4de Compare March 4, 2026 14:34
Non-Angular class decorators (e.g., @UntilDestroy()) were left as raw
decorator syntax in the compiled output because the Angular compiler
only strips Angular-specific decorators. Since the Vite plugin's
transform hook replaces default TS→JS processing, these decorators
never get lowered, causing parse errors downstream.

Add an optional `typescript` transform step that runs oxc_transformer
+ oxc_codegen after Angular compilation to strip TypeScript types and
lower decorators. Supports auto-discovery of tsconfig.json via
oxc_resolver, explicit tsconfig paths, or pre-resolved options.

Closes #44

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn force-pushed the feat/integrate-oxc-transformer branch from 21fe4de to 69b4ccf Compare March 4, 2026 14:39
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

// verbatimModuleSyntax maps to onlyRemoveTypeImports in the Rust compiler
onlyRemoveTypeImports: compilerOptions.verbatimModuleSyntax,
}
}
Copy link

Choose a reason for hiding this comment

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

tsconfig extends chains are not resolved

Medium Severity

readTsCompilerOptions reads the tsconfig.json directly with JSON.parse but does not follow extends chains. Most Angular projects use tsconfig.json that extends a base config (e.g., "extends": "./tsconfig.base.json"), where settings like experimentalDecorators are commonly defined in the base. This means the pre-resolved options will have undefined for those fields, falling back to NAPI defaults, which may not match the project's actual configuration.

Fix in Cursor Fix in Web

// Remove trailing commas before } or ]
result = result.replace(/,\s*([}\]])/g, '$1')
return result
}
Copy link

Choose a reason for hiding this comment

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

Naive comment stripping corrupts strings containing //

Low Severity

stripJsonComments uses regex \/\/.*$ to strip single-line comments, but this also matches // inside JSON string values. A tsconfig.json containing a string with // (e.g., a URL in a path mapping or plugin config) would have the string value truncated, producing invalid JSON and a confusing parse error.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non Angular class decorators break OXC compiled output

1 participant