@HostBinding on a member that is not an identifier ('my-prop') compiles to `ctx.my - ctx.prop`; ngtsc uses `this["my-prop"]`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
Start by reading MemberHostBindings::of in directive/metadata.rs and compare its stored member name with ngtsc's getSafePropertyAccessString behavior described in the issue. Trace how that metadata becomes partial and full output, including the non-identifier example. Done means both output forms access my-prop as a property and identifier members such as m still work.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Found while reviewing #682.
ngtsc's extractHostBindings stores a @HostBinding member as getSafePropertyAccessString("this", member.name) (compiler-cli chunk-G5LDCSK3.js:3435): "this.m", or this["my-prop"] for a name that is not an identifier. Oxc's MemberHostBindings::of (directive/metadata.rs:201) stores the bare member name ("m", "my-prop").
@Directive({ selector: '[d]' })
export class D {
@HostBinding('id') 'my-prop' = 1;
@HostBinding('title') m = 2;
}
| result | |
|---|---|
| ngtsc partial | properties: { "id": "this[\"my-prop\"]", "title": "this.m" } |
| Oxc partial | properties:{id:"my-prop",title:"m"} |
| Oxc full | ɵɵdomProperty("id", (ctx.my - ctx.prop))("title", ctx.m) — wrong: parsed as a subtraction |
For identifier names only the partial text differs (both link to ctx.m). For names that are not identifiers, both full and partial output read the wrong value. ngtsc emits ctx["my-prop"].
- Lenguaje dominante
- Rust
- Estrellas
- 245
- Forks
- 26
- Merge medio
- 1 d 42 min
- PR fusionados (30 d)
- 83
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
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
voidzero-dev/oxc-angular-compiler#686 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
voidzero-dev/oxc-angular-compiler#694 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
voidzero-dev/oxc-angular-compiler#693 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
voidzero-dev/oxc-angular-compiler#692 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 43/100
voidzero-dev/oxc-angular-compiler#691 ·
Los mantenedores suelen responder en 1 día
Todos los issues de voidzero-dev/oxc-angular-compiler
Issues similares
-
bug good first issue help wanted linux macos testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
area: app type: test
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
storytold/photocraft#12706 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
IngvarConsulting/unica#2822 ·
Los mantenedores suelen responder en 1 día