feat: honor `jit: true` in `@Component` / `@Directive` / `@NgModule` (skip AOT compile)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
Start by tracing the existing JIT downlevel path exposed by TransformOptions::jit, then compare it with the AOT handling for @Component, @Directive, and @NgModule. The issue points to ngtsc's extractDirectiveMetadata and the directive, component, and ng_module handlers as behavioral references. Done means jit: true preserves the decorator for runtime JIT, emits no Ivy .d.ts members for that class, and leaves the rest of the file AOT-compiled.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
jit: true in decorator metadata tells ngtsc not to compile the class ahead of time. ngtsc leaves the decorator in place (it is downleveled by TS) so the JIT compiler handles it at runtime. OXC ignores the flag and compiles the class AOT anyway.
Repro
import {Component} from '@angular/core';
@Component({jit: true, selector: 'c', template: '<div>{{x}}</div>'})
export class C { x = 1; }
OXC (main and #504 tip)
export class C { x = 1;
static ɵfac = function C_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || C)(); };
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({type:C,selectors:[["c"]],decls:2,vars:1,template:function C_Template(rf, ctx) {...},encapsulation:2});
}
// + ɵsetClassDebugInfo, ɵsetClassMetadata(C,[{type:Component,args:[{jit:true,selector:"c",template:"<div>{{x}}</div>"}]}],null,null)
.d.ts: ɵfac + ɵcmp declarations.
ngtsc 22.1.7
let C = class C {
x = 1;
};
C = __decorate([
Component({ jit: true, selector: 'c', template: '<div>{{x}}</div>' })
], C);
.d.ts: only x: number; (no Ivy fields).
@Directive({jit: true, ...}) and @NgModule({jit: true}) behave the same way: ngtsc leaves the decorator, OXC emits ɵdir / ɵmod.
ngtsc source (v22.0.0)
annotations/directive/src/shared.tsextractDirectiveMetadata:if (directive.has('jit')) return {jitForced: true};annotations/directive/src/handler.tsandannotations/component/src/handler.ts: onjitForced, register for JIT and skip analysis.annotations/ng_module/src/handler.ts:if (ngModule.has('jit')) ...
On main?
Yes.
Direction
When the decorator has jit: true, run that class through the existing JIT downlevel path (TransformOptions::jit) instead of AOT, and emit no Ivy .d.ts members for it. The rest of the file is still compiled AOT.
- Lenguaje dominante
- Rust
- Estrellas
- 228
- Forks
- 20
- Merge medio
- 2 d 14 h
- PR fusionados (30 d)
- 30
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de voidzero-dev/oxc-angular-compiler
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
voidzero-dev/oxc-angular-compiler#511 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
voidzero-dev/oxc-angular-compiler#522 ·
Los mantenedores suelen responder en 1 día
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
voidzero-dev/oxc-angular-compiler#521 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
voidzero-dev/oxc-angular-compiler#520 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
voidzero-dev/oxc-angular-compiler#519 ·
Los mantenedores suelen responder en 1 día
Todos los issues de voidzero-dev/oxc-angular-compiler
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
canonical/opentelemetry-collector-operator#409 ·
Los mantenedores suelen responder en 1 día
-
codegen: memref.collapse_shape in an mlir! block leaves an affine.apply that is never loweredAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
bug CLI exec tool-calls
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día