-
Notifications
You must be signed in to change notification settings - Fork 8
Description
First of all — this project is awesome 🎉
The idea of bringing a Rust-based Angular compiler to Vite is really exciting, and the
progress so far has been impressive. Thank you for building this! I've been
experimenting with it and ran into a couple of rough edges that I wanted to document
clearly so they can be addressed.
Summary
The README documents angularVersion as a valid option for the angular() Vite plugin, but
the option is silently ignored — it has never been part of PluginOptions. Additionally,
@oxc-angular/vite@0.0.15 unconditionally emits Angular 20 runtime instructions that
don't exist in Angular 19, making the plugin unusable with Angular 19 projects. Neither
of these facts is currently documented, which makes the resulting errors quite confusing
to debug.
Issue 1: angularVersion is silently ignored by the plugin
The README shows this example:
angular({
angularVersion: 21,
enableHmr: true,
})
In practice, angular() accepts neither angularVersion nor enableHmr — both are silently
ignored. The angularVersion option only exists on the lower-level TransformOptions
interface (for transformAngularFile()), but is never read from PluginOptions and never
forwarded to transformAngularFile() internally.
This is an easy fix — either wire it through from PluginOptions →
transformAngularFile(), or update the README example to reflect what's actually
supported.
Issue 2: Angular 20 runtime is required but undocumented — breaks Angular 19 projects
@oxc-angular/vite@0.0.15 unconditionally emits ɵɵconditionalCreate and
ɵɵconditionalBranchCreate for every @if/@switch block. These instructions were
introduced in Angular 20 and do not exist in Angular 19. There is no version gating in
the Rust compiler — the instruction selection is hardcoded regardless of any
angularVersion value.
On an Angular 19.2.x project this produces a cryptic runtime error with no indication of
the real cause:
TypeError: i0.ɵɵconditionalCreate is not a function
at ButtonComponent_Template (button.component.ts:121:1)
I confirmed this by checking @angular/core@19.2.18: ɵɵconditionalCreate is completely
absent from all exports. I also checked the compiler source and can see that
create_conditional_create_stmt() in control_flow.rs always emits CONDITIONAL_CREATE with
no version branching anywhere in the pipeline.
Steps to reproduce
- Use an Angular 19.x project
- Install @oxc-angular/vite@0.0.15
- Use the angular() plugin with any component containing @if or @switch
- Observe TypeError: i0.ɵɵconditionalCreate is not a function at runtime
Suggested fixes
Either:
- A) Add version-gating in the Rust compiler so that Angular 19 targets emit only
ɵɵconditional (the existing update-time instruction used in Angular 19), or - B) Document the Angular 20 minimum requirement clearly — e.g. in peerDependencies and
the README — so users know upfront
Either way it would be great to also get the angularVersion option properly connected
from the angular() plugin down to transformAngularFile(), since that's clearly the
intended path for version-conditional behaviour.
Thanks again for the great work on this project!
🙏
Environment
- @oxc-angular/vite: 0.0.15
- @angular/core: 19.2.18
- Platform: macOS (darwin arm64)
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackPriority