fix(aot): a user binding named `i0` collides with the injected `import * as i0 from '@angular/core'`
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- angular, rust, typescript
- Ambito
- compilers
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 232
- Fork
- 21
- Merge medio
- 1g 18h
- PR unite (30g)
- 59
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di voidzero-dev/oxc-angular-compiler
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
voidzero-dev/oxc-angular-compiler#563 ·
I maintainer di solito rispondono entro 1 giorno
-
e2e compare: setClassMetadata extraction regex never matches (ɵɵ vs ɵ) — classMetadataDiffs is dead codeForse già presa @Brooooooklyn l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
voidzero-dev/oxc-angular-compiler#561 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
voidzero-dev/oxc-angular-compiler#506 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(directive): input names with lone surrogates are emitted in oxc's internal U+FFFD encodingApertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
voidzero-dev/oxc-angular-compiler#505 ·
I maintainer di solito rispondono entro 1 giorno
-
bug rust
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
voidzero-dev/oxc-angular-compiler#313 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di voidzero-dev/oxc-angular-compiler
Issue simili
-
[Feature] 设置里面的同步功能Apertaenhancement user-priority/P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
agent:triaged bug bughunt pm:npm priority:p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
SocketDev/socket-patch#1127 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno