Refactor SVG inlining from md-icon into cdk-svg
- Lingua principale
- TypeScript
- Stelle
- 25k
- Fork
- 6.8k
- Merge medio
- 1g 8h
- PR unite (30g)
- 91
Descrizione
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).
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Individua le parti SVG attuali di MdIconRegistry e il codice di inline degli SVG utilizzato da md-icon, quindi confrontali con cdk IconRegistry e gli entry point di cdk-svg. Il refactoring è completato quando il comportamento del registro SVG e l’inline sono forniti dal CDK, MdIconRegistry estende IconRegistry, md-icon utilizza cdk-svg e il parsing degli SVG è isolato in un’utilità sottoponibile a mock.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- frontend
- Tipo di issue
- Refactoring
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100