Project-wide preserveWhitespaces option is ignored
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start with compile_component_full and trace how it builds template parse options from metadata.preserve_whitespaces; compare that with the project default described in the issue. Check transformAngularFile and compileComponentHmrUpdate for the same option handling, then run the mentioned ngtsc spec, "should take preserveWhitespaces config option into account." Done means the project-wide setting is honored while a component decorator can override it; pull request #637 is already open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
The project-wide preserveWhitespaces option (ngc's angularCompilerOptions.preserveWhitespaces) is ignored. TransformOptions.preserveWhitespaces exists, but transformAngularFile and compileComponentHmrUpdate only read the decorator's own preserveWhitespaces. A project that sets true globally therefore renders with collapsed whitespace, which can change the gaps between inline elements. The Vite plugin also has no way to set it.
Found by running Angular's ngtsc spec ngtsc_spec.ts: "should take preserveWhitespaces config option into account" against oxc.
Reproduction
import {Component} from '@angular/core';
@Component({selector: 'test', template: `<div>
Template with whitespaces
</div>`})
export class TestCmp {}
compiled with transformAngularFileSync(src, file, { preserveWhitespaces: true }).
Actual
i0.ɵɵtext(1, " Template with whitespaces ");
Expected (ngc, preserveWhitespaces: true)
i0.ɵɵtext(1, "\n Template with whitespaces\n ");
Cause
compile_component_full builds the template parse options from metadata.preserve_whitespaces only. ngtsc's parseTemplateDeclaration (annotations/component/src/resources.ts) starts from the project default and lets the decorator override it.
- Lenguaje dominante
- Rust
- Estrellas
- 244
- Forks
- 26
- Merge medio
- 1 d 16 min
- PR fusionados (30 d)
- 87
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
-
vite: async/await is not lowered for zone.js, so fakeAsync/tick cannot control awaitsPosiblemente ocupada @edbzn la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
voidzero-dev/oxc-angular-compiler#641 ·
Los mantenedores suelen responder en 1 día
-
Constructor param typed `ns.Foo` (namespace-qualified) compiles to ɵɵinvalidFactoryDepPosiblemente ocupada @edbzn la tomó hace 1 día. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
voidzero-dev/oxc-angular-compiler#633 ·
Los mantenedores suelen responder en 1 día
-
@defer doesn't lazy-load an imports entry written as forwardRef(() => X)Posiblemente ocupada @edbzn la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
voidzero-dev/oxc-angular-compiler#632 ·
Los mantenedores suelen responder en 1 día
-
Constructor overloads: factory and metadata read the first overload, not the implementationPosiblemente ocupada @edbzn la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
voidzero-dev/oxc-angular-compiler#630 ·
Los mantenedores suelen responder en 1 día
-
@Injectable deps entries written as [new Optional(), new Self(), Dep] inject the array as the tokenPosiblemente ocupada @edbzn la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
voidzero-dev/oxc-angular-compiler#629 ·
Los mantenedores suelen responder en 1 día
Todos los issues de voidzero-dev/oxc-angular-compiler
Issues similares
-
`mise doctor` Shows Not Installed Lazy Tools as ProblemsPosiblemente ocupada @jdx la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
nn::linear: weight initialization depends on `bias` because the bias is created before the weightPosiblemente ocupada @monfortema la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
LaurentMazare/tch-rs#1067 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
astral-sh/astral-codec#234 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100