firebase / firebase/FirebaseUI-Flutter
firebase_ui_oauth: Pre-compile svg icon assets using `vector_graphics_compiler`
- Vorherrschende Sprache
- Dart
- Sterne
- 151
- Forks
- 141
- Ø Merge
- 2 T. 11 Std.
- Gemergte PRs (30 T.)
- 6
Beschreibung
### Discussed in https://github.com/firebase/FirebaseUI-Flutter/discussions/240
Originally posted by **aebrahim** January 4, 2024
The social login icons are packaged as strings containing the raw svg, which are then rendered using `flutter_svg`. However, under the hood, using `flutter_svg` means also including its dependency `vector_graphics_compiler` with the application, which at runtime converts raw svg to a compiled `VectorGraphic` to display.
Given that the svg string is known at build time, it is possible to pre-compile it as a `VectorGraphic` at build time. Advantages:
1. Would no longer pull in the `vector_graphics_compiler` dependency, which adds ~180 KB to the build.
2. Slightly more efficient runtime as the precompiled `VectorGraphic` can be a const.
Beitragsleitfaden
Rechercherichtung
Beginne damit, die SVG-Strings für Social Login und ihre Verwendung von flutter_svg im Paket firebase_ui_oauth zu lokalisieren, und untersuche anschließend die Paketabhängigkeit und die Asset-Konfiguration. Bestätige die Build-Toolchain und die Runtime-API von vector_graphics_compiler, bevor du die Implementierung änderst; fertig ist die Änderung, wenn die Symbole vorkompiliert sind, zur Laufzeit weiterhin verwendet werden können und die Compiler-Abhängigkeit in der Anwendung nicht mehr erforderlich ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- dart, flutter
- Bereich
- build-system, mobile-dev
- Issue-Typ
- Refactoring
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100