Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Project-wide preserveWhitespaces option is ignored

Offen
#631 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@edbzn arbeitet bereits daran.

Seit 25.10.2026.

  • #637 von @edbzn — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
angular, rust
Bereich
backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Rust
Sterne
244
Forks
26
Ø Merge
1 T. 16 Min.
Gemergte PRs (30 T.)
87

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

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus voidzero-dev/oxc-angular-compiler

Alle Issues in voidzero-dev/oxc-angular-compiler

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.