angular / angular/components

Refactor SVG inlining from md-icon into cdk-svg

Offen
#5,188 9 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/icon P3 refactoring
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

The SVG inlining features of md-icon are more generally useful than for just displaying icons. We should refactor the code such that:
* The SVG portions of `MdIconRegistry` are moved to `IconRegistry` in the cdk, with `MdIconRegistry` then extending `IconRegistry`
* The SVG inlining code in `md-icon` is moved into `cdk-svg` with `md-icon` then consuming `cdk-svg`.

This will enable us to add additional APIs to `cdk-svg` around customizing `viewBox` and `preserveAspectRatio` (see https://css-tricks.com/scale-svg)

Notes:
* Part of this should be moving SVG parsing (i.e. `string` -> `SVGElement`) into its own utility that can be mocked. This will be useful when ensuring that parsing only happens when expected (since it can have performance impacts if overdone).

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Ermittle die aktuellen SVG-Bestandteile von MdIconRegistry und den von md-icon verwendeten SVG-Inlining-Code und vergleiche sie anschließend mit der cdk IconRegistry und den cdk-svg-Einstiegspunkten. Das Refactoring ist abgeschlossen, wenn das SVG-Registry-Verhalten und das Inlining vom CDK bereitgestellt werden, MdIconRegistry IconRegistry erweitert, md-icon cdk-svg verwendet und das SVG-Parsing in einem mockbaren Utility isoliert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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