How to design a Dart package with hooks
summary
Using package:intl4x as the example, the talk shows how the new build and link hook system plus usage recording actually bundles native ICU4X binaries, offers link.dart tree-shaking via @RecordUse to collect used symbols, and cuts platform assets from tens of megabytes down to kilobytes. It recommends splitting raw FFI bindings and a nicer API, offering fetch (download releases on GitHub) and checkout modes, versioning artifacts with hashes, downloading only needed targets, and designing APIs to let tree-shaking work statically.
AI-written summary · about
chapters (9)
- 0:00Dart package design with hooks
- 1:03Build and link hooks
- 5:19Dart package structure best practices
- 6:42Native assets user options
- 7:45GitHub as CDN for binaries
- 8:48Versioning and integrity
- 9:29Tree shaking to fight bloat
- 11:35APIs for tree shaking
- 12:57Summary
related talks
30mBuilding a package with assets
44mBuilding Pieces for Developers Our Journey with Flutter and Dart
46mSummit Session 3 - Sustainable package maintenance models
44mSwift Packages - Dependency Management of the Future
18mBuilding Your Very Own DevTools Extension
36mcontribute to the Flutter ecosystem.
29mLessons from a Librarian
27mBuilding with best practices in FlutterFlow
