fix(aot): a user binding named `i0` collides with the injected `import * as i0 from '@angular/core'`
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 68/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- angular, rust, typescript
- Bereich
- compilers
Rechercherichtung
Start with crates/oxc_angular_compiler/src/component/namespace_registry.rs and compare its alias selection with the JIT handling from #504. Trace the hard-coded i0 uses in class_metadata/compiler.rs and component/transform.rs, including the HMR dependency and emitted import. Done means each file chooses one free namespace alias and the repros no longer produce duplicate bindings or refer to the user's i0.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
In AOT output, OXC always adds import * as i0 from '@angular/core' and refers to it as i0. If the file already has a top-level i0, the output declares it twice (a SyntaxError), and the Ivy code may use the user's i0. ngtsc picks a free name (i0_1). #504 fixed this for the JIT path by choosing a free name. AOT still uses a fixed name.
Repro A
import {Component} from '@angular/core';
const i0 = 1;
@Component({selector: 'c', template: '<div>{{v}}</div>'})
export class C { v = i0; }
Repro B
import {Component} from '@angular/core';
import * as i0 from './other';
@Component({selector: 'c', template: '<div>{{v}}</div>'})
export class C { v = i0.x; }
OXC (main and #504 tip)
import {Component} from '@angular/core';
import * as i0 from '@angular/core';
const i0 = 1; // duplicate declaration
export class C { v = i0;
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({...
import * as i0 from './other';
import * as i0 from '@angular/core'; // duplicate import binding
ngtsc 22.1.7
import * as i0_1 from "@angular/core";
const i0 = 1;
export class C {
v = i0;
static ɵcmp = /*@__PURE__*/ i0_1.ɵɵdefineComponent({ ... i0_1.ɵɵtext(1); ...
(B: import * as i0 from './other'; import * as i0_1 from "@angular/core";)
Where
i0 is hard-coded in several places:
crates/oxc_angular_compiler/src/component/namespace_registry.rs(@angular/core→i0; theiNnames for other modules have the same problem)class_metadata/compiler.rs(ReadVarExpr { name: "i0" })component/transform.rs(HMR namespace dependency, and the emitted import)
On main?
Yes. #504 only fixes the JIT path (JIT_ANGULAR_CORE_NS, commit 5128879).
Direction
Pick the namespace alias once per file, avoiding top-level bindings (as #504 does for JIT and as ngtsc's ImportManager does), and pass it to every place that emits the namespace.
- Vorherrschende Sprache
- Rust
- Sterne
- 232
- Forks
- 21
- Ø Merge
- 1 T. 18 Std.
- Gemergte PRs (30 T.)
- 59
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus voidzero-dev/oxc-angular-compiler
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
voidzero-dev/oxc-angular-compiler#563 ·
Maintainer antworten meist innerhalb von 1 Tag
-
e2e compare: setClassMetadata extraction regex never matches (ɵɵ vs ɵ) — classMetadataDiffs is dead codeEvtl. vergeben @Brooooooklyn hat das heute übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
voidzero-dev/oxc-angular-compiler#561 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
voidzero-dev/oxc-angular-compiler#506 ·
Maintainer antworten meist innerhalb von 1 Tag
-
fix(directive): input names with lone surrogates are emitted in oxc's internal U+FFFD encodingOffenbug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
voidzero-dev/oxc-angular-compiler#505 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug rust
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 56/100
voidzero-dev/oxc-angular-compiler#313 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in voidzero-dev/oxc-angular-compiler
Ähnliche Issues
-
mxl-compile: пример заполнения ячеек отклоняется UnicaEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 91/100
IngvarConsulting/unica#1301 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
curator: add tutros/sbxmOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
ajeetraina/awesome-docker-sbx#220 ·
-
`helios / deploy`: switch zone wait in `deploy.sh` has almost no headroom over healthy startup timesEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. OffenTest Flake
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
oxidecomputer/omicron#11453 ·
Maintainer antworten meist innerhalb von 1 Tag