Migrate the flutter/flutter wiki to docs/unsorted_wiki (#148562)
Part of https://github.com/flutter/flutter/issues/145009 This is part one of the wiki migration. This moves all wiki pages wholesale into the new docs directory with no changes. Follow up PRs will sort them, updating breadcrumbs and links.
This commit is contained in:
@@ -1240,7 +1240,10 @@ Future<void> verifyIssueLinks(String workingDirectory) async {
|
||||
final Set<String> suggestions = <String>{};
|
||||
final List<File> files = await _gitFiles(workingDirectory);
|
||||
for (final File file in files) {
|
||||
if (path.basename(file.path).endsWith('_test.dart') || path.basename(file.path) == 'analyze.dart') {
|
||||
if (path.basename(file.path).endsWith('_test.dart')
|
||||
|| path.basename(file.path) == 'analyze.dart'
|
||||
// TODO(Piinks): Disables checks in docs/unsorted, enabling unchanged initial migration, https://github.com/flutter/flutter/issues/145009
|
||||
|| file.path.contains('unsorted_wiki')) {
|
||||
continue; // Skip tests, they're not public-facing.
|
||||
}
|
||||
final Uint8List bytes = file.readAsBytesSync();
|
||||
@@ -1322,6 +1325,10 @@ Future<void> verifyRepositoryLinks(String workingDirectory) async {
|
||||
final Set<String> suggestions = <String>{};
|
||||
final List<File> files = await _allFiles(workingDirectory, null, minimumMatches: 10).toList();
|
||||
for (final File file in files) {
|
||||
// TODO(Piinks): Disables checks in docs/unsorted, enabling unchanged initial migration, https://github.com/flutter/flutter/issues/145009
|
||||
if (file.path.contains('unsorted_wiki')) {
|
||||
continue;
|
||||
}
|
||||
final Uint8List bytes = file.readAsBytesSync();
|
||||
// We allow invalid UTF-8 here so that binaries don't trip us up.
|
||||
// There's a separate test in this file that verifies that all text
|
||||
|
||||
2507
docs/unsorted_wiki/2021---Issue-Triage-Reports.md
Normal file
2507
docs/unsorted_wiki/2021---Issue-Triage-Reports.md
Normal file
File diff suppressed because it is too large
Load Diff
3372
docs/unsorted_wiki/2022---Issue-Triage-Reports.md
Normal file
3372
docs/unsorted_wiki/2022---Issue-Triage-Reports.md
Normal file
File diff suppressed because it is too large
Load Diff
3477
docs/unsorted_wiki/2023-Issue-Triage-Reports.md
Normal file
3477
docs/unsorted_wiki/2023-Issue-Triage-Reports.md
Normal file
File diff suppressed because it is too large
Load Diff
863
docs/unsorted_wiki/2024-Issue-Triage-Reports.md
Normal file
863
docs/unsorted_wiki/2024-Issue-Triage-Reports.md
Normal file
@@ -0,0 +1,863 @@
|
||||
## 2024-05-17
|
||||
### Notable issues
|
||||
|
||||
- [Linux][Web]: Bug while pressing Numeric Keypad keys [#148447](https://github.com/flutter/flutter/issues/148447)
|
||||
- [Web][HTML]: cursor offset is incorrect when typing CJK [#148271](https://github.com/flutter/flutter/issues/148271)
|
||||
- Software keyboard flickers when focus moves between TextFields [#148530](https://github.com/flutter/flutter/issues/148530)
|
||||
- Import app_localizations fails after build_runner [#148333](https://github.com/flutter/flutter/issues/148333)
|
||||
- Autofill Hints not populating in text fields on iOS with Flutter 3.22.0 [#148475](https://github.com/flutter/flutter/issues/148475)
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 154, closed 33 (21.43%).
|
||||
|
||||
In total closed 79 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 23% |
|
||||
| Fixed | 32% |
|
||||
| Invalid | 25% |
|
||||
| Solved | 20% |
|
||||
|
||||
Issues closed due to inactivity: 28
|
||||
|
||||
Size of backlog: 94
|
||||
|
||||
## 2024-05-10
|
||||
### Notable issues
|
||||
|
||||
No major issues to be reported for this week.
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 102, closed 30 (29.41%).
|
||||
|
||||
In total closed 72 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 22% |
|
||||
| Fixed | 24% |
|
||||
| Invalid | 39% |
|
||||
| Solved | 15% |
|
||||
|
||||
Issues closed due to inactivity: 18
|
||||
|
||||
|
||||
|
||||
## 2024-05-03
|
||||
### Notable issues
|
||||
|
||||
No major issues to be reported for this week.
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 134, closed 49 (36.57%).
|
||||
|
||||
In total closed 95 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 28% |
|
||||
| Fixed | 34% |
|
||||
| Invalid | 21% |
|
||||
| Solved | 17% |
|
||||
|
||||
Issues closed due to inactivity: 32
|
||||
|
||||
Size of backlog: 89
|
||||
|
||||
|
||||
## 2024-04-26
|
||||
### Notable issues
|
||||
|
||||
- Text selection magnifier freezes, causing the TextField to prevent input after closing the keyboard on the iPad [#145751](https://github.com/flutter/flutter/issues/145751)
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 127, closed 37 (29.13%).
|
||||
|
||||
In total closed 83 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 28% |
|
||||
| Fixed | 34% |
|
||||
| Invalid | 20% |
|
||||
| Solved | 18% |
|
||||
|
||||
Issues closed due to inactivity: 20
|
||||
|
||||
Size of backlog: 88
|
||||
|
||||
## 2024-04-19
|
||||
### Notable issues
|
||||
|
||||
- TextField Becomes Unresponsive After Using back swipe Gesture [#146844](https://github.com/flutter/flutter/issues/146844)
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 127, closed 40 (31.5%).
|
||||
|
||||
In total closed 78 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 32% |
|
||||
| Fixed | 28% |
|
||||
| Invalid | 28% |
|
||||
| Solved | 12% |
|
||||
|
||||
Issues closed due to inactivity: 20
|
||||
|
||||
Size of backlog: 73
|
||||
|
||||
## 2024-04-12
|
||||
### Notable issues
|
||||
|
||||
- [Web][HTML] Hovering the cursor over Arabic characters causes an ArgumentError [#146588](https://github.com/flutter/flutter/issues/146588)
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 112, closed 35 (31.25%).
|
||||
|
||||
In total closed 87 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 22% |
|
||||
| Fixed | 31% |
|
||||
| Invalid | 30% |
|
||||
| Solved | 17% |
|
||||
|
||||
Issues closed due to inactivity: 34
|
||||
|
||||
Size of backlog: 75
|
||||
|
||||
## 2024-04-05
|
||||
|
||||
### Notable issues
|
||||
|
||||
- [webview_flutter] [iOS] WebviewWidget lost drag response, when some widgets on it use Stack layout [#121960](https://github.com/flutter/flutter/issues/121960). Some users are reporting this as affecting their development workflow.
|
||||
- Shadow animation using Impeller causing rendering issues [#145969](https://github.com/flutter/flutter/issues/145969). This regressed in 3.19.4, it was fine in 3.19.0 up until 3.19.3
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 121, closed 37 (30.58%).
|
||||
|
||||
In total closed 101 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 27% |
|
||||
| Fixed | 37% |
|
||||
| Invalid | 27% |
|
||||
| Solved | 14% |
|
||||
|
||||
Issues closed due to inactivity: 23
|
||||
|
||||
Size of backlog: 87
|
||||
|
||||
## 2024-03-29
|
||||
### Notable issues
|
||||
|
||||
- Regression: Severe performance regression on Firefox in v.3.19 (https://github.com/flutter/flutter/issues/145563)
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 148, closed 36 (24.32%).
|
||||
|
||||
In total closed 90 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 36% |
|
||||
| Fixed | 36% |
|
||||
| Invalid | 14% |
|
||||
| Solved | 14% |
|
||||
|
||||
Issues closed due to inactivity: 20
|
||||
|
||||
Size of backlog: 59
|
||||
|
||||
## 2024-03-22
|
||||
### Notable issues
|
||||
|
||||
No major issues to report this week
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 143, closed 46 (32.17%).
|
||||
|
||||
In total closed 97 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 31% |
|
||||
| Fixed | 29% |
|
||||
| Invalid | 27% |
|
||||
| Solved | 13% |
|
||||
|
||||
Issues closed due to inactivity: 34
|
||||
|
||||
Size of backlog: 86
|
||||
|
||||
## 2024-03-15
|
||||
### Notable issues
|
||||
|
||||
- Regression: Pointer position shifts in scaled Platform Views in Flutter 3.19.[(https://github.com/flutter/flutter/issues/144278)](https://github.com/flutter/flutter/issues/144278)).
|
||||
- Regression: Navigator.Pop cause most recent focus node to regain focus even if not focused when new page was opened (https://github.com/flutter/flutter/issues/145155)
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 133, closed 43 (32.33%).
|
||||
|
||||
In total closed 86 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 29% |
|
||||
| Fixed | 30% |
|
||||
| Invalid | 27% |
|
||||
| Solved | 12% |
|
||||
|
||||
Issues closed due to inactivity: 21
|
||||
|
||||
Size of backlog: 82
|
||||
|
||||
|
||||
|
||||
## 2024-03-08
|
||||
### Notable issues
|
||||
|
||||
- Integration test TimeoutException after 0:12:00.000000: Test timed out after 12 minutes. [#105913](https://github.com/flutter/flutter/issues/105913). It appears more people are experiencing this issue.
|
||||
- DropdownMenu experiences screen jitter issues when used within TabBarView alongside nested navigation [#139113](https://github.com/flutter/flutter/issues/139113) Some users would like to know the status of this issue.
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 147, closed 55 (37.41%).
|
||||
|
||||
In total closed 92 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| ------------------ | --- |
|
||||
| Duplicate | 38% |
|
||||
| Fixed | 20% |
|
||||
| Invalid | 27% |
|
||||
| Solved | 15% |
|
||||
|
||||
Issues closed due to inactivity: 23
|
||||
|
||||
Size of backlog: 86
|
||||
|
||||
## 2024-03-01
|
||||
### Notable issues
|
||||
|
||||
- [Impeller] CupertinoDatePicker might cause text on screen to glitch. [#144331](https://github.com/flutter/flutter/issues/144331)
|
||||
- Font weight is too light in light mode and too heavy in dark mode [#120857](https://github.com/flutter/flutter/issues/120857).
|
||||
Some users are requesting that this be looked at again and re-prioritized (with a higher priority) if possible.
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 143, closed 39 (23.17%).
|
||||
|
||||
In total closed 85 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| Duplicate | 22.4% |
|
||||
| Fixed | 36.5% |
|
||||
| Invalid | 32.9% |
|
||||
| Solved | 8.2% |
|
||||
|
||||
Issues closed due to inactivity: 20
|
||||
|
||||
Size of backlog: 80
|
||||
|
||||
#### Flutter/website
|
||||
|
||||
New website issues triaged 9, closed 0 (0%)
|
||||
|
||||
In total closed 1 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| invalid | 100% |
|
||||
|
||||
#### dart-lang/site-www
|
||||
|
||||
New dart-lang/site-www issues triaged 4, closed 0 (0%)
|
||||
|
||||
No issues closed during the week.
|
||||
|
||||
#### Flutterfire
|
||||
|
||||
New Flutterfire issues triaged 14, closed 2 (27.27%).
|
||||
|
||||
In total closed 24 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| fixed | 33.3% |
|
||||
| duplicate | 12.5% |
|
||||
| invalid | 16.7% |
|
||||
| no-response | 16.7% |
|
||||
| solution-provided | 8.3% |
|
||||
| user issue | 4.2% |
|
||||
|
||||
#### FirebaseUI-Flutter
|
||||
|
||||
New FirebaseUI-Flutter issues triaged 1, closed 0 (0%).
|
||||
|
||||
In total, closed 0 issues during the week
|
||||
|
||||
|
||||
## 2024-02-23
|
||||
### Notable issues
|
||||
|
||||
Resizing FlutterView in android create a flicker [#143051](https://github.com/flutter/flutter/issues/143051)
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 149, closed 50 (33.56%).
|
||||
|
||||
In total closed 92 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| Duplicate | 28.26% |
|
||||
| Fixed | 23.91% |
|
||||
| Invalid | 30.43% |
|
||||
| Solved | 17.39% |
|
||||
|
||||
Issues closed due to inactivity: 16
|
||||
|
||||
Size of backlog: 76
|
||||
|
||||
#### Flutter/website
|
||||
|
||||
New website issues triaged 5, closed 0 (0%)
|
||||
|
||||
In total closed 4 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| fixed | 100.00% |
|
||||
|
||||
#### dart-lang/site-www
|
||||
|
||||
New dart-lang/site-www issues triaged 8, closed 2 (25.00%)
|
||||
|
||||
No issues closed during the week.
|
||||
|
||||
#### Flutterfire
|
||||
|
||||
New Flutterfire issues triaged 22, closed 7 (31.82%).
|
||||
|
||||
In total closed 16 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| solution-provided | 18.75% |
|
||||
| no-response | 25.00% |
|
||||
| invalid | 25.00% |
|
||||
| duplicate | 12.50% |
|
||||
|
||||
#### FirebaseUI-Flutter
|
||||
|
||||
New FirebaseUI-Flutter issues triaged 2, closed 1 (50%).
|
||||
|
||||
In total closed 2 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| duplicate | 50.00% |
|
||||
| fixed | 50.00% |
|
||||
|
||||
|
||||
## 2024-02-16
|
||||
### Notable issues
|
||||
|
||||
No major issues to report for this week
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 83, closed 20 (24.1%).
|
||||
|
||||
In total closed 94 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| Duplicate | 13.83% |
|
||||
| Fixed | 50.00% |
|
||||
| Invalid | 21.28% |
|
||||
| Solved | 14.89% |
|
||||
|
||||
Issues closed due to inactivity: 27
|
||||
|
||||
Size of backlog: 67
|
||||
|
||||
#### Flutter/website
|
||||
|
||||
New website issues triaged 7, closed 2 (28.57%)
|
||||
|
||||
In total closed 2 issue during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| invalid | 50.00% |
|
||||
| duplicate | 50.00% |
|
||||
|
||||
#### dart-lang/site-www
|
||||
|
||||
New dart-lang/site-www issues triaged 2, closed 1 (50.00%)
|
||||
|
||||
No issues closed during the week.
|
||||
|
||||
#### Flutterfire
|
||||
|
||||
New Flutterfire issues triaged 14, closed 3 (21.43%).
|
||||
|
||||
In total closed 12 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| user | 8.33% |
|
||||
| no-response | 58.33% |
|
||||
| invalid | 16.67% |
|
||||
| duplicate | 16.67% |
|
||||
|
||||
#### FirebaseUI-Flutter
|
||||
|
||||
New FirebaseUI-Flutter issues triaged 0, closed 0 (0%).
|
||||
|
||||
No issues closed during the week.
|
||||
|
||||
|
||||
## 2024-02-09
|
||||
### Notable issues
|
||||
|
||||
Cupertino icons are misaligned in latest beta [#143069](https://github.com/flutter/flutter/issues/143069)
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 138, closed 43 (31.16%).
|
||||
|
||||
In total closed 97 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| Duplicate | 35.05% |
|
||||
| Fixed | 30.93% |
|
||||
| Invalid | 22.68% |
|
||||
| Solved | 11.34% |
|
||||
|
||||
Issues closed due to inactivity: 35
|
||||
|
||||
Size of backlog: 81
|
||||
|
||||
#### Flutter/website
|
||||
|
||||
New website issues triaged 3, closed 1 (33.33%)
|
||||
|
||||
In total closed 1 issue during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| invalid | 100% |
|
||||
|
||||
#### dart-lang/site-www
|
||||
|
||||
New dart-lang/site-www issues triaged 1, closed 0 (0%)
|
||||
|
||||
No issues closed during the week.
|
||||
|
||||
#### Flutterfire
|
||||
|
||||
New Flutterfire issues triaged 16, closed 2 (12.5%).
|
||||
|
||||
In total closed 19 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| user | 10.53% |
|
||||
| fixed | 52.63% |
|
||||
| no-response | 21.05% |
|
||||
| solution-provided | 5.26% |
|
||||
| duplicate | 10.53% |
|
||||
|
||||
#### FirebaseUI-Flutter
|
||||
|
||||
New FirebaseUI-Flutter issues triaged 3, closed 0 (0%).
|
||||
|
||||
In total closed 2 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| no-response | 50.00% |
|
||||
| solution-provided | 50.00% |
|
||||
|
||||
|
||||
## 2024-02-02
|
||||
### Notable issues
|
||||
|
||||
No major issues to report for this week
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 140, closed 32 (22.86%).
|
||||
|
||||
In total closed 90 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| Duplicate | 22.22% |
|
||||
| Fixed | 37.78% |
|
||||
| Invalid | 20.00% |
|
||||
| Solved | 20.00% |
|
||||
|
||||
Issues closed due to inactivity: 25
|
||||
|
||||
Size of backlog: 101
|
||||
|
||||
#### Flutter/website
|
||||
|
||||
New website issues triaged 4, closed 0 (0%)
|
||||
|
||||
In total closed 3 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| fixed | 100% |
|
||||
|
||||
#### dart-lang/site-www
|
||||
|
||||
New dart-lang/site-www issues triaged 2, closed 0 (0%)
|
||||
|
||||
No issues closed during the week.
|
||||
|
||||
#### Flutterfire
|
||||
|
||||
New Flutterfire issues triaged 27, closed 1 (3.7%).
|
||||
|
||||
In total closed 14 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| user | 14.29% |
|
||||
| fixed | 57.14% |
|
||||
| no-response | 21.43% |
|
||||
| solution-provided | 7.14% |
|
||||
|
||||
#### FirebaseUI-Flutter
|
||||
|
||||
New FirebaseUI-Flutter issues triaged 2, closed 1 (50%).
|
||||
|
||||
In total closed 1 issue during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| duplicate | 100.00% |
|
||||
|
||||
## 2024-01-26
|
||||
### Notable issues
|
||||
|
||||
* [go_router_builder] universal link is not working with generated routes [#140909](https://github.com/flutter/flutter/issues/140909)
|
||||
* iOS 15+ save password prompt dismiss is pushing UI up and down [#112281](https://github.com/flutter/flutter/issues/112281)
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 133, closed 32 (24.06%).
|
||||
|
||||
In total closed 91 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| Duplicate | 27.47% |
|
||||
| Fixed | 39.56% |
|
||||
| Invalid | 20.88% |
|
||||
| Solved | 12.09% |
|
||||
|
||||
Issues closed due to inactivity: 29
|
||||
|
||||
Size of backlog: 109
|
||||
|
||||
#### Flutter/website
|
||||
|
||||
New website issues triaged 3, closed 0 (0%)
|
||||
|
||||
In total closed 2 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| fixed | 100% |
|
||||
|
||||
#### dart-lang/site-www
|
||||
|
||||
New dart-lang/site-www issues triaged 0, closed 0 (0%)
|
||||
|
||||
No issues closed during the week.
|
||||
|
||||
#### Flutterfire
|
||||
|
||||
New Flutterfire issues triaged 19, closed 3 (15.79%).
|
||||
|
||||
In total closed 16 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| user | 12.50% |
|
||||
| fixed | 12.50% |
|
||||
| no-response | 43.75% |
|
||||
| invalid | 18.75% |
|
||||
| solution-provided | 6.25% |
|
||||
| duplicate | 6.25% |
|
||||
|
||||
#### FirebaseUI-Flutter
|
||||
|
||||
New FirebaseUI-Flutter issues triaged 2, closed 0 (0%).
|
||||
|
||||
In total closed 1 issue during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| user | 100.00% |
|
||||
|
||||
|
||||
## 2024-01-19
|
||||
### Notable issues
|
||||
|
||||
* [Android][iOS] Builds generated on different machines have different sizes [#137990](https://github.com/flutter/flutter/issues/137990)
|
||||
* Textfield vertical alignment center off with outline input border [#124852](https://github.com/flutter/flutter/issues/124852)
|
||||
* [web] Flutter web hot restart not reflecting changes[#141588]( https://github.com/flutter/flutter/issues/141588)
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 133, closed 37 (27.82%).
|
||||
|
||||
In total closed 90 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| Duplicate | 26.67% |
|
||||
| Fixed | 30.00% |
|
||||
| Invalid | 23.33% |
|
||||
| Solved | 20.00% |
|
||||
|
||||
Issues closed due to inactivity: 10
|
||||
|
||||
Size of backlog: 122
|
||||
|
||||
#### Flutter/website
|
||||
|
||||
New website issues triaged 4, closed 2 (50%)
|
||||
|
||||
In total closed 2 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| duplicate | 100% |
|
||||
|
||||
#### dart-lang/site-www
|
||||
|
||||
New dart-lang/site-www issues triaged 3, closed 0 (0%)
|
||||
|
||||
No issues closed during the week.
|
||||
|
||||
#### Flutterfire
|
||||
|
||||
New Flutterfire issues triaged 8, closed 1 (12.50%).
|
||||
|
||||
In total closed 20 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| user | 10.00% |
|
||||
| fixed | 25.00% |
|
||||
| no-response | 10.00% |
|
||||
| invalid | 10.00% |
|
||||
| solution-provided | 40.00% |
|
||||
| duplicate | 5.00% |
|
||||
|
||||
#### FirebaseUI-Flutter
|
||||
|
||||
New FirebaseUI-Flutter issues triaged 0, closed 0 (0%).
|
||||
|
||||
In total closed 2 issue during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| no-response | 100.00% |
|
||||
|
||||
|
||||
## 2024-01-12
|
||||
### Notable issues
|
||||
|
||||
No major issues to report for this week
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 146, closed 29 (19.86%).
|
||||
|
||||
In total closed 69 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| Duplicate | 27.54% |
|
||||
| Fixed | 36.23% |
|
||||
| Invalid | 26.09% |
|
||||
| Solved | 10.14% |
|
||||
|
||||
Issues closed due to inactivity: 20
|
||||
|
||||
Size of backlog: 102
|
||||
|
||||
#### Flutter/website
|
||||
|
||||
New website issues triaged 10, closed 2 (20%)
|
||||
|
||||
In total closed 4 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| fixed | 50.00% |
|
||||
| duplicate | 25.00% |
|
||||
| invalid | 25.00% |
|
||||
|
||||
#### dart-lang/site-www
|
||||
|
||||
New dart-lang/site-www issues triaged 0, closed 0 (0%)
|
||||
|
||||
No issues closed during the week.
|
||||
|
||||
#### Flutterfire
|
||||
|
||||
New Flutterfire issues triaged 23, closed 6 (26.09%).
|
||||
|
||||
In total closed 26 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| user | 7.69% |
|
||||
| fixed | 11.54% |
|
||||
| no-response | 26.92% |
|
||||
| invalid | 15.38% |
|
||||
| solution-provided | 30.77% |
|
||||
| duplicate | 3.85% |
|
||||
| wontfix | 3.85% |
|
||||
|
||||
#### FirebaseUI-Flutter
|
||||
|
||||
New FirebaseUI-Flutter issues triaged 4, closed 1 (25.00%).
|
||||
|
||||
In total closed 1 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| fixed | 100.00% |
|
||||
|
||||
|
||||
## 2024-01-05
|
||||
### Notable issues
|
||||
|
||||
No major issues to report for this week
|
||||
|
||||
### Issue counts
|
||||
|
||||
#### Flutter
|
||||
|
||||
New Flutter issues triaged 110, closed 37 (33.64%).
|
||||
|
||||
In total closed 84 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| Duplicate | 34.52% |
|
||||
| Fixed | 27.38% |
|
||||
| Invalid | 21.43% |
|
||||
| Solved | 16.67% |
|
||||
|
||||
Issues closed due to inactivity: 39
|
||||
|
||||
Size of backlog: 91
|
||||
|
||||
#### Flutter/website
|
||||
|
||||
New website issues triaged 6, closed 1 (16.67%)
|
||||
|
||||
In total closed 6 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| fixed | 83.33% |
|
||||
| duplicate | 16.67% |
|
||||
|
||||
#### dart-lang/site-www
|
||||
|
||||
New dart-lang/site-www issues triaged 1, closed 0 (0%)
|
||||
|
||||
No issues closed during the week.
|
||||
|
||||
#### Flutterfire
|
||||
|
||||
New Flutterfire issues triaged 18, closed 2 (11.11%).
|
||||
|
||||
In total closed 39 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| user | 17.95% |
|
||||
| fixed | 30.77% |
|
||||
| no-response | 17.95% |
|
||||
| invalid | 12.82% |
|
||||
| solution-provided | 12.82% |
|
||||
| duplicate | 7.69% |
|
||||
|
||||
#### FirebaseUI-Flutter
|
||||
|
||||
New FirebaseUI-Flutter issues triaged 5, closed 0 (0%).
|
||||
|
||||
In total closed 4 issues during the week.
|
||||
|
||||
| Reason for closing | |
|
||||
| -- | -- |
|
||||
| fixed | 50.00% |
|
||||
| solution-provided | 50.00% |
|
||||
14
docs/unsorted_wiki/Accessibility-on-Windows.md
Normal file
14
docs/unsorted_wiki/Accessibility-on-Windows.md
Normal file
@@ -0,0 +1,14 @@
|
||||
## Microsoft Active Accessibility
|
||||
|
||||
Microsoft Active Accessibility (MSAA) is an older interface used for accessibility. It can interact with screen readers such as Windows Narrator or NVDA, and has a more limited set of available functionality compared to newer interfaces.
|
||||
The base of MSAA is the `IAccessible` interface, which all a11y-providing classes extend. MSAA methods are prefixed with `acc_`. In the Flutter engine, `AXPlatformNodeWin` extends `IAccessible`. Any `IAccessible` objects used are COM interfaces, and should be initialized and reference counted accordingly.
|
||||
When a program such a screen reader queries an application for an a11y object, it sends a `WM_GETOBJECT` window message, to which the window will respond with the result of passing the `IAccessible` of its root to the function `LresultFromObject`.
|
||||
|
||||
## UI Automation
|
||||
|
||||
UI Automation is one framework for Windows that is used for accessibility, for example, by screen readers such as Windows Narrator or NVDA. The interface class `IRawElementProviderFragment` must be implemented by any object representing a UIA fragment, i.e. an accessibility item that exists on the screen, such as a text label, a pane, a button, etc.. For the Flutter engine, the class `AXPlatformNodeWin` extends `IRawElementProviderFragment` in order to serve this purpose. Abstract methods in `IRawElementProviderFragment` provide functionality including retrieving the bounds of the fragment on screen, testing if an on-screen point is within the fragment, and retrieving properties of the fragment such as name and role. Each of the methods of `IRawElementProviderFragment` implemented by `AXPlatformNodeWin` are listed in `ax_platform_node_win.h`. Additionally, `IRawElementProviderFragment` contains a method that returns the fragment root of the fragment.
|
||||
The fragment root represents the root of a fragment tree, and extends the class `IRawElementProviderFragmentRoot`. Generally, and in the case of Flutter, these correspond 1-1 to a window. We extend this class in `AXFragmentRootPlatformNodeWin` in ax_fragment_root_win.cc. This class contains methods to retrieve the fragment at a given point, and the current focus of the tree.
|
||||
The Window class’s `OnGetObject` handles WM_GETOBJECT window messages, which a screen reader will dispatch to access the UIA fragment tree. When the `lparam` parameter of the message is equal to the constant `UiaRootObjectId`, the request is asking for the UIA root, and a reference is created out of the window’s fragment root with `UiaReturnRawElementProvider`, which is then returned to the message sender.
|
||||
Patterns are optional interfaces which UIA elements can provide for additional functionality. For example, providing the `ITextProvider` allows a fragment to be treated as formatted text, and `IToggleProvider` indicates that a fragment can be toggled (e.g. a checkbox) and provides its current toggle state (i.e. on, off, mixed). The UIA method `GetPatternProvider` is used to return an instance of a requested interface type, or none if it is not provided. Provided patterns may or may not be the same as the fragment itself. For example, in `AXPlatformNodeWin`, when `IToggleProvider` is requested, a casted pointer to the node is returned, as `AXPlatformNodeWin` extends `IToggleProvider`. By contrast, when an `ITextProvider` is requested, a separate object is returned, rather than `AXPlatformNodeWin` being a subclass of `ITextProvider`. In this case, this is necessary, as other inherited methods of `AXPlatformNodeWin` share a name but different signature to those in `ITextProvider`, so it cannot extend both.
|
||||
|
||||
Whether or not the engine makes use of UI Automation is controlled in the `Window` class, in `Window::OnGetObject`. When a UIA message is received, a UIA response is only issued if the engine was built with the `FLUTTER_ENGINE_USE_UIA` macro defined.
|
||||
3
docs/unsorted_wiki/Add-Flutter-to-existing-apps.md
Normal file
3
docs/unsorted_wiki/Add-Flutter-to-existing-apps.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## Moved
|
||||
|
||||
Add-to-app is now released with Flutter v1.12. The updated documentations are at [https://flutter.dev/docs/development/add-to-app/](https://flutter.dev/docs/development/add-to-app/)
|
||||
19
docs/unsorted_wiki/Adding-a-new-Test-Shard.md
Normal file
19
docs/unsorted_wiki/Adding-a-new-Test-Shard.md
Normal file
@@ -0,0 +1,19 @@
|
||||
Further documentation on Flutter's build infrastructure can be found in <https://github.com/flutter/flutter/blob/master/dev/bots/README.md>.
|
||||
|
||||
## Requirements for a Flutter/LUCI build
|
||||
|
||||
A general outline of the requirements that a Flutter CI test shard has:
|
||||
|
||||
1. On LUCI, test shards map to builders. Each test shard must have its own LUCI builder. For the Framework, these are defined in [framework_config.star](https://flutter.googlesource.com/infra/+/refs/heads/main/config/framework_config.star). Generally you will need to have both a pre-submit ("try" in LUCI terminology) builder and a post-submit ("prod") builder.
|
||||
1. This LUCI builder will specify a "recipe" to run. These are [starlark](https://github.com/bazelbuild/starlark) scripts that determine the actual CI steps to run, and are defined in [flutter.googlesource.com/recipes](https://flutter.googlesource.com/recipes). Most Framework tests use the [flutter/flutter_drone.py](https://flutter.googlesource.com/recipes/+/refs/heads/master/recipes/flutter/flutter_drone.py) recipe. To learn how to edit these, see <https://github.com/flutter/flutter/blob/master/dev/bots/README.md#editing-a-recipe>.
|
||||
1. Builders are then added to [.ci.yaml](https://github.com/flutter/flutter/blob/master/.ci.yaml). These files are read by [Flutter's build dashboard](https://flutter-dashboard.appspot.com/#/build), and are used for scheduling builds.
|
||||
|
||||
## Steps to add a new Framework Test Shard
|
||||
|
||||
It is important to land these changes in order to prevent any failing builds during the migration period:
|
||||
|
||||
1. Framework tests are run by a Dart test runner called [test.dart](https://github.com/flutter/flutter/blob/master/dev/bots/test.dart) that lives in the framework repository. Any new test shards must first be added to this file. Merge this framework change. Note that sharding an existing test doesn't need to update test.dart.
|
||||
1. Update [.ci.yaml](https://github.com/flutter/flutter/blob/master/.ci.yaml) in the Framework tree to include the newly added builder following [CI_YAML.md](https://github.com/flutter/cocoon/blob/main/CI_YAML.md#adding-new-targets). Ensure that the "shard" and "subshard"/"subshards" properties match what was added to test.dart in the previous step. Verify that the entry is marked as `bringup: true`. New shards should always be marked in bringup to verify they are passing on master before being able to block the tree. Merge this change. Note that the new shard will not run in presubmit at this point as the target is with `bringup: true`.
|
||||
1. Monitor the CI results of the new shard on the [Flutter build dashboard](https://flutter-dashboard.appspot.com/#/build). After 50 consecutive passing builds without any flakes, the flake bot will create a PR to remove the `bringup: true` parameter from `.ci.yaml` in the Framework tree. This will allow the test to block the tree, preventing breakages. With this change, the new shard will start running in presubmit automatically, unless specify `presubmit: false`. Note the flake bot runs once a week on Weds.
|
||||
|
||||
Note: if a new post-submit target is renamed from an existing target, there is no need to follow the bringup process.
|
||||
15
docs/unsorted_wiki/Android-Multidex-support.md
Normal file
15
docs/unsorted_wiki/Android-Multidex-support.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Dex Overview
|
||||
|
||||
Android apps are compiled into .dex (dalvik executable) files that run on the Dalvik virtual machine. Before Android API 21, apps compiled into a single .dex file, which has the limitation of only supporting 64k method names. This means that larger apps frequently exceed this limit, thus requiring enabling "Multidex" support (see [https://android-doc.github.io/tools/building/multidex.html](https://android-doc.github.io/tools/building/multidex.html) for more details).
|
||||
|
||||
In Flutter applications, it is easy to exceed the single dex limit primarily through using plugins. Thus, even small apps may occasionally exceed the limit by importing a full suite of standard Google plugins. Even though unused methods are stripped from releases, the dex limit can still prevent apps from building.
|
||||
|
||||
# Multidex support
|
||||
|
||||
Flutter supports automatic multidex error detection and support for apps targeting API 20 and below. When apps fail to build due to the multidex error, Flutter will automatically prompt the user if multidex support should be enabled. Answering yes will add support and subsequent builds in the future will build with multidex support enabled.
|
||||
|
||||
You may pass the `--no-multidex` flag to temporarily disable multidex support during a build.
|
||||
|
||||
# API 21+
|
||||
|
||||
Apps that target API 21+ devices already have multidex natively supported. However, we do not recommend targeting API 21+ purely to resolve the multidex issue as this may inadvertently exclude potential users running older devices.
|
||||
89
docs/unsorted_wiki/Android-Platform-Views.md
Normal file
89
docs/unsorted_wiki/Android-Platform-Views.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# Background
|
||||
|
||||
Flutter UIs function conceptually similar to a WebView on Android. The
|
||||
Flutter Framework takes a widget tree described by the app developer and
|
||||
translates that into an internal widget hierarchy, and then from that decides
|
||||
what pixels to actually render. Web developers can think of this as analogous
|
||||
to how a browser takes HTML/CSS, creates a Document Object Model ("DOM"), and
|
||||
then uses that DOM to actually render pixels each frame. Also like a WebView,
|
||||
Flutter UIs aren't translated to a set of Android View widgets and composited
|
||||
by the Android OS itself. Flutter controls a texture (generally through a
|
||||
[SurfaceView](https://developer.android.com/reference/android/view/SurfaceView))
|
||||
and uses Skia to render directly to the texture without ever using any kind of
|
||||
Android View hierarchy to represent its internal Flutter widget hierarchy or
|
||||
UI.
|
||||
|
||||
This means that like a WebView, by default a Flutter UI could never contain
|
||||
an Android View within its widget hierarchy. Since the Flutter UI is just
|
||||
being drawn to a texture and its widget tree is entirely internal, there's no
|
||||
place for the View to "fit" within Flutter's internal model or render
|
||||
interleaved within Flutter widgets. That's a problem for developers that would
|
||||
like to include complex pre-existing Android views in their Flutter apps, like
|
||||
WebViews themselves, or maps.
|
||||
|
||||
To solve this problem Flutter created an [AndroidView
|
||||
widget](https://api.flutter.dev/flutter/widgets/AndroidView-class.html) that
|
||||
Flutter developers can use to visually embed actual Android View components
|
||||
within their Flutter UI.
|
||||
|
||||
# Approaches
|
||||
|
||||
There are currently three different implementations of Android platform views:
|
||||
- [[Virtual Display]] (VD)
|
||||
- [[Hybrid Composition]] (HC)
|
||||
- [[Texture Layer Hybrid Composition]] (TLHC)
|
||||
|
||||
Each has a different set of limitations and tradeoffs, as discussed below. The pages linked above give details about each implementation.
|
||||
|
||||
## Virtual Display
|
||||
|
||||
This mode works by rendering the platform view into [a `VirtualDisplay`](https://developer.android.com/reference/android/hardware/display/VirtualDisplay), whose contents are connected to [a Flutter `Texture`](https://api.flutter.dev/flutter/widgets/Texture-class.html).
|
||||
|
||||
Because this renders to a `Texture`, it integrates well into the Flutter drawing system. However, the use of `VirtualDisplay` introduces a number of compatibility issues, including with text input, accessibility, and secondary views (see [[the Virtual Display page|Virtual Display]] for details).
|
||||
|
||||
This display mode requires SDK 20 or later.
|
||||
|
||||
## Hybrid Composition
|
||||
|
||||
This mode directly displays the native Android [`View`](https://developer.android.com/reference/android/view/View) in the view hierarchy. This requires several significant changes to the way Flutter renders:
|
||||
- The Flutter widget tree is divided into two different Android `View`s, one below the platform view and one above it.
|
||||
- To avoid tearing or other visual artifacts, Flutter's composition must be done on the platform thread rather than a dedicated thread.
|
||||
|
||||
Because the native view is being displayed directly, just as it would be in non-Flutter application, this mode is the least likely to have compatibility issues with the platform view. However, the rendering changes can significantly impact Flutter's performance. In addition, on versions of Android before SDK 29 (Android 10) Flutter frames have a GPU->CPU->GPU round trip that further impacts performance.
|
||||
|
||||
This display mode requires SDK 19 or later, and uses the FlutterImageView based renderer.
|
||||
|
||||
## Texture Layer Hybrid Composition
|
||||
|
||||
This mode, introduced in Flutter 3.0, attempted to address the limitations of the modes above, and was originally intended to replace both. Like Hybrid Composition, the view is actually placed on the screen at the correct location. However, as with Virtual Display the drawing uses a `Texture`, which in this case is populated by redirecting [`draw`](https://developer.android.com/reference/android/view/View#draw(android.graphics.Canvas)).
|
||||
|
||||
In most cases this combines the best aspects of Virtual Display and Hybrid Composition, and should be preferred when possible. One notable exception however is that if the platform view is, or contains, a [`SurfaceView`](https://developer.android.com/reference/android/view/SurfaceView) this mode will not work correctly, and the `SurfaceView` will be drawn at the wrong location and/or z-index.
|
||||
|
||||
This display mode requires SDK 23 or later.
|
||||
|
||||
# Selecting a mode
|
||||
|
||||
Usually Android platform views are created with one of the `init*` methods:
|
||||
- `initAndroidView` creates a [`TextureAndroidViewController`](https://api.flutter.dev/flutter/services/TextureAndroidViewController-class.html), which will use TLHC mode if possible, and fall back to VD if not. The fallback is triggered if:
|
||||
- the current SDK version is <23, or
|
||||
- the platform view hierarchy contains a `SurfaceView` (or subclass) **at creation time**.
|
||||
|
||||
There is [a known issue](https://github.com/flutter/flutter/issues/109690) where if the view hierarchy does not contain a `SurfaceView` at creation time, but one is added later, rendering will not work correctly. Until that issue is resolved, plugin authors can work around this by either:
|
||||
- including a 0x0 `SurfaceView` in the view hierarchy at creation time, to trigger fallback to VD, or
|
||||
- switching to `initExpensiveAndroidView` to require HC.
|
||||
|
||||
(The behavior described above is for Flutter 3.3+. Flutter 3.0 did not include the fallback to VD, and in Flutter <3.0 this always used VD.)
|
||||
- `initSurfaceAndroidView` creates a [`SurfaceAndroidViewController`](https://api.flutter.dev/flutter/services/SurfaceAndroidViewController-class.html), which will use TLHC if possible, and fall back to HC if not. As above, the fallback is triggered if:
|
||||
- the current SDK version is <23, or
|
||||
- the platform view hierarchy contains a `SurfaceView` (or subclass) **at creation time**.
|
||||
|
||||
There is [a known issue](https://github.com/flutter/flutter/issues/109690) where if the view hierarchy does not contain a `SurfaceView` at creation time, but one is added later, rendering will not work correctly. Until that issue is resolved, plugin authors can work around this by either:
|
||||
- including a 0x0 `SurfaceView` in the view hierarchy at creation time, to trigger fallback to HC, or
|
||||
- switching to `initExpensiveAndroidView` to require HC directly.
|
||||
|
||||
(The behavior described above is for Flutter 3.7+. In Flutter 3.0 and 3.0 this behaved identically to `initAndroidView`, and in Flutter <3.0 this always used HC.)
|
||||
- `initExpensiveAndroidView` creates an [`ExpensiveAndroidViewController`](https://api.flutter.dev/flutter/services/ExpensiveAndroidViewController-class.html), which will always use HC.
|
||||
|
||||
(This API was introduced in Flutter 3.0.)
|
||||
|
||||
In general, plugins will likely get the best performance by using `initAndroidView` or `initSurfaceAndroidView` (depending on which fallback mode is desired for older versions of Android), and should only use `initExpensiveAndroidView` if the plugin is found to be incompatible with TLHC (such as dynamically adding a `SurfaceView`).
|
||||
66
docs/unsorted_wiki/Autorollers.md
Normal file
66
docs/unsorted_wiki/Autorollers.md
Normal file
@@ -0,0 +1,66 @@
|
||||
Several of our dependencies are automatically rolled (updated) by bots.
|
||||
|
||||
## Clang to Engine
|
||||
|
||||
We use an auto-roller for Clang on [Linux](https://autoroll.skia.org/r/clang-linux-flutter-engine) and [MacOS](https://autoroll.skia.org/r/clang-mac-flutter-engine) (Windows is pending availability of a Windows Clang package from the Fuchsia infra team). In case of build failures or other errors, ping the #hackers-engine channel on [Discord](https://github.com/flutter/flutter/wiki/Chat).
|
||||
|
||||
These rollers may fail if Clang catches a new compilation warning or error that it previously did not, or if a test relies on undefined behavior that has now changed in the new revision of Clang. It is best to resolve such issues ASAP to let the rollers continue and avoid a pile up of issues to resolve.
|
||||
|
||||
The rollers work by updating a [CIPD](https://chrome-infra-packages.appspot.com/p/fuchsia/third_party/clang/) package version in the DEPS file. You can map from a CIPD version to a git revision by checking in CIPD.
|
||||
|
||||
## Fuchsia SDK to Engine
|
||||
|
||||
We use an auto-roller for the Fuchsia SDK on [Linux](https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine) and [MacOS](https://autoroll.skia.org/r/fuchsia-mac-sdk-flutter-engine) (Windows is pending availability of a Windows Fuchsia SDK package from the Fuchsia infra team). In case of build failures or other errors, ping the #hackers-engine channel on [Discord](https://github.com/flutter/flutter/wiki/Chat).
|
||||
|
||||
These rollers may fail if the Fuchsia SDK contains a breaking change. It is best to resolve such issues ASAP to let the rollers continue and avoid a pile up of issues to resolve.
|
||||
|
||||
The rollers work by updating a [CIPD](https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/core) package version in the DEPS file. You can map from a CIPD version to a JIRI snapshot or a git revision by checking in CIPD.
|
||||
|
||||
## Skia to Engine
|
||||
|
||||
We use an auto-roller for Skia rolls. It's status can be viewed at <https://skia-flutter-roll.skia.org/>. In case of build failures or other errors, ping the Flutter-Skia chat channel. In case you get no response, you can login with an @google.com account and pause the roller (or ask someone with an @google.com account to do so). Please specify a descriptive reason and file a bug to re-enable the rollers as soon as possible.
|
||||
|
||||
The bot updates the `skia_revision` line of <https://github.com/flutter/engine/blob/master/DEPS>.
|
||||
|
||||
Skia also uses an auto-roller for Fuchsia; see <https://autoroll-internal.skia.org/r/fuchsia-autoroll>.
|
||||
|
||||
## Engine to Framework
|
||||
|
||||
The engine is automatically rolled to the framework. It is configured by <https://skia.googlesource.com/skia-autoroll-internal-config.git/+/main/skia-infra-public/flutter-engine-flutter.cfg>.
|
||||
|
||||
The bot updates <https://github.com/flutter/flutter/blob/master/bin/internal/engine.version> to point to the latest revision of the engine *whose artifacts built successfully*, as determined by looking at the [Engine Console](https://ci.chromium.org/p/flutter/g/engine/console).
|
||||
|
||||
|
||||
### Making a breaking change
|
||||
|
||||
Our [breaking change policy](https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes) disallows making changes to the engine that require changes to the framework. If you find the need to do this, you should instead make a soft-breaking change which you can land in multiple phases, as described in that process.
|
||||
|
||||
### Doing a manual roll
|
||||
|
||||
To roll the engine manually in the case you have a breaking change exemption, you'll need to land the change to `engine.version` manually in the same PR to the framework as the one where you fix the framework to work with the new API.
|
||||
|
||||
When you change the `engine.version` file locally, you should delete `$FLUTTER_ROOT/bin/cache` and then run `flutter precache` to ensure that all your local artifacts and snapshots are updated. You can then run tests and be sure that they are running against the latest version of the assets you need.
|
||||
|
||||
You may find it helpful to use the [`$ENGINE_ROOT/src/flutter/tools/engine_roll_pr_desc.sh`](https://github.com/flutter/engine/blob/master/tools/engine_roll_pr_desc.sh) to create a PR description. Doing this helps us track down what commits have rolled in more quickly, and properly link to other commits and pull requests for commenting and tracking.
|
||||
|
||||
For example, to generate a description from hash deadbeef to beefdead:
|
||||
|
||||
```bash
|
||||
$ ./tools/engine_roll_pr_desc.sh deadbeef..beefdead
|
||||
```
|
||||
|
||||
_See also: [[Debugging the engine]], which includes instructions on bisecting a roll failure._
|
||||
|
||||
|
||||
## Dart to Engine
|
||||
|
||||
The Dart SDK is automatically rolled into the engine on a regular basis, following the steps laid out at the [Rolling Dart](https://github.com/flutter/flutter/wiki/Rolling-Dart) page. Since this process is a bit more involved, this autoroller does not use the Skia infrastructure and has a custom dashboard hosted at [go/dart-sdk-roller-dashboard](http://go/dart-sdk-roller-dashboard) (**note: this is likely only accessible from a machine on the Google network**). Using the dashboard, the autoroller can be paused, rolls can be triggered and cancelled, and rolls to a particular revision can be done.
|
||||
|
||||
If there are any issues with this process or the autoroller dashboard, contact bkonyi@ or a member of the Dart VM team.
|
||||
|
||||
## Flutter Pub Roller
|
||||
|
||||
The bot account [flutter-pub-roller-bot](https://github.com/flutter-pub-roller-bot) runs the script at
|
||||
https://github.com/flutter/flutter/blob/master/dev/conductor/bin/packages_autoroller on post-submit of
|
||||
every framework commit to keep the pub dependencies in the [framework](https://github.com/flutter/flutter)
|
||||
up to date.
|
||||
168
docs/unsorted_wiki/Autosubmit-bot.md
Normal file
168
docs/unsorted_wiki/Autosubmit-bot.md
Normal file
@@ -0,0 +1,168 @@
|
||||
# What is the Autosubmit Bot
|
||||
The Flutter autosubmit bot is a tool that helps developers submit changes to the Flutter codebase. It automates the process of validating pull requests, test validation, and merging changes. This frees up developers to focus on writing code, and makes it easier to contribute to the Flutter project.
|
||||
|
||||
# The Autosubmit Workflow
|
||||
## Submitting a Pull Request
|
||||
When a developer opens a pull request against any of the currently supported repositories, the cocoon backend will schedule tests and checks against that pull request. Rather than have the developer wait around to make sure all these tests and validations have completed, they can add a label and the Autosubmit bot will then queue that pull request for merge upon successfully passing all checks and validations. It will look something like this:
|
||||
|
||||
1. You have a change you would like to contribute to flutter so you open a pull request.
|
||||
2. Dozens of tests will start in the background against your changes.
|
||||
3. You can add the `autosubmit` label to notify the Autosubmit bot that you would like it to merge the pull request upon successful validation.
|
||||
4. If all validations are successful the Autosubmit bot will merge the pull request.
|
||||
|
||||
## What Validations does the Autosubmit Bot Perform
|
||||
### Code Reviews
|
||||
The following are the rules for code reviews:
|
||||
* If the author is a member of the GitHub `flutter-hackers` org then they will need **at least 1 other review** from a member of the `flutter-hackers` org, preferable a code owner from that repository.
|
||||
* If the author is not a member of the GitHub `flutter-hackers` org then they will need **at least 2 other reviews** from members of the `flutter-hackers` org.
|
||||
* If any reviewer requests changes then regardless of the number of approvals you have the pull request will not be merged by the Autosubmit bot and the `autosubmit` label will be removed until the reviewer who requested changes has approved the pull request.
|
||||
|
||||
### Check Runs and Statuses
|
||||
When a pull request is opened the Cocoon backend service will create a number of test runs that will be used to validate the code change that was submitted. Once the `autosubmit` label is added, the Autosubmit bot will check the statuses of those tests and will not merge the pull request until all of them have succeeded. If the any of the tests have failed the `autosubmit` label will be removed and the bot will no longer process that pull request. However the developer can re-trigger the test and add the label again to retry.
|
||||
|
||||
### Other Checks
|
||||
The Autosubmit bot will make several other checks to determine viability of the pull request up until the moment the pull request is queued for merge. They are:
|
||||
* merge-ability - this is a GitHub status that says the code can be merged into the mainline branch.
|
||||
* code conflicts - the bot will check for this and notify the author in the event conflicts happen before merging of the pull request.
|
||||
|
||||
## Submitting a Revert Request
|
||||
Autosubmit can also undo a change automatically simply by adding a label and a comment to a pull request. By adding the label 'revert' to a closed pull request the autosubmit bot will know to create a new request to revert this change and provide the specified reason in the body of the resulting revert request.
|
||||
|
||||
## Conditions on creating a Revert Request
|
||||
* The initiator of the revert request must be a member of the flutter-hackers team.
|
||||
* The pull request being targeted for revert must have been merged less than 24 hours ago.
|
||||
* The initiator of the revert must supply a reason for the revert. In order to do this they must add a comment that begins with 'Reason for revert:' and then supply a reason for the revert.
|
||||
|
||||
If an empty reason is supplied then the 'revert' label will be removed and a comment supplied that you must supply a reason.
|
||||
|
||||
# How it Works
|
||||
## Basic Design
|
||||
The Autosubmit bot is a service hosted within GCP that listens to GitHub's webhook events utilizing PubSub to store the messages it is interested in for further processing. A cron job calls the service every two minutes to look for new events from GitHub to see if any new pull requests need to be processed.
|
||||
|
||||
If an event contains a new pull request we look at it for the 'autosubmit' label. If the pull request is valid, i.e. it came from GitHub then we send it in a message to our PubSub topic.
|
||||
|
||||
A cron job will then call the Autosubmit service which will pull messages from the topic for processing and validation. If the pull request has passed the validations outlined above then the it will be merged and the PubSub message acknowledged. Autosubmit will no longer process that pull request.
|
||||
|
||||
{TODO add a diagram of the components}
|
||||
|
||||
## Configuration
|
||||
The Autosubmit bot gets its configuration from a configuration file in the Orgs `.github` repository, specifically at `.github/autosubmit/autosubmit.yml`. These configurations govern the validations that the Autosubmit will perform and can be updated on the fly. These configs can also be overridden in other repositories so that the configuration can be tuned according to the repositories code owners liking.
|
||||
|
||||
### Configuration Values
|
||||
| Config Name | Optional | Type | Default Value | Explanation |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `default_branch` | Yes | String | 'main' | the default branch of the repository where pull requests are merged into. This can be provided in the configuration but if it is not, the bot will collect this from a call to the Github API. |
|
||||
| `allow_config_override` | Yes | boolean | false | flag to allow specific repositories to override the values defined at the Org level for Autosubmit. See below. |
|
||||
| `auto_approval_accounts` | Yes | Array of String | [ ] | the accounts that can submit pull requests automatically with automatic review approval. The values here should be reserved for trusted entities such as dependabot or org created accounts. |
|
||||
| `approving_reviews` | Yes | integer | 2 | Integer, the number of reviews required before Auto-submit will merge a pull request upon approval. |
|
||||
| `approval_group` | No | String | | the group a pull request author must get approval from in order to merge their pull request into the repository. See the rules on Approvals above. |
|
||||
| `run_ci_checks` | Yes | boolean | true | a flag to determine whether or not to run target checks from ci.yaml or not. Not all repositories may want to do this initially. It is strongly recommended that this be set to True always. |
|
||||
| `support_no_review_revert` | Yes | boolean | true | flag to toggle condition of reviews required on revert requests. Flutter does not require an initial review but other repos may not want this. |
|
||||
| `required_checkruns_on_revert` | Yes | Array of String | [ ] | a list of check runs that Auto-submit will require to complete before merging a revert pull request regardless of what `support_no_review_revert` is set to. |
|
||||
|
||||
### Configuration File Examples
|
||||
Here is an example of a full Autosubmit bot configuration file:
|
||||
```
|
||||
default_branch: main
|
||||
allow_config_override: false
|
||||
auto_approval_accounts:
|
||||
- skia-flutter-autoroll
|
||||
- engine-flutter-autoroll
|
||||
- dependabot[bot]
|
||||
- dependabot
|
||||
- DartDevtoolWorkflowBot
|
||||
approving_reviews: 2
|
||||
approval_group: flutter-hackers
|
||||
run_ci: true
|
||||
support_no_review_revert: true
|
||||
required_checkruns_on_revert:
|
||||
- ci.yaml validation
|
||||
```
|
||||
|
||||
An example of the minimum configuration file
|
||||
```
|
||||
approval_group: flutter-hackers
|
||||
```
|
||||
|
||||
### Allowing Configuration Overrides
|
||||
All repositories within an Org need not follow the same rules. Some may want more Approvals for a review, some may not want to allow Reverts without a review. Autosubmit allows this by allowing an override configuration file to be defined in the repositories .github directory. This is different than the Org .github repository.
|
||||
|
||||
In order to override the configuration at the Org level, the `allow_config_override` flag must be set to `true`. This tells Autosubmit that it will need to look in the local repositories .github directory for an autosubmit.yml file. Specifically that file will need to be places here: `<repo>/.github/autosubmit/autosubmit.yml`.
|
||||
|
||||
The following rules will apply to override values:
|
||||
* Non array values will overwrite the Org level config.
|
||||
* Array values will be additive, meaning that anything specified in the local config will be 'in addition to' what is defined in the Org level config.
|
||||
* The number of approving reviews may not be set lower than what is defined in the Org level config.
|
||||
|
||||
An example of Config Override:
|
||||
|
||||
The Org level config is defined as follows:
|
||||
```
|
||||
allow_config_override: true
|
||||
auto_approval_accounts:
|
||||
- skia-flutter-autoroll
|
||||
- engine-flutter-autoroll
|
||||
approving_reviews: 2
|
||||
approval_group: flutter-hackers
|
||||
run_ci: true
|
||||
support_no_review_revert: true
|
||||
required_checkruns_on_revert:
|
||||
- ci.yaml validation
|
||||
```
|
||||
|
||||
At the repository level the team would like to add a few more accounts to the `auto_approval_accounts` for automation purposes and required 1 more review but also would like revert requests to require reviews. So the repository level config would define the new values as follows:
|
||||
```
|
||||
auto_approval_accounts:
|
||||
- dependabot[bot]
|
||||
- dependabot
|
||||
- DartDevtoolWorkflowBot
|
||||
approving_reviews: 3
|
||||
support_no_review_revert: false
|
||||
```
|
||||
|
||||
The final merged configuration for the repository would then become:
|
||||
```
|
||||
auto_approval_accounts:
|
||||
- skia-flutter-autoroll
|
||||
- engine-flutter-autoroll
|
||||
- dependabot[bot]
|
||||
- dependabot
|
||||
- DartDevtoolWorkflowBot
|
||||
approving_reviews: 3
|
||||
approval_group: flutter-hackers
|
||||
run_ci: true
|
||||
support_no_review_revert: false
|
||||
required_checkruns_on_revert:
|
||||
- ci.yaml validation
|
||||
```
|
||||
|
||||
# Where it Lives
|
||||
The code for the Autosubmit bot is part of the flutter infra tools and can be found here: https://github.com/flutter/cocoon
|
||||
|
||||
# Onboarding with Autosubmit {WIP}
|
||||
### Installing the Autosubmit App
|
||||
Currently the bot is not available from the Github marketplace so it is only available to support internal Google Repositories.
|
||||
In order to install the App you will need to:
|
||||
1. Open a request with the Flutter Infrastructure team and request 'Autosubmit Support for ORG/REPO' in the title.
|
||||
2. A Flutter Infrastructure Admin will then install the App on that repository so you must look out for a request from Autosubmit for the installation.
|
||||
3. Next the bot will need to be added as a Pusher to the repository it will be servicing. This is done in the Branch Protections section of the repository.
|
||||
|
||||
### Adding the Configuration
|
||||
After the app is installed you will need to place a configuration file into your ORGs .github repository. If you do not have one then you will need to create onc in your ORG level .github repository.
|
||||
|
||||
Once the repository is created then you will need to add the Autosubmit configuration file at .github/autosubmit/autosubmit.yml. This is the primary location that Autosubmit will check first for the configuration. Repositories in your ORG can override the ORG level configs by placing a configuration file at repo/.github/autosubmit/autosubmit.yml. See the section on [configuration](https://github.com/flutter/flutter/wiki/Autosubmit-bot#configuration) above on the fields you may want to include in your configuration.
|
||||
|
||||
Make sure that the App has read write access to the ORG level .github repository.
|
||||
|
||||
### Configuring the Repository
|
||||
In order for the Autosubmit bot to merge pull requests it will need write access on the repository and it will need to be added to the branch protection section on who can push to the repository.
|
||||
|
||||
An 'autosubmit' label will also need to be created for the supported repository. You can visit this [page](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels#creating-a-label) to view instructions on creating the label.
|
||||
|
||||
### Usage
|
||||
Once the Autosubmit app has been installed in the repository, the configuration has been added and the target repository has been configured for write access you are ready to utilize the Autosubmit bot. In order to use the Autosubmit on pull requests in the target repository, follow these steps:
|
||||
1. Open a pull request for review.
|
||||
2. Make sure the pull request has tests as the bot will warn about this.
|
||||
3. Get at least 1 other team member to review your pull request.
|
||||
4. Once you have a review add the 'autosubmit' label.
|
||||
5. Autosubmit will validate the pull request and if everything is okay it will automatically merge the pull request for you. No need to wait around to merge it!
|
||||
26
docs/unsorted_wiki/Bad-Builds.md
Normal file
26
docs/unsorted_wiki/Bad-Builds.md
Normal file
@@ -0,0 +1,26 @@
|
||||
## Flutter Bad Builds Triage Guidelines (for Googlers)
|
||||
|
||||
1. If you encounter a serious P0 flutter production Google3 or a github issue, triage the issue and check if the issue is already part of Flutter's bad build [tracker](http://go/flutter-bad-builds).
|
||||
If the issue is not listed in Flutter bad builds [tracker](http://go/flutter-bad-builds), check that it meets the below criteria to qualify for bad builds visibility -
|
||||
* A P0 bug
|
||||
* Can be in any component, Flutter’s component or Flutter user’s component
|
||||
* Must be a bug, not a feature request
|
||||
* Must affect end-users, not a regression on tooling, debugging features, infra etc
|
||||
* Issue must be open
|
||||
|
||||
2. If there is a buganizer for this already and no github issue, create a github bug in the github repo. Label the github bug with label _a: production_ and _customer: google_.
|
||||
|
||||
3. Add following information to Flutter bad builds visibility [tracker](http://go/flutter-bad-builds)
|
||||
* Issue create date - this can be either buganizer or github issue create date
|
||||
* Triaged by - your LDAP
|
||||
* Github issue id
|
||||
* Begin bad build commit hash URL (Commit hash URL can be from dart, engine, flutter and skia repos)
|
||||
* Impacted platform
|
||||
|
||||
3. Automation will take care of finding the corresponding begin bad build commit CL based on the begin bad build commit URL you entered. Automation will run once every 12 hrs
|
||||
|
||||
4. Contact the [Flutter@Google team on-call ](https://rotations.corp.google.com/rotation/5644450090975232) for more visibility into the issue. This will also help identify duplicates across github & Google3.
|
||||
|
||||
5. Once a fix has been merged, enter the “End bad build commit hash 1 URL”.
|
||||
|
||||
6. There are cases when a fix is merged as part of 2 different commits. In that case, you can use the “ End bad build commit hash 2 URL” column to populate the second commits hash information. Automation will take care of finding the corresponding End bad build commit CL based on the End bad build commit URL you entered.
|
||||
1
docs/unsorted_wiki/Binding-to-native-code-via-FFI.md
Normal file
1
docs/unsorted_wiki/Binding-to-native-code-via-FFI.md
Normal file
@@ -0,0 +1 @@
|
||||
Please see [Binding to native code using dart:ffi](https://flutter.dev/docs/development/platform-integration/c-interop) on [flutter.dev](https://flutter.dev/)
|
||||
74
docs/unsorted_wiki/Chat.md
Normal file
74
docs/unsorted_wiki/Chat.md
Normal file
@@ -0,0 +1,74 @@
|
||||
# Chatting on Discord
|
||||
|
||||
<img src="https://github.com/flutter/flutter/assets/551196/1381071b-e482-4e07-b096-60e9219d3ff7" width=300 align=right alt="">
|
||||
|
||||
The Flutter team uses a [Discord server](https://discord.com/channels/608014603317936148). [This is invite link for Flutter's Discord server](https://discord.gg/ht477J5PyH). Please do not share either link directly, instead share links to this page.
|
||||
|
||||
The server is open to the public, though some channels are intended only for people who are actively contributing. **See the #welcome channel for instructions on posting to the server (you won't be able to see the channels until you acknowledge the rules there).**
|
||||
|
||||
We recommend you use the same display name on Discord and GitHub.
|
||||
|
||||
(Our Flutter Discord server is unrelated to the [r/FlutterDev Discord server](https://www.reddit.com/r/FlutterDev/), which is where the r/FlutterDev community shares their apps, discusses Flutter, and so on. When in doubt, remember: our server has Dash as an icon!)
|
||||
|
||||
## Existing channels
|
||||
|
||||
We have different channels for different purposes (this list is not exhaustive):
|
||||
|
||||
| Channel | Description | Participants |
|
||||
| - | - | - |
|
||||
| #welcome | Welcome message. | Only admins can post.<br>Anyone can read.
|
||||
| #announcements | Flutter announcements (e.g. breaking changes). | Only team members can post (but not frequently).<br>Anyone can read.
|
||||
| #server-support | Forum for asking for your role to be changed, for code of conduct violations to be raised, and for other administrative issues. | Anyone.
|
||||
| #general | Chat about anything related to Flutter. | Anyone.
|
||||
| #help | People asking for our help. | Anyone.
|
||||
| #package-authors | For people who develop Flutter packages. | People writing packages for [pub.dev](https://pub.dev/).
|
||||
| #dart | Questions about the Dart language. | Anyone.
|
||||
| #tree-status | Announcements about whether the trees are open or closed. | Anyone, but discussion should happen elsewhere.
|
||||
| #hackers | Chat about anything related to Flutter. | Flutter contributors.<br>Anyone can watch.
|
||||
| #hackers-* | Chat specifically about foo, where foo is something to do with Flutter development, for example "engine", "framework", "desktop", "devtools", etc. | Flutter contributors.<br>Anyone can watch.
|
||||
| #hackers-dart | Questions about the Dart language. | Flutter contributors.<br>Anyone can watch.
|
||||
| #hackers-new | New people to the team and people who want to help them. | Flutter contributors.<br>Anyone can watch.
|
||||
| #hackers-triage | For use while triaging bugs. | Flutter contributors.<br>Anyone can watch.
|
||||
| #hidden-chat | Chat about anything related to Flutter. | Flutter contributors only.<br>Not public.
|
||||
| general (voice) | Talk (audio) about anything related to Flutter. | Anyone.
|
||||
| team (voice) | Talk (audio) that is only open to team members. | Flutter contributors.
|
||||
|
||||
The #hidden-chat and #team channels are not publicly-readable, you have to be a member of the "team member" role to see them.
|
||||
|
||||
## New channels
|
||||
|
||||
If you need a new channel, first just use #general or #hackers, or a thread in one of those channels; if the conversation lasts more than a day, ask for a channel in #server-support.
|
||||
|
||||
If you find your team's channel is hard to follow due to having too many topics discussed at once, ask for a new channel, or use threads.
|
||||
|
||||
If you would like a channel for subcommunities, e.g. #women or #china, that should be fine. (Subcommunities that are already overrepresented in the main channels, e.g. #english-speakers, are less likely to be good candidates for dedicated channels.)
|
||||
|
||||
For practical reasons, we do not use Discord for chat groups limited to specific customers. For example, if your company wants a private discussion channel with the Flutter team, we would not use Discord.
|
||||
|
||||
Each channel describes its topic in the channel description. Please read the channel description before posting in a channel, to make sure you're using the appropriate one.
|
||||
|
||||
## Policies
|
||||
|
||||
Our [code of conduct](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md) applies to the Discord server, as it does to any communications involving Flutter.
|
||||
|
||||
The #hackers-* channels are visible to anyone, but please only post in those channels if you are actively contributing. If you want help with your app, ask in #help instead. If you want to learn how to contribute, have a look at our [contributing guide](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md).
|
||||
|
||||
See the [[contributor access]] wiki page for details on becoming a member of the "team" role.
|
||||
|
||||
Please don't direct-message people unless they are comfortable with it (ask publicly first).
|
||||
You can disable direct messages on this server by changing your Privacy settings for the server, or on a global basis by changing your Privacy & Safety user settings.
|
||||
|
||||
## Discord features
|
||||
|
||||
### Threading
|
||||
|
||||
Discord has both actual threads (temporary new channels) and a threadingish feature called [Replies](https://support.discord.com/hc/en-us/articles/360057382374-Replies-FAQ) that lets you tie messages to earlier messages and notify the original commenter.
|
||||
|
||||
### Status
|
||||
|
||||
You can [change your status](https://support.discord.com/hc/en-us/articles/360035407531-Custom-Status) (online, away, custom messages) by clicking on your avatar in Discord.
|
||||
|
||||
|
||||
# Design documents
|
||||
|
||||
This page used to discuss how to create design docs, but that content is now on its own page: [[Design documents]].
|
||||
5
docs/unsorted_wiki/Code-generation-in-Flutter.md
Normal file
5
docs/unsorted_wiki/Code-generation-in-Flutter.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Flutter previously supported code generation via `flutter generate`.
|
||||
|
||||
However, `flutter generate` is deprecated and slated to be removed in a future flutter release. Instead, consider `build runner`, which is easier to use directly, and can be used to generate code for Flutter projects.
|
||||
|
||||
_See also: https://pub.dev/packages/build_runner_
|
||||
196
docs/unsorted_wiki/Code-signing-metadata.md
Normal file
196
docs/unsorted_wiki/Code-signing-metadata.md
Normal file
@@ -0,0 +1,196 @@
|
||||
# Code signing
|
||||
|
||||
This covers the process of how to add / update code signing metadata of flutter
|
||||
engine binaries.
|
||||
|
||||
## Overview
|
||||
|
||||
Flutter engine binaries are built with GN and ninja, referencing pre-defined
|
||||
configurations such as ci/builders
|
||||
[JSON files](https://github.com/flutter/engine/blob/main/ci/builders/mac_host_engine.json).
|
||||
During flutter releases, engineers need to code sign mac engine binaries to
|
||||
assure users that they come from a known source, have not been tampered with,
|
||||
and should not be quarantined by Gatekeepers.
|
||||
|
||||
Each of the Flutter engine binaries are either code signed with entitlements, or
|
||||
code signed without entitlements. (An entitlement, along with information from
|
||||
the developer account, grant particular permissions to binaries, such as
|
||||
capability to access the user's home automation network.) For example, impellerc
|
||||
is code signed with flutter entitlements, whereas .dylib files are usually code
|
||||
signed without entitlements.
|
||||
|
||||
## Add / Update code signing metadata
|
||||
|
||||
### Glossary
|
||||
|
||||
1. BUILD.gn files: files that include build rules of GN targets. An example is
|
||||
the
|
||||
[BUILD.gn file of flutter engine](https://github.com/flutter/engine/blob/main/BUILD.gn).
|
||||
2. leaf node of an engine binary: the minimal gn target that could produce such
|
||||
an engine binary. That is, this target does not have any dependencies on
|
||||
other gn targets that could build this engine binary.
|
||||
3. dependencies: Every gn target could have dependencies on other gn targets.
|
||||
The dependency of a gn target is defined in the `deps` field of the target's
|
||||
build rule.
|
||||
|
||||
### ways to generate engine binary
|
||||
|
||||
Generally, there are two ways to generate an engine binary:
|
||||
|
||||
1. Through build rules defined in BUILD.gn files.
|
||||
|
||||
2. Through global generator scripts. (these scripts are normally .py files)
|
||||
|
||||
To distinguish between the two, an engine binary is built through global
|
||||
generator if it is listed in the `archives` -> `destination` field of the
|
||||
builder JSON
|
||||
([mac_ios_engine.json](https://github.com/flutter/engine/blob/main/ci/builders/mac_ios_engine.json)
|
||||
or
|
||||
[mac_host_engine.json](https://github.com/flutter/engine/blob/main/ci/builders/mac_host_engine.json)).
|
||||
For example, `darwin-x64/FlutterEmbedder.framework.zip`. Whereas binaries built
|
||||
with BUILD.gn files are listed among the `builds` field of the JSON file. For
|
||||
example, `darwin-x64/artifacts.zip`. We will provide examples for both
|
||||
scenarios.
|
||||
|
||||
### To add / update code signing metadata in BUILD.gn files:
|
||||
|
||||
1. Find the leaf node where the target engine binary is built. To do so,
|
||||
Recursively trace the `deps` field of the engine artifact. The paths in
|
||||
`deps` field of the GN target correspond to the paths of other GN targets
|
||||
that are dependencies of the current GN target.
|
||||
|
||||
2. Add / Update the `metadata` field of the leaf node. For a new engine binary:
|
||||
|
||||
2.1 if it should be code signed with entitlements, add [the name of the
|
||||
engine binary] to the `entitlement_file_path` field in `metadata` .
|
||||
|
||||
2.2 if the binary shouldn't be code signed with entitlements, add [the name
|
||||
of the engine binary] to the `without_entitlement_file_path` field in
|
||||
`metadata` .
|
||||
|
||||
3. If a `entitlement_file_path` or a `without_entitlement_file_path` field does
|
||||
not exist:
|
||||
|
||||
**note**: this step is only needed if the target includes solely binaries
|
||||
that have never been code signed before. This step also requires some
|
||||
background on flutter engine and gn build rules.
|
||||
|
||||
Add a `metadata` field in the gn target of the leaf node, and put the name
|
||||
of the binary in this field. e.g.
|
||||
|
||||
```
|
||||
metadata = {
|
||||
entitlement_file_path = [ "libtessellator.dylib" ]
|
||||
}
|
||||
```
|
||||
|
||||
In the same file that produces the engine artifact(zip file), add a build
|
||||
rule to collect the data keys. e.g.
|
||||
|
||||
```
|
||||
generated_file("artifacts_entitlement_config") {
|
||||
outputs = [ "$target_gen_dir/entitlements.txt" ]
|
||||
|
||||
data_keys = [ "entitlement_file_path" ]
|
||||
|
||||
deps = [ "//flutter/lib/snapshot:generate_snapshot_bin" ]
|
||||
if (flutter_runtime_mode == "debug") {
|
||||
deps += [
|
||||
"//flutter/impeller/compiler:impellerc",
|
||||
"//flutter/impeller/tessellator:tessellator_shared",
|
||||
"//flutter/shell/testing:testing",
|
||||
"//flutter/tools/path_ops:path_ops",
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Finally, embed the file with collected data keys in the zip artifact. e.g.
|
||||
|
||||
```
|
||||
if (host_os == "mac") {
|
||||
deps += [ ":artifacts_entitlement_config" ]
|
||||
files += [
|
||||
{
|
||||
source = "$target_gen_dir/entitlements.txt"
|
||||
destination = "entitlements.txt"
|
||||
},
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
Suppose impellerc is a binary that exist in a zip bundle called artifacts.zip.
|
||||
Then impellerc is the name of the binary, and artifacts.zip is the flutter
|
||||
engine artifact.
|
||||
|
||||
1. Following step 1, the `deps` field of the GN target of artifacts.zip
|
||||
includes the path of impeller dependency:
|
||||
`//flutter/impeller/compiler:impellerc`. Following this path, we locate the
|
||||
GN file at `flutter/impeller/compiler/BUILD.gn`, and find the leaf node that
|
||||
builds impellerc: `impeller_component("impellerc")`.
|
||||
|
||||
2. Following step 2, since `impellerc` should be code signed with entitlements,
|
||||
we go to the `metadata` field of the impellerc target, and add the name
|
||||
`impellerc` to the `entitlement_file_path` array inside the `metadata`
|
||||
field.
|
||||
|
||||
You can reference the
|
||||
[BUILD.gn file of impellerc](https://github.com/flutter/engine/blob/main/impeller/compiler/BUILD.gn).
|
||||
|
||||
### To add / update code signing metadata in global generator files:
|
||||
|
||||
1. Find the generator script path listed under `generators` -> `tasks` ->
|
||||
`script` of the ci/builder JSON files
|
||||
([mac_ios_engine.json](https://github.com/flutter/engine/blob/main/ci/builders/mac_ios_engine.json)
|
||||
or
|
||||
[mac_host_engine.json](https://github.com/flutter/engine/blob/main/ci/builders/mac_host_engine.json)).
|
||||
|
||||
The generator script related to iOS is located at
|
||||
`sky/tools/create_full_ios_framework.py`, and generator script related to
|
||||
macOS is located at `sky/tools/create_macos_framework.py`.
|
||||
|
||||
2. Add / Update the variables ending with `with_entitlements` /
|
||||
`without_entitlements` suffix from the generator script you found in step
|
||||
one.
|
||||
|
||||
As an example, you can find variables `ios_file_without_entitlements` and
|
||||
`ios_file_with_entitlements` in sky/tools/create_full_ios_framework.py; and
|
||||
find variables `filepath_without_entitlements` and
|
||||
`filepath_with_entitlements` in sky/tools/create_macos_framework.py
|
||||
|
||||
2.1 if the binary should be code signed with entitlements, add [the name of
|
||||
the binary] to the variable name with the `with_entitlements` suffix.
|
||||
(`ios_file_with_entitlements` or `filepath_with_entitlements` depending on
|
||||
which script)
|
||||
|
||||
2.2 if the binary shouldn't be code signed with entitlements, add [the name
|
||||
of the binary] to the variable name with the `without_entitlements` suffix.
|
||||
|
||||
#### Example
|
||||
|
||||
Suppose `Flutter.xcframework/ios-arm64/Flutter.framework/Flutter` is a binary
|
||||
that exist in a zip bundle called `ios/artifacts.zip`.
|
||||
|
||||
1. Following step 1, in
|
||||
[mac_ios_engine.json](https://github.com/flutter/engine/blob/main/ci/builders/mac_ios_engine.json),
|
||||
it builds the artifact with the
|
||||
`flutter/sky/tools/create_full_ios_framework.py` script.
|
||||
|
||||
2. Following step 2, since
|
||||
`Flutter.xcframework/ios-arm64/Flutter.framework/Flutter` shouldn't be code
|
||||
signed with entitlements, we add the binary name
|
||||
`Flutter.xcframework/ios-arm64/Flutter.framework/Flutter` to the
|
||||
`ios_file_without_entitlements` variable.
|
||||
|
||||
You can reference the generator script
|
||||
[create_full_ios_framework.py](https://github.com/flutter/engine/blob/main/sky/tools/create_full_ios_framework.py).
|
||||
|
||||
## Code signing artifacts other than flutter engine binaries
|
||||
|
||||
The code signing functionality is implemented as [a recipe module in flutter recipes](https://cs.opensource.google/flutter/recipes/+/master:recipe_modules/signing/api.py). Therefore it can also be used to
|
||||
code sign arbitrary flutter artifacts built through recipe, for example, flutter iOS usb dependencies.
|
||||
|
||||
To code sign, after the artifacts are built, pass the file paths into
|
||||
the code signing recipe module and invoke the function. An example is [how engine V2 invokes the code signing recipe module](https://cs.opensource.google/flutter/recipes/+/master:recipes/engine_v2/engine_v2.py;l=197-212).
|
||||
29
docs/unsorted_wiki/Codelabs.md
Normal file
29
docs/unsorted_wiki/Codelabs.md
Normal file
@@ -0,0 +1,29 @@
|
||||
The Flutter team currently maintains the following codelabs:
|
||||
|
||||
* [Write Your First Flutter App, part 1](https://codelabs.developers.google.com/codelabs/first-flutter-app-pt1/#0)
|
||||
* Create a simple mobile app that generates proposed names for a startup company. In part one, you’ll use a package that returns pairs of words at random and inserts them into an infinite scrolling list.
|
||||
* [Write Your First Flutter App, part 2](https://codelabs.developers.google.com/codelabs/first-flutter-app-pt2/#0)
|
||||
* Create a simple mobile app that generates proposed names for a startup company. In part two, you’ll extend the example from part 1 to allow the user to select favorite word pairs, and add a second “Saved Favorites” page where users can view the selected names. Finally, you’ll change the app’s theme color.
|
||||
* [Basic Flutter layout](https://flutter.dev/docs/codelabs/layout-basics)
|
||||
* Use DartPad in a browser (no need to download Flutter or Dart!) to learn the basics of creating a Flutter layout.
|
||||
* [Building Beautiful UIs with Flutter](https://codelabs.developers.google.com/codelabs/flutter/#0)
|
||||
* A deeper “first dive” than “Write Your First Flutter App.” In this codelab you’ll create a chat app that includes a simple animation, and customizes the UI for iOS and Android.
|
||||
* [Adding Google Maps to a Flutter App](https://codelabs.developers.google.com/codelabs/google-maps-in-flutter/#0)
|
||||
* Display a Google map in an app, retrieve data from a web service, and display the data as markers on the map.
|
||||
* [Build a Photo Sharing App with Google Photos and Flutter](https://codelabs.developers.google.com/codelabs/google-photos-sharing/#0)
|
||||
* Build a field trip app that allows you and other members of the trip to share photos.
|
||||
* [Building a Cupertino app with Flutter](https://codelabs.developers.google.com/codelabs/flutter-cupertino/#0)
|
||||
* Build a version of the Shrine shopping app (used in the Material Design codelabs) using the Cupertino package to create an iOS style look and feel. Create multiple tabs and navigate between them.
|
||||
* [Firebase for Flutter](https://codelabs.developers.google.com/codelabs/flutter-firebase/#0)
|
||||
* Connect a Flutter app to a Firebase database, and use a transaction to update shared information.
|
||||
* [MDC 101 Flutter: Material Components (MDC) Basics](https://codelabs.developers.google.com/codelabs/mdc-101-flutter/#0)
|
||||
* Learn the basics of using Material Components by building a simple app with core components. The four MDC codelabs guide you through building an e-commerce app called Shrine. You’ll start by building a login page using several of MDC Flutter’s components.
|
||||
* [MDC 102 Flutter: Material Structure and Layout](https://codelabs.developers.google.com/codelabs/mdc-102-flutter/#0)
|
||||
* Learn how to use Material for structure and layout in Flutter. Continue building the e-commerce app, introduced in MDC-101, by adding navigation, structure, and data.
|
||||
* [MDC 103 Flutter: Material Theming with Color, Shape, Elevation, and Type](https://codelabs.developers.google.com/codelabs/mdc-103-flutter/#0)
|
||||
* Discover how Material Components for Flutter make it easy to differentiate your product, and express your brand through design. Continue building your e-commerce app by adding a home screen that displays products.
|
||||
* [MDC 104 Flutter: Material Advanced Components](https://codelabs.developers.google.com/codelabs/mdc-104-flutter/#0)
|
||||
* Improve your design and learn to use our advanced component backdrop menu. Finish your e-commerce app by adding a backdrop with a menu that filters products by the selected category.
|
||||
|
||||
|
||||
If you find errors with the codelabs, please create [issues](https://github.com/flutter/flutter/issues) with the [dev: docs - codelab](https://github.com/flutter/flutter/labels/dev%3A%20docs%20-%20codelab) and [TODAY](https://github.com/flutter/flutter/labels/%E2%9A%A0%20TODAY) labels.
|
||||
1961
docs/unsorted_wiki/Commits-Between-1.2.1-and-1.5.4.md
Normal file
1961
docs/unsorted_wiki/Commits-Between-1.2.1-and-1.5.4.md
Normal file
File diff suppressed because one or more lines are too long
90
docs/unsorted_wiki/Comparing-AOT-Snapshot-Sizes.md
Normal file
90
docs/unsorted_wiki/Comparing-AOT-Snapshot-Sizes.md
Normal file
@@ -0,0 +1,90 @@
|
||||
These instructions can be used to prepare a tabulated summary of the differences in the sizes of two AOT snapshots. The instructions assume that the Flutter Engine has been [setup](https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment) on the host (at `FLUTTER_ENGINE` in these instructions).
|
||||
|
||||
Build the AOT snapshot (`flutter build aot`) for the application but pass in the `--verbose` flag. We need to find the `gen_snapshot` invocation and re-run it with an extra option (`--print-instructions-sizes-to`). If you are instrumenting with a local engine, the `flutter build` [takes a `--local-engine` and `--local-engine-host` flag](https://github.com/flutter/flutter/wiki/Debugging-the-engine#running-a-flutter-app-with-a-local-engine) as well.
|
||||
|
||||
Here is an example of the updated invocation. Specify the path to a JSON file that acts as a summary (`SUMMARY_LOCATION` in these instructions) as follows.
|
||||
|
||||
```bash
|
||||
$FLUTTER_ENGINE/out/host_debug_unopt/gen_snapshot \
|
||||
--print-instructions-sizes-to=$SUMMARY_LOCATION \
|
||||
--causal_async_stacks \
|
||||
--packages=.packages \
|
||||
--deterministic \
|
||||
--snapshot_kind=app-aot-blobs \
|
||||
--vm_snapshot_data=build/aot/vm_snapshot_data \
|
||||
--isolate_snapshot_data=build/aot/isolate_snapshot_data \
|
||||
--vm_snapshot_instructions=build/aot/vm_snapshot_instr \
|
||||
--isolate_snapshot_instructions=build/aot/isolate_snapshot_instr \
|
||||
build/aot/app.dill
|
||||
```
|
||||
|
||||
Save the file at `SUMMARY_LOCATION` as `before.json`
|
||||
|
||||
Now, either change the Dart code with the changes you wish to see the effects, or, rebuild the engine to create an updated `gen_snapshot` binary.
|
||||
|
||||
After you have made necessary changes, re-run `flutter build aot` again. This step is important because AOT compilation has a [kernel compilation step](https://github.com/flutter/flutter/wiki/Custom-Flutter-Engine-Embedding-in-AOT-Mode#generating-the-kernel-snapshot) before the `gen_snapshot` invocation.
|
||||
|
||||
Re-run the gen_snapshot invocation and save the resulting file to `after.json`.
|
||||
|
||||
Run the `compare_size.dart` tool and pass in the `before.json` and `after.json` files to generate the summary.
|
||||
|
||||
An example invocation looks as follow.
|
||||
|
||||
```
|
||||
$FLUTTER_ENGINE/out/host_debug_unopt/dart-sdk/bin/dart \
|
||||
before.json \
|
||||
after.json
|
||||
```
|
||||
|
||||
This should dump something like the following to the console.
|
||||
|
||||
```
|
||||
+------------+----------------------------------------------------------+--------------+
|
||||
| Library | Method | Diff (Bytes) |
|
||||
+------------+----------------------------------------------------------+--------------+
|
||||
| dart:async | new ZoneSpecification.from | +2136 |
|
||||
| dart:async | runZoned | +1488 |
|
||||
| dart:async | new _CustomZone | +927 |
|
||||
| dart:async | runZoned.<anonymous closure> | +881 |
|
||||
| dart:async | _rootFork | +504 |
|
||||
| dart:async | _rootCreatePeriodicTimer | +500 |
|
||||
| dart:async | _rootCreateTimer | +498 |
|
||||
| dart:async | _rootRegisterUnaryCallback | +485 |
|
||||
| dart:async | _rootRegisterBinaryCallback | +485 |
|
||||
| dart:async | _rootRegisterCallback | +485 |
|
||||
| dart:async | _rootPrint | +453 |
|
||||
| dart:async | _CustomZone.fork | +396 |
|
||||
| dart:async | _rootErrorCallback | +389 |
|
||||
| dart:async | _CustomZone.bindUnaryCallbackGuarded | +368 |
|
||||
| dart:async | _rootHandleUncaughtError | +342 |
|
||||
| dart:async | _CustomZone.runBinary | +296 |
|
||||
| dart:async | _CustomZone.runUnary | +293 |
|
||||
| dart:async | _CustomZone.[] | +291 |
|
||||
| dart:async | _CustomZone.registerCallback | +290 |
|
||||
| dart:async | _CustomZone.run | +290 |
|
||||
| dart:async | _CustomZone.registerUnaryCallback | +290 |
|
||||
| dart:async | _CustomZone.registerBinaryCallback | +290 |
|
||||
| dart:async | _CustomZone.runBinaryGuarded | +289 |
|
||||
| dart:async | _CustomZone.runUnaryGuarded | +286 |
|
||||
| dart:async | _RootZone.fork | +283 |
|
||||
| dart:async | _CustomZone.bindCallback | +259 |
|
||||
| dart:async | _CustomZone.bindUnaryCallback | +259 |
|
||||
| dart:async | _CustomZone.bindUnaryCallback.<anonymous closure> | +248 |
|
||||
| dart:async | _RootZone.bindUnaryCallback.<anonymous closure> | +248 |
|
||||
| dart:async | _CustomZone.bindUnaryCallbackGuarded.<anonymous closure> | +248 |
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
| | [Stub] Type Test Type: class 'PopupMenuEntry' | -128 |
|
||||
| | [Stub] Type Test Type: class '_SyncIterator@0150898' | -128 |
|
||||
| | [Stub] Type Test Type: class 'PopupMenuItem' | -128 |
|
||||
| | [Stub] Type Test Type: class 'FormFieldState' | -128 |
|
||||
| | [Stub] Type Test Type: class 'PopupMenuButton' | -128 |
|
||||
| | [Stub] Type Test Type: class '_SyncIterator@0150898' | -131 |
|
||||
| | [Stub] Type Test Type: class '_SplayTreeMapNode@3220832' | -139 |
|
||||
| | [Stub] Type Test Type: class '_SplayTreeMapNode@3220832' | -165 |
|
||||
| dart:io | new Directory | -211 |
|
||||
| dart:io | new Link | -211 |
|
||||
+------------+----------------------------------------------------------+--------------+
|
||||
Total change +24036 bytes.
|
||||
|
||||
```
|
||||
330
docs/unsorted_wiki/Compiling-the-engine.md
Normal file
330
docs/unsorted_wiki/Compiling-the-engine.md
Normal file
@@ -0,0 +1,330 @@
|
||||
_If you've never built the engine before, first see [Setting up the Engine development environment](https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment)._
|
||||
|
||||
# Contents
|
||||
|
||||
Depending on the platform you are making changes for, you may be interested in all or only some of the sections below:
|
||||
|
||||
* [General Compilation Tips](#general-compilation-tips)
|
||||
* [Using a custom Dart SDK](#using-a-custom-dart-sdk)
|
||||
* [Compiling for Android](#compiling-for-android-from-macos-or-linux)
|
||||
* [Compiling for iOS (from macOS)](#compiling-for-ios-from-macos)
|
||||
* [Compiling for macOS or Linux](#compiling-for-macos-or-linux)
|
||||
* [Compiling for Windows](#compiling-for-windows)
|
||||
* [Compiling for Fuchsia](#compiling-for-fuchsia)
|
||||
* [Compiling for the Web](#compiling-for-the-web)
|
||||
* [Compiling for testing](#compiling-for-testing)
|
||||
|
||||
## General Compilation Tips
|
||||
|
||||
- For local development and testing, it's generally preferable to use `--unopt` builds.
|
||||
These builds will have additional logging and checks enabled, and generally use build
|
||||
and link flags that lead to faster compilation and better debugging symbols.
|
||||
If you are trying to do performance testing with a local build, do not use the `--unopt`
|
||||
flag.
|
||||
- Link Time Optimization: Optimized builds also perform Link Time Optimization of all
|
||||
binaries. This makes the linker take a lot of time and memory to produce binaries. If
|
||||
you need optimized binaries but don't want to perform LTO, add the `--no-lto` flag.
|
||||
- Android and iOS expect both a `host` and `android` (or `ios`) build. It is critical to
|
||||
recompile the host build after upgrading the Dart SDK (e.g. via a `gclient sync` after
|
||||
merging up to head), since artifacts from the host build need to be version matched to
|
||||
artifacts in the Android/iOS build.
|
||||
- Web, Desktop, and Fuchsia builds have only one build target (i.e. `host` or `fuchsia`).
|
||||
- Make sure to exclude the `out` directory from any backup scripts, as many large binary
|
||||
artifacts are generated. This is also generally true for all of the directories outside
|
||||
of the `engine/src/flutter` directory.
|
||||
|
||||
## Using a custom Dart SDK
|
||||
|
||||
When targeting the host and desktop, on CI we use a pre-built Dart SDK vended by the Dart team.
|
||||
To build and use the SDK from the Dart sources downloaded by `gclient sync`, after editing those
|
||||
source files, pass the flag `--no-prebuilt-dart-sdk` to `//flutter/tools/gn`.
|
||||
|
||||
## Compiling for Android (from macOS or Linux)
|
||||
|
||||
These steps build the engine used by `flutter run` for Android devices.
|
||||
|
||||
Run the following steps, from the `src` directory created in [Setting up the Engine development environment](https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment):
|
||||
|
||||
1. `git pull upstream main` in `src/flutter` to update the Flutter Engine repo.
|
||||
|
||||
2. `gclient sync` to update dependencies.
|
||||
|
||||
3. Prepare your build files
|
||||
* `./flutter/tools/gn --android --unoptimized` for device-side executables.
|
||||
* `./flutter/tools/gn --android --android-cpu arm64 --unoptimized` for newer 64-bit Android devices.
|
||||
* `./flutter/tools/gn --android --android-cpu x86 --unoptimized` for x86 emulators.
|
||||
* `./flutter/tools/gn --android --android-cpu x64 --unoptimized` for x64 emulators.
|
||||
* `./flutter/tools/gn --unoptimized` for host-side executables, needed to compile the code.
|
||||
* On Apple Silicon ("M" chips), add `--mac-cpu arm64` to avoid using emulation. This will generate `host_debug_unopt_arm64`.
|
||||
|
||||
> 💡 **TIP**: When developing on a Mac with ARM (M CPU), prefer `host_debug_unopt_arm64`.
|
||||
>
|
||||
> You can continue to use `host_debug_unopt` (required for Intel Macs), but the engine will be run under Rosetta
|
||||
> which may be slower. See [Developing with Flutter on Apple Silicon](https://github.com/flutter/flutter/wiki/Developing-with-Flutter-on-Apple-Silicon)
|
||||
> for more information.
|
||||
|
||||
4. Build your executables
|
||||
* `ninja -C out/android_debug_unopt` for device-side executables.
|
||||
* `ninja -C out/android_debug_unopt_arm64` for newer 64-bit Android devices.
|
||||
* `ninja -C out/android_debug_unopt_x86` for x86 emulators.
|
||||
* `ninja -C out/android_debug_unopt_x64` for x64 emulators.
|
||||
* `ninja -C out/host_debug_unopt` (or `ninja -C out/host_debug_unopt_arm64`, see above) for host-side executables.
|
||||
* These commands can be combined. Ex: `ninja -C out/android_debug_unopt && ninja -C out/host_debug_unopt`
|
||||
* For MacOS, you will need older version of XCode(9.4 or below) to compile android_debug_unopt and android_debug_unopt_x86. If you only care about x64, you can ignore this
|
||||
|
||||
This builds a debug-enabled ("unoptimized") binary configured to run Dart in
|
||||
checked mode ("debug"). There are other versions, see [[Flutter's modes]].
|
||||
|
||||
If you're going to be debugging crashes in the engine, make sure you add
|
||||
`android:debuggable="true"` to the `<application>` element in the
|
||||
`android/AndroidManifest.xml` file for the Flutter app you are using
|
||||
to test the engine.
|
||||
|
||||
See [[The flutter tool]] for instructions on how to use the `flutter` tool with a local engine.
|
||||
You will typically use the `android_debug_unopt` build to debug the engine on a device, and
|
||||
`android_debug_unopt_x64` to debug in on a simulator. Modifying dart sources in the engine will
|
||||
require adding a `dependency_override` section in you app's `pubspec.yaml` as detailed
|
||||
[here](https://github.com/flutter/flutter/wiki/The-flutter-tool#using-a-locally-built-engine-with-the-flutter-tool).
|
||||
|
||||
Note that if you use particular android or ios engine build, you will need to have corresponding
|
||||
host build available next to it: if you use `android_debug_unopt`, you should have built `host_debug_unopt`,
|
||||
`android_profile` -> `host_profile`, etc. One caveat concerns cpu-flavored builds like `android_debug_unopt_x86`: you won't be able to build `host_debug_unopt_x86` as that configuration is not supported. What you are expected to do is to build `host_debug_unopt` and symlink `host_debug_unopt_x86` to it.
|
||||
|
||||
### Compiling everything that matters on Linux
|
||||
|
||||
The following script will update all the builds that matter if you're developing on Linux and testing on Android and created the `.gclient` file in `~/dev/engine`:
|
||||
|
||||
```bash
|
||||
set -ex
|
||||
|
||||
cd ~/dev/engine/src/flutter
|
||||
git fetch upstream
|
||||
git rebase upstream/main
|
||||
gclient sync
|
||||
cd ..
|
||||
|
||||
flutter/tools/gn --unoptimized --runtime-mode=debug
|
||||
flutter/tools/gn --android --unoptimized --runtime-mode=debug
|
||||
flutter/tools/gn --android --runtime-mode=profile
|
||||
flutter/tools/gn --android --runtime-mode=release
|
||||
|
||||
cd out
|
||||
find . -mindepth 1 -maxdepth 1 -type d | xargs -n 1 sh -c 'ninja -C $0 || exit 255'
|
||||
```
|
||||
For `--runtime-mode=profile` build, please also consider adding `--no-lto` option to the `gn` command. It will make linking much faster with a small sacrifice on the binary size and memory usage (which probably doesn't matter for debugging or performance benchmark purposes.)
|
||||
|
||||
## Compiling for iOS (from macOS)
|
||||
|
||||
These steps build the engine used by `flutter run` for iOS devices.
|
||||
|
||||
Run the following steps, from the `src` directory created in the steps above:
|
||||
|
||||
1. `git pull upstream main` in `src/flutter` to update the Flutter Engine repo.
|
||||
|
||||
2. `gclient sync` to update dependencies.
|
||||
|
||||
3. `./flutter/tools/gn --ios --unoptimized` to prepare build files for device-side executables (or `--ios --simulator --unoptimized` for simulator).
|
||||
* This also produces an Xcode project for working with the engine source code at `out/ios_debug_unopt/flutter_engine.xcodeproj`
|
||||
* For a discussion on the various flags and modes, see [[Flutter's modes]].
|
||||
* Add the `--simulator-cpu=arm64` argument for an arm64 Mac simulator to output to `out/ios_debug_sim_unopt_arm64`.
|
||||
|
||||
4. `./flutter/tools/gn --unoptimized` to prepare the build files for host-side executables.
|
||||
* On Apple Silicon ("M" chips), add `--mac-cpu arm64` to avoid using emulation. This will generate `host_debug_unopt_arm64`.
|
||||
|
||||
5. `ninja -C out/ios_debug_unopt && ninja -C out/host_debug_unopt` to build all artifacts (use `out/ios_debug_sim_unopt` for Simulator).
|
||||
|
||||
See [[The flutter tool]] for instructions on how to use the `flutter` tool with a local engine.
|
||||
You will typically use the `ios_debug_unopt` build to debug the engine on a device, and
|
||||
`ios_debug_sim_unopt` to debug in on a simulator. Modifying dart sources in the engine will
|
||||
require adding a `dependency_override` section in you app's `pubspec.yaml` as detailed
|
||||
[here](https://github.com/flutter/flutter/wiki/The-flutter-tool#using-a-locally-built-engine-with-the-flutter-tool).
|
||||
|
||||
See also [instructions for debugging the engine in a Flutter app in Xcode](https://github.com/flutter/flutter/wiki/Debugging-the-engine#debugging-ios-builds-with-xcode).
|
||||
|
||||
## Compiling for macOS or Linux
|
||||
|
||||
These steps build the desktop embedding, and the engine used by `flutter test` on a host workstation.
|
||||
|
||||
1. `git pull upstream main` in `src/flutter` to update the Flutter Engine repo.
|
||||
|
||||
2. `gclient sync` to update your dependencies.
|
||||
|
||||
3. `./flutter/tools/gn --unoptimized` to prepare your build files.
|
||||
* `--unoptimized` disables C++ compiler optimizations. On macOS, binaries are emitted unstripped; on Linux, unstripped binaries are emitted to an `exe.unstripped` subdirectory of the build.
|
||||
|
||||
4. `ninja -C out/host_debug_unopt` to build a desktop unoptimized binary.
|
||||
* If you skipped `--unoptimized`, use `ninja -C out/host_debug` instead.
|
||||
|
||||
See [[The flutter tool]] for instructions on how to use the `flutter` tool with a local engine.
|
||||
You will typically use the `host_debug_unopt` build in this setup. Modifying dart sources in the engine will
|
||||
require adding a `dependency_override` section in you app's `pubspec.yaml` as detailed
|
||||
[here](https://github.com/flutter/flutter/wiki/The-flutter-tool#using-a-locally-built-engine-with-the-flutter-tool).
|
||||
|
||||
|
||||
## Compiling for Windows
|
||||
|
||||
> [!WARNING]
|
||||
> You can only build selected binaries on Windows (mainly `gen_snapshot` and the desktop embedding).
|
||||
|
||||
On Windows, ensure that the engine checkout is not deeply nested. This avoid the issue of the build scripts working with excessively long paths.
|
||||
|
||||
1. Make sure you have Visual Studio installed (non-Googlers only). [Debugging Tools for Windows 10](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools#small-classic-windbg-preview-logo-debugging-tools-for-windows-10-windbg) must be installed.
|
||||
|
||||
2. `git pull upstream main` in `src/flutter` to update the Flutter Engine repo.
|
||||
|
||||
3. Ensure long path support is enabled on your machine. Launch PowerShell as an administrator and run:
|
||||
```
|
||||
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -Force
|
||||
```
|
||||
|
||||
4. If you are not a Google employee, you must set the following environment variables to point the depot tools at Visual Studio:
|
||||
```shell
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN=0
|
||||
GYP_MSVS_OVERRIDE_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" # (or your location for Visual Studio)
|
||||
WINDOWSSDKDIR="C:\Program Files (x86)\Windows Kits\10" # (or your location for Windows Kits)
|
||||
```
|
||||
Also, be sure that Python27 is before any other python in your Path.
|
||||
|
||||
5. `gclient sync` to update your dependencies.
|
||||
|
||||
6. switch to `src/` directory.
|
||||
|
||||
7. `python .\flutter\tools\gn --unoptimized` to prepare your build files.
|
||||
* If you are only building `gen_snapshot`: `python .\flutter\tools\gn [--unoptimized] --runtime-mode=[debug|profile|release] [--android]`.
|
||||
|
||||
8. `ninja -C .\out\<dir created by previous step>` to build.
|
||||
* If you used a non-debug configuration, use `ninja -C .\out\<dir created by previous step> gen_snapshot`.
|
||||
Release and profile are not yet supported for the desktop shell.
|
||||
|
||||
## Compiling for Fuchsia
|
||||
|
||||
### Build components for Fuchsia
|
||||
|
||||
1. Building fuchsia is only supported on linux. You need to run `gclient config --custom-var=download_fuchsia_deps=True` then `gclient sync`.
|
||||
|
||||
It will set `"download_fuchsia_deps": True` in `"custom_vars"` section in `.gclient` file, and download necessary binaries to build fuchsia components.
|
||||
|
||||
2. If you'd like to run tests locally, also run `gclient config --custom-var=run_fuchsia_emu=True` then `gclient sync`.
|
||||
|
||||
It will set `"run_fuchsia_emu": True` in `"custom_vars"` section in `.gclient` file, and download necessary binaries and images to run tests on fuchsia emulators.
|
||||
You can set both `custom_vars` and run `gclient sync` only once.
|
||||
|
||||
You will also need kvm enabled, or nested virtualization on the gcloud VMs. Fuchsia and the tests will all be executed on the qemu.
|
||||
|
||||
3. Prepare and build
|
||||
|
||||
```
|
||||
./flutter/tools/gn --fuchsia --no-lto
|
||||
```
|
||||
|
||||
* It will create a `out/fuchsia_debug_x64`.
|
||||
* Use `--fuchsia-cpu arm64` to build components for arm64. It will be created in a folder `out/fuchsia_debug_arm64`.
|
||||
* Use `--runtime-mode=release` or `--runtime-mode=profile` to select other profiles as other platforms.
|
||||
* Ignore `--no-lto` to use lto or link-time optimization.
|
||||
|
||||
```
|
||||
ninja -C out/fuchsia_debug_x64 -k 0
|
||||
```
|
||||
|
||||
* It builds all but ignores known errors.
|
||||
* Or specify following targets to avoid using `-k 0`.
|
||||
|
||||
```
|
||||
flutter/shell/platform/fuchsia:fuchsia \
|
||||
flutter/shell/platform/fuchsia/dart_runner:dart_runner_tests \
|
||||
fuchsia_tests
|
||||
```
|
||||
|
||||
* Use `autoninja` if it's available.
|
||||
* `-C out/fuchsia_release_x64` for release build; other configurations are similar with a different folder name in `out/`.
|
||||
|
||||
4. Run all tests locally
|
||||
|
||||
```
|
||||
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
|
||||
```
|
||||
|
||||
* It runs the tests in `out/fuchsia_debug_x64` by default. According to the configuration, it may take 5 minutes with regular gtest output to the terminal.
|
||||
* Add `fuchsia_release_x64` at the end of the command for release build; other configurations are similar with a different folder name in `out/`.
|
||||
|
||||
## Compiling for the Web
|
||||
|
||||
For building the engine for the Web we use the [felt](https://github.com/flutter/engine/blob/main/lib/web_ui/README.md) tool.
|
||||
|
||||
To test Flutter with a local build of the Web engine, add `--local-web-sdk=wasm_release` to your `flutter` command, e.g.:
|
||||
|
||||
```
|
||||
flutter run --local-web-sdk=wasm_release -d chrome
|
||||
flutter test --local-web-sdk=wasm_release test/path/to/your_test.dart
|
||||
```
|
||||
|
||||
## Compiling for the Web on Windows
|
||||
|
||||
Compiling the web engine might take a few extra steps on Windows. Use cmd.exe and "run as administrator".
|
||||
|
||||
1. Make sure you have Visual Studio installed. Set the following environment variables. For Visual Studio use the path of the version you installed.
|
||||
* `GYP_MSVS_OVERRIDE_PATH = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"`
|
||||
* `GYP_MSVS_VERSION = 2017`
|
||||
2. Make sure, depot_tools, ninja and python are installed and added to the path. Also set the following environment variable for depot tools:
|
||||
* `DEPOT_TOOLS_WIN_TOOLCHAIN = 0`
|
||||
* Tip: if you get a python error try to use Python 2 instead of 3
|
||||
3. `git pull upstream main` in `src/flutter` to update the Flutter Engine repo.
|
||||
4. `gclient sync` to update your dependencies.
|
||||
* Tip: If you get a git authentication errors on this step try Git Bash instead
|
||||
5. `python .\flutter\tools\gn --unoptimized --full-dart-sdk` to prepare your build files.
|
||||
6. `ninja -C .\out\<dir created by previous step>` to build.
|
||||
|
||||
To test Flutter with a local build of the Web engine, add `--local-web-sdk=wasm_release` to your `flutter` command, e.g.:
|
||||
|
||||
```
|
||||
flutter run --local-web-sdk=wasm_release -d chrome
|
||||
flutter test --local-web-sdk=wasm_release test/path/to/your_test.dart
|
||||
```
|
||||
|
||||
For testing the engine again use [felt](https://github.com/flutter/engine/blob/main/lib/web_ui/README.md) tool
|
||||
this time with felt_windows.bat.
|
||||
|
||||
```
|
||||
felt_windows.bat test
|
||||
```
|
||||
|
||||
## Compiling for testing
|
||||
|
||||
### Dart tests
|
||||
|
||||
To run dart tests, build the engine:
|
||||
|
||||
```
|
||||
flutter/tools/gn --unoptimized
|
||||
ninja -C out/host_debug_unopt/
|
||||
```
|
||||
|
||||
execute `run_tests` for native:
|
||||
```
|
||||
python3 flutter/testing/run_tests.py --type dart
|
||||
```
|
||||
|
||||
and `felt` for web:
|
||||
```
|
||||
cd flutter/lib/web_ui
|
||||
dev/felt test [test file]
|
||||
```
|
||||
|
||||
|
||||
## Troubleshooting Compile Errors
|
||||
|
||||
### Version Solving Failed
|
||||
|
||||
From time to time, as the Dart versions increase, you might see dependency errors such as:
|
||||
|
||||
```
|
||||
The current Dart SDK version is 2.7.0-dev.0.0.flutter-1ef444139c.
|
||||
|
||||
Because ui depends on <a pub package> 1.0.0 which requires SDK version >=2.7.0 <3.0.0, version solving failed.
|
||||
```
|
||||
|
||||
Running `gclient sync` does not update the tags, there are two solutions:
|
||||
1. under `engine/src/third_party/dart` run `git fetch --tags origin`
|
||||
2. or run gclient sync with with tags parameter: `gclient sync --with_tags`
|
||||
|
||||
_See also: [[Debugging the engine]], which includes instructions on running a Flutter app with a local engine._
|
||||
433
docs/unsorted_wiki/Contributing-to-Plugins-and-Packages.md
Normal file
433
docs/unsorted_wiki/Contributing-to-Plugins-and-Packages.md
Normal file
@@ -0,0 +1,433 @@
|
||||
This page covers additional information that is specific to contributing to flutter/packages. If you aren't already familiar with the general guidance on Flutter contribution, start with [Tree hygiene](https://github.com/flutter/flutter/wiki/Tree-hygiene).
|
||||
|
||||
## Version and CHANGELOG updates
|
||||
|
||||
Most changes need version and CHANGELOG changes; see below for details.
|
||||
|
||||
In most cases, the easiest way to create them is to use [the `update-release-info` repository command](https://github.com/flutter/packages/blob/main/script/tool/README.md#update-changelog-and-version). If you are adding a feature, use `--version=minor`, otherwise `--version=minimal` will almost always do the right thing.
|
||||
|
||||
### Version
|
||||
|
||||
Any change that needs to be published in order to take effect must update the version in `pubspec.yaml`. There are very few exceptions:
|
||||
- PRs that only affect tests.
|
||||
- PRs that only affect unpublished parts of example apps.
|
||||
- PRs that only affect local development of the package (e.g., changes to ignored lints).
|
||||
- Breaking change batching (see below).
|
||||
- Non-code changes that we make to future-proof development in some way, but don't directly benefit clients. Examples of this include
|
||||
- Updating the minimum Dart or Flutter SDK for all packages when we adjust our test matrix.
|
||||
- Updating the minimum OS version of plugins to match changes to [Flutter support](https://docs.flutter.dev/reference/supported-platforms) (on `stable`).
|
||||
|
||||
(Unless you are a member of the Flutter team, you are likely not making changes that fall under this exemption.)
|
||||
|
||||
This is because the packages in flutter/packages use a continuous release model rather than a set release cadence. This model gets improvements to the community faster, makes regressions easier to pinpoint, and simplifies the release process.
|
||||
|
||||
(The `override: no versioning needed` label can be added to skip this check, but only if the criteria above are met, or team members agree there is a compelling reason for a new exemption. Team members: please leave a comment when adding the `override` label explaining the reason for the override.)
|
||||
|
||||
### CHANGELOG
|
||||
|
||||
All version changes must have an accompanying CHANGELOG update. Even version-exempt changes should often update CHANGELOG by adding a special `NEXT` entry at the top of `CHANGELOG.md` (unless they only affect development of the package, such as test-only changes):
|
||||
```
|
||||
## NEXT
|
||||
|
||||
* Description of the change.
|
||||
|
||||
## 1.0.2
|
||||
...
|
||||
```
|
||||
|
||||
This policy exists because some changes (e.g., certain updates to examples) that do not need to be published may still be of interest to clients of a package.
|
||||
|
||||
The tooling errs on the side of false positives, so will sometimes flag changes that should be exempt for one of the reasons listed above. In these cases, or if the reviewer feels that the change would not be relevant to package clients, they can add the `override: no changelog needed` label can to skip this check. Team members: please leave a comment when adding the `override` label explaining the reason for the override.
|
||||
|
||||
#### CHANGELOG style
|
||||
|
||||
For consistency, all CHANGELOG entries should follow a common style:
|
||||
- Use `##` for the version line. A version line should have a blank line before and after it.
|
||||
- Use `*` for individual items.
|
||||
- Exception: When editing an existing CHANGELOG that uses `-`, use that instead for local consistency.
|
||||
- Entries should use present tense indicative for verbs, with "this version" as an implied subject. For example, "Adds cool new feature.",
|
||||
not "Add", "Added", or "Adding".
|
||||
- Entries should end with a `.`.
|
||||
- Breaking changes should be introduced with `**BREAKING CHANGE**:`, or `**BREAKING CHANGES**:`
|
||||
if there is a sub-list of changes.
|
||||
- Breaking change notifications should include information about how to migrate. If extensive migration is required, this can be a reference to a longer description elsewhere (usually README.md) rather than inline instructions.
|
||||
|
||||
Example:
|
||||
```
|
||||
## 2.0.0
|
||||
|
||||
* Adds the ability to fetch data from the future.
|
||||
* **BREAKING CHANGES**:
|
||||
* Removes the deprecated `neverCallThis` method.
|
||||
* URLs parameters are now `Uri`s rather than `String`s.
|
||||
|
||||
## 1.0.3
|
||||
|
||||
* Fixes a crash when the device teleports during a network operation.
|
||||
```
|
||||
|
||||
#### Updating a CHANGELOG that has a `NEXT`
|
||||
|
||||
*Note: If you are using `update-release-info`, this will be handled correctly for you.*
|
||||
|
||||
If you are adding a version change to a CHANGELOG that starts with `NEXT`, and your change also doesn't require a version update, just add a description to the existing `NEXT` list:
|
||||
```
|
||||
## NEXT
|
||||
|
||||
* Description of your new change.
|
||||
* Existing entry.
|
||||
|
||||
## 1.0.2
|
||||
...
|
||||
```
|
||||
|
||||
If your change does require a version change, do the same, but then replace `NEXT` with the new version. For example:
|
||||
|
||||
```
|
||||
## 1.0.3
|
||||
|
||||
* Description of your new change.
|
||||
* Existing entry.
|
||||
|
||||
## 1.0.2
|
||||
...
|
||||
```
|
||||
|
||||
If you leave `NEXT` when adding a version change, automated tests for your PR will fail.
|
||||
|
||||
### FAQ
|
||||
|
||||
**Do I need to update the version if I'm just changing the README?** Yes. Most people read the README on pub.dev, not GitHub, so a README change is not very useful unless it is published.
|
||||
|
||||
**Do I need to update the version if I'm just changing comments?** If the comment is intended for clients of the package (a `///` comment on anything exported by the package), then yes, since what developers using the package will see in their IDE will come from the published version. If the comment is only useful for someone working on the package (such as an implementation comment within a method, or a comment in a non-exported file), then no.
|
||||
|
||||
**What do I do if I there are conflicts to those changes before or during review?** This is common. You can leave the conflicts until you're at the end of the review process to avoid needing to resolve frequently. Including the version changes at the beginning despite the likelihood of conflicts makes it much harder to forget that step, and also means that a reviewer can easily fix it from the GitHub UI just before landing.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Because we prefer to minimize breaking changes to packages after 1.0, breaking changes do not always follow the normal one-version-change-per-PR approach. Instead, when making a breaking change consider whether there are other breaking changes that should be made at the same time, and discuss with other regular contributors. If there are multiple changes to make, they can be batched as follows:
|
||||
1. File an issue tracking all of the breaking changes to include.
|
||||
1. Prepare PRs for all of the changes, without version changes. Ensure that they have all been reviewed, but do not land them yet. (They should fail CI due to the lack of version change, preventing accidental landing.)
|
||||
1. Land a PR that temporarily adds `publish_to: none` to the package, with a comment referencing the issue from step 1.
|
||||
1. Land all of the breaking change PRs. This step should be done in a relatively short window of time (thus the advance preparation above) to avoid having the plugin be unpublishable for longer than necessary. The PRs will pass CI once rebased, since the version check is disabled for unpublishable packages.
|
||||
1. Once all breaking changes have landed, land a final PR to update the version and remove `publish_to: none`.
|
||||
|
||||
## Dependencies
|
||||
|
||||
We try to minimize external package dependencies as much as possible, where "external" means packages that are not generally within the control of the Flutter or Dart teams (Examples non-external packages include `sdk:` dependencies, packages in flutter/packages, and packages published by dart.dev), or by an organization with a track record of strong support for both engineering best practices and Flutter. This is for several reasons:
|
||||
- Maintainability:
|
||||
- We have a policy of always supporting Flutter `master`; if we can't guarantee that fixes for breaking changes can be landed immediately in dependencies, it can block our roller.
|
||||
- If a package is abandoned by its authors, we will have to fork or migrate in order to unblock the entire repository.
|
||||
- External packages increase our expose to out-of-band breakage (e.g., if breaking change is published without following semver).
|
||||
- Security: We cannot make any guarantees about the code in an external package. For example, if a package we depend on is later taken over by a malicious actor, our dependency would expose all clients of our own package to potential attack via the transitive dependency.
|
||||
|
||||
If you are considering adding an external dependency:
|
||||
- Consider other options, and discuss with #hackers-ecosystem in Discord.
|
||||
- If you add a `dev_dependency` on an external package, pin it to a specific version if at all possible.
|
||||
- If you add a `dependency` on an external package in an `example/`, pin it to a specific version if at all possible.
|
||||
- Some dependencies should only be linked as dev_dependencies like integration_test
|
||||
|
||||
### Native dependencies
|
||||
|
||||
The same general principles apply to native dependencies for plugins (e.g., dependencies specified in an Android Gradle file or iOS podspec file): minimize dependencies—and especially non-test dependencies—on libraries that are not created by either the platform vendor or another organization with a track record of strong support for engineering best practices in whom we can have a very high degree of confidence in ongoing support and prompt updates.
|
||||
|
||||
## Platform Support
|
||||
|
||||
The goal is to have any plugin feature work on every platform on which that feature makes sense; having a lot of features that are only partially implemented across platforms is often confusing and frustrating for developers trying to use those plugins. However, a single developer will not always have the expertise to implement a feature across all supported platforms.
|
||||
|
||||
Given that, we welcome PRs that only implement a feature for a subset of platforms, including just one. To set expectations for how such PRs will be handled:
|
||||
- They will not be fully reviewed until there's an understanding of what support would look like across other platforms, for several reasons:
|
||||
- API for features that will be permanently platform-specific may structured in ways that make that limitation more clear, so knowing if other platforms can support it will affect the review process.
|
||||
- We want to avoid over-fitting the plugin APIs to a single platform's API. It is often the case that several platforms can implement a feature, but the behavior is different enough across platforms that we need to design the API in a way that covers those variations in a cohesive way. This means that knowing at a high level what the implementation on other platform also affects the review process.
|
||||
- Features that are missing implementations on some platforms need to be clearly documented as such in the API, and those comments should clearly express whether those platform are temporarily missing implementations, or are not expected to ever have implementations due to platform limitations.
|
||||
|
||||
The PR author isn't necessarily responsible for answering these questions. These cases will be noted in comments during PR triage; if the PR author, or others in the community, can contribute that information, that will certainly help. If not, that investigation will be part of the review process (in which case the review will likely take longer).
|
||||
- In some cases, a reviewer may wait on approving a PR for landing until there is a plan in place for landing implementations for other platforms. This is not a hard rule, and will be up to reviewer judgement. This could take a number of forms:
|
||||
- Waiting for other PRs from the community that implement the feature for other platforms, and then moving forward with all of them at once.
|
||||
- Finding resources within the Flutter team for implementing other platforms before moving forward.
|
||||
- Landing the platform interface change and the platform implementations that are done, but waiting on one of the options above before adding the API to the app-facing package's API (allowing developers the option of drilling down to the platform implementation to use the feature on some platforms before it's ready everywhere).
|
||||
|
||||
"Other platforms" might not always include all other platforms. E.g., a feature might be something that's much more likely to be useful on mobile than desktop, or the reverse, and so we might only wait for implementations of that subset. Again, this will be up to reviewer judgement.
|
||||
|
||||
In the case where a PR is put on hold for the reasons above, it should be clearly noted in the PR and on the associated issue. We encourage anyone interested in contributing more platform implementation PRs to comment in the bug in such cases.
|
||||
|
||||
### API support queries
|
||||
|
||||
In cases where a plugin offers API in the app-facing package that is not implemented on all platforms (or not implemented on some OS versions of some platforms), there should also be an API to query for support of that API at runtime. That is, plugin clients should always be able to write code like:
|
||||
|
||||
```dart
|
||||
if (somePluginInstance.supportsDoingThing) {
|
||||
somePluginInstance.doThing();
|
||||
}
|
||||
```
|
||||
|
||||
rather than hard-coding a platform check. (See [`image_picker`'s `supportsImageSource`](https://github.com/flutter/packages/blob/9323e33ed9d8345d87514711dcaeb4cf4159ad1c/packages/image_picker/image_picker/lib/image_picker.dart#L309-L315) for an example.) This is for several reasons:
|
||||
- It is federation-friendly: a new implementation of the plugin (including the addition of 1P support for a previously-unsupported platform) will automatically be covered.
|
||||
- It allow seamless adoption of new functionality: if we add previously-missing support to an existing implementation, clients will automatically benefit without any code changes on their part.
|
||||
- It makes our own documentation more evergreen: we've frequently had app-facing APIs that had a comment saying that an API is only available on platform X, and then forgotten to update it when adding support for platform Y.
|
||||
|
||||
These APIs can take a variety of forms, including specific methods to check individual methods or parameters, a single method with an enum of API options, etc. Discuss with your reviewer what pattern is best suited to the specific case, and aim for consistency within a plugin when possible.
|
||||
|
||||
*We currently have many cases of APIs that do not follow this guidance because they predate it. This is technical debt, rather than something that should be pointed to as a justification for adding new APIs that do not.*
|
||||
|
||||
## Languages
|
||||
|
||||
On some platforms, there are multiple native languages that can be used to write plugins; repository policy limits the languages that are used in some cases. These are currently the allowed languages for each platform:
|
||||
- Android: Depends on the plugin; mixing languages within a plugin is currently not allowed:
|
||||
- Kotlin if the plugin is already in Kotlin.
|
||||
- Currently our policy is to have a limited number of plugins in Kotlin, to ensure that we are finding Kotlin-specific plugin issues in our own development.
|
||||
- Java if the plugin is already in Java (which is almost all of them).
|
||||
- Allowing Kotlin more broadly is [under consideration](https://docs.google.com/document/d/1Ok_mUPgmw8_l-ynLueEKtXm2Fs48lEVB0JqZd7M7uyA/edit?usp=sharing), but currently most plugin development is limited to Java to avoid adding another language to the set of languages Flutter team members need to interact with regularly.
|
||||
- If you are interested in taking on a **long-term ownership role in a plugin**, and would like to migrate it to Kotlin, please reach out in the `hackers-ecosystem` channel [on Discord](https://github.com/flutter/flutter/wiki/Chat).
|
||||
- iOS: Depends on the plugin. The goal is to eventually migrate all plugins to Swift; see [the migration section below](#swift-migration-for-1p-plugins) for details. For non-migration PRs, use:
|
||||
- Swift if the plugin is entirely Swift.
|
||||
- Swift or Objective-C if the plugin is partially migrated.
|
||||
- Objective-C if the plugin is still entirely Objective-C.
|
||||
- Linux: C. Use of C++ constructs is strongly discouraged; see [repo style notes](https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style) for details
|
||||
- macOS: Swift only\*.
|
||||
- \* In some cases an existing iOS implementation has been updated to support macOS, so is Objective-C (e.g., `in_app_purchase`). This is the only case where Objective-C is allowed for macOS plugins.
|
||||
- Windows: C++.
|
||||
- Web: Dart.
|
||||
|
||||
For all platforms, use of Dart for platform-specific features is both allowed and encouraged. While there are no specific rules about this in most plugins, in general we are moving toward having more logic written in Dart rather than a host language, as having more code in the project's primary language eases maintenance.
|
||||
|
||||
## Changing federated plugins
|
||||
|
||||
Most of the plugins in flutter/packages are [federated](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins). Because a logical plugin consists of multiple packages, and our CI tests using published package dependencies—in order to ensure that every PR can be published without breaking the ecosystem—changes that span multiple packages will need to be done in multiple PRs. This is common when adding new features.
|
||||
|
||||
We are investigating ways to streamline this, but currently the process for a multi-package PR is:
|
||||
|
||||
1. Create a PR that has all the changes, and update the pubspec.yamls to have path-based dependency overrides. This can be done with the [plugin repo tool](https://github.com/flutter/packages/blob/main/script/tool/README.md)'s `make-deps-path-based` command, targeting any dependency packages changed in the PR. For instance, for an Android-specific change to `video_player` that required platform interface changes as well:
|
||||
```
|
||||
$ dart run script/tool/bin/flutter_plugin_tools.dart make-deps-path-based --target-dependencies=video_player_platform_interface,video_player_android
|
||||
```
|
||||
|
||||
1. Upload that PR and get it into a state where the only test failure is the one complaining that you can't publish a package that has dependency overrides, then go through the normal process of getting reviews and approvals.
|
||||
* The overall review is completed first to prevent situations where part of the overall change (usually a platform interface change) lands but the rest is never landed, or where the review of the changes in a higher-level part of the change (the app-facing and/or implementation packages) identifies issues in the lower-level parts.
|
||||
|
||||
1. **Once the combined PR is approved**, create a new PR that has only the platform interface package changes from the PR above, and ask the reviewers of the main package to review that.
|
||||
* This review is generally trivial (unless the CI finds an issue that wasn't noticed in the main PR) since it's a subset of the PR that was already reviewed.
|
||||
|
||||
1. Once it has been reviewed, landed, and published, update the initial PR to:
|
||||
* remove the changes that are part of the other PR,
|
||||
* replace the dependency overrides on the platform interface package with a dependency on the published version, and
|
||||
* merge in (or rebase to) the latest version of `master`.
|
||||
|
||||
1. If there are any dependency overrides remaining, repeat the previous two steps with those packages. There should never be interdependencies between platform implementation packages, so all implementations should be able to be handled in a single new PR.
|
||||
* If new functionality is being added to the API surface of the app-facing package, be sure to update the version constraints of the implementation packages in its `pubspec.yaml`. Even though it's possible to compile with only the interface package's constraint updated, we don't want clients of the package who update without using `pub upgrade` to have surprising failures (e.g., `UnimplementedError`s) when using the new functionality due to not having the updated platform packages that implement the new feature.
|
||||
|
||||
1. Once there are no dependency overrides, ask the reviewer to land the main PR.
|
||||
|
||||
### Breaking changes to plugin platform interfaces
|
||||
|
||||
Breaking changes to platform interfaces (any package ending in `_platform_interface`) are strongly discouraged:
|
||||
- They require each platform implementation to adopt the new version, and the app-facing package can't pick up any of those changes until all implementations have been updated. This could cause situations where bug fixes for one platform are held up on another platform adopting a feature change.
|
||||
- They require a series of changes to CI to selectively disable testing the latest versions of all packages, then later re-enable them.
|
||||
- They temporarily lock out unendorsed implementations, until their developers can update.
|
||||
|
||||
Because platform interfaces are not expected to be called by clients of the plugins, we favor backward compatibility over having a clean API at that layer.
|
||||
|
||||
In order to avoid accidental breaking changes that are missed in review, CI will by default fail for any breaking change to the platform interface. If you believe you need to make a breaking change, discuss with your reviewer and make sure they agree; once they do, add (or if you are not a project member, ask the reviewer to add) the `override: allow breaking change` label, then re-run the failing check. You should also adding something like the following to the PR description:
|
||||
```
|
||||
## Breaking change justification
|
||||
|
||||
<Insert good reason for breaking change here.>
|
||||
```
|
||||
|
||||
This makes it easy for someone looking back at the change to find the reason for the breaking change without reading all of the comments.
|
||||
|
||||
### Changing platform interface method parameters
|
||||
|
||||
Because platform implementations are subclasses of the platform interface and override its methods, almost *any* change to the parameters of a method is a breaking change. In particular, adding an optional parameter to a platform interface method *is* a breaking change even though it doesn't break callers of the the method.
|
||||
|
||||
The least disruptive way to make a parameter change is:
|
||||
|
||||
1. Add a new method to the platform interface with the new parameters, whose default implementation calls the existing method. This is not a breaking change.
|
||||
1. Strongly consider replacing some or all of the parameters with a parameter object (see [`AuthenticationOptions`](https://github.com/flutter/packages/blob/0ba896b35b2f33517c38ccbb1654ed646ad07af7/packages/local_auth/local_auth_platform_interface/lib/types/auth_options.dart#L7-L9) for [`authenticate`](https://github.com/flutter/packages/blob/0ba896b35b2f33517c38ccbb1654ed646ad07af7/packages/local_auth/local_auth_platform_interface/lib/local_auth_platform_interface.dart#L60) as an example), as this will allow adding other parameters in the future without breaking changes or new methods.
|
||||
2. Mark the old method as `@Deprecated`, and file an issue about updating all uses of that method in the other packages in the plugin.
|
||||
|
||||
Note: The delegation of this method will feel backwards, because the implementing the new method in terms of the old method will discard the information from the new parameters. This is correct though, because the goal is to allow the app-facing package to call the new method regardless of whether implementation packages have implemented it. By forwarding to the existing method by default, implementation packages that haven't been updated will continue to have the behavior they had before (which, by necessity, won't include support for the new parameters). Implementation packages that have been updated will override this implementation with their own that honors the new parameters.
|
||||
|
||||
2. Update the implementations to override both methods.
|
||||
|
||||
* Usually this will involve having the old method call the new method (the opposite of the delegation done above in the interface package), or in some cases extracting a private helper method that both versions call.
|
||||
|
||||
3. Update the app-facing package to call the new method.
|
||||
|
||||
At some later point the deprecated method can be cleaned up by:
|
||||
|
||||
1. Making a breaking change in the platform interface package to remove any deprecated methods.
|
||||
|
||||
2. Updating the app-facing package to allow either the new major version or the previous version of the platform interface (to minimize version lock issues with implementations).
|
||||
|
||||
3. Updating all the implementations to use the new major version, removing the override of the deprecated methods.
|
||||
|
||||
This cleanup step is low priority though; deprecated methods in a platform interface should be largely harmless, as it's an API with very few direct customers. It's actually preferable to wait quite some time before doing this, as it gives any unendorsed third-party implementations that may exist more time to adapt to the change without disruption.
|
||||
|
||||
## Supported Flutter versions
|
||||
|
||||
flutter/packages has a general policy of supporting the latest `stable` version of Flutter, as well as the current `master`. In practice, many packages often support older versions as well, as minimum version requirements are generally only updated when there is a specific need, such as using a new Flutter feature.
|
||||
- One exception is new packages which require features that aren't yet available on `stable`. In this rare case, discuss with `#hackers-ecosystem` as it requires adding conditional logic to the CI scripts.
|
||||
|
||||
Most CI only runs against those two version. There are only minimal tests of versions older that current `stable` (currently analysis only, for the previous two stable versions of Flutter).
|
||||
|
||||
### When to update the required version
|
||||
|
||||
- If you know your change requires a feature of Flutter that was added recently, you should update the minimum version accordingly. In particular, if your change was originally written against `master` and had to wait until a change reached `stable`, that means you need to update the minimum version. (Adding a constraint update as soon as the PR fails on `stable` tests is a good way to make sure you don't forget.)
|
||||
- If your change requires a newer version of Flutter than is available on `stable`, and it can't wait until that feature reaches `stable`, ask in `#hackers-ecosystem` to see if there's a good solution.
|
||||
- If your change fails a `*_legacy` CI test, update the minimum version accordingly.
|
||||
|
||||
The ecosystem team may also mass-update minimum versions from time to time, to reduce the potential of breaking untested versions (see below). In general, this should use a minimum version somewhat older than the current `stable`, but in some special cases may use the current stable version instead.
|
||||
|
||||
### Handling breakage in old versions
|
||||
|
||||
Sometimes a change to a package accidentally breaks older version of Flutter; because the full CI test suite does not run anything older than the current stable, such breakage will not necessarily be caught by CI, and will only be discovered via issue reports. When that happens there are several options:
|
||||
- If the breakage is found quickly enough that retraction is still possible:
|
||||
- Retract the latest release.
|
||||
- Release a new version that is identical except for updating the minimum Flutter version.
|
||||
This minimizes disruption to developers using old versions of Flutter, with no effect on people using current versions.
|
||||
- Otherwise, there are several options; discuss with `#hackers-ecosystem` to decide which makes sense for the specific case:
|
||||
1. Release a new update that restores compatibility with the old version. This should generally only be done if it's trivial to do so.
|
||||
1. Release a revert, then release a new version that reverts the revert but with a constraint update. Consider this option if the number of people affected is likely to be large (e.g., a popular plugin is broken for the previous stable version of Flutter shortly after a stable release). This has essentially the same outcome as retraction, but can be done at any time.
|
||||
1. Document the need to pin an old version of the package in the issue, and close it (along with making a `## NEXT` PR for the package that updates its minimum version, to document the correct reality). This will require all affected users to find the issue to learn how to fix it, so should generally only be done if the number of people affected is likely to be small (e.g., when it only affects versions of Flutter that are several stable releases behind).
|
||||
|
||||
## Plugin architecture conventions
|
||||
|
||||
All plugins in flutter/packages should follow the following conventions. Note that existing plugins do not currently always follow those conventions because they predate them. PRs that update plugins to follow conventions are welcome.
|
||||
|
||||
### Federation
|
||||
|
||||
All plugins should be fully [federated](https://docs.flutter.dev/development/packages-and-plugins/developing-packages#federated-plugins). This is to ensure that:
|
||||
- Unofficial federated implementations can be created for any of our plugins. This allows for alternate implementations, as well as supporting unofficial embeddings.
|
||||
- Our development processes for federated plugins also helps ensure that we don't accidentally break any such implementations. For instance, our federated safety checks help ensure that we don't make breaking changes to the platform interface without changing the major version.
|
||||
- We are eating our own dogfood with federation. Federation adds non-trivial complexity to maintaining a plugin, and best practices for federation aren't always obvious. Using federation ourselves means that we are aware of potential issues, and encourages us to create documentation and tooling to improve the developer experience of using federation.
|
||||
|
||||
The only exception to this policy is plugins that are inherently specific to a single platform, such as `espresso`.
|
||||
|
||||
### In-package platform channels
|
||||
|
||||
All implementations should use in-package platform channels, for the reasons outlined in [the proposal document](https://flutter.dev/go/platform-channels-in-federated-plugins). Most plugins that predate this policy and have a legacy "shared method channel" default implementation in the platform interface package, but it is not be used by any first-party implementations.
|
||||
|
||||
### Platform exception handling
|
||||
|
||||
Having consistent error handling across platforms is an important part of providing a usable cross-platform API surface. Maintaining consistent errors directly from the native implementations is challenging since there is no easy way to share constants for error code strings across all the different languages, nor any clear reference point for what the possible errors are without reading all of the other implementations. It's also challenging to make changes, as it potentially requires changing every package in the federated plugin.
|
||||
|
||||
To ensure that the native errors are a coherent part of the interface, plugins that can throw `PlatformException`s internally should follow these best practices:
|
||||
- The platform interface package should define a clear, structured error system as part of its interface. Options include:
|
||||
- A plugin-specific `Exception` subclass, including constants or enums for known error types (e.g., permission failures).
|
||||
- An alternate structured error-returning mechanism, such as return values that include either a successful value or an error state (e.g., result classes, or Dart 3 patterns and records).
|
||||
- App-facing packages should `export` that definition, and should include it in relevant API documentation.
|
||||
- Implementation packages should, in general, have Dart code to catch any `PlatformExceptions` that the native implementation is likely to throw, and convert them to the appropriate interface-defined error types.
|
||||
- This means that the string constants for error codes returned from native need only be consistent within that platform implementation package, since it won't be passed out of the package (and thus only need to be kept in sync between two languages).
|
||||
|
||||
This means that in general, clients of a plugin should not be expected to see raw `PlatformException`s created from error responses in native code. (This is not a strict rule; failure cases that are so obscure that clients would be unlikely to actually have specific handlers for them don't necessarily need to be converted to a common exception type.)
|
||||
|
||||
**Note:** Existing `PlatformException`s are a de-facto part of the API, so updating plugins to follow this practice should be done as a breaking change.
|
||||
|
||||
### Enum handling
|
||||
|
||||
The best practice for doing `switch`es over `enum`s varies depending on the situation:
|
||||
- If the `enum` is defined in the same package as the `switch`, the `switch` should cover all cases with no fallback, as it can be updated at the same time as any changes to the enum.
|
||||
- If the `enum` is defined in a different package—this is not uncommon in federated plugins—the code should be robust against new enum values (unless it is just example code), since adding enum values is generally not considered a breaking change:
|
||||
- Do not use `default:`; instead put the fallback code outside the enum. This will cause the linter to flag code in other packages that we need to update when an `enum` is changed. (This will often require the use of `ignore: dead_code`.) The fallback is needed because even though we can and should [update the package(s) containing the `switch` as a follow-up](https://github.com/flutter/flutter/issues/89866), we **cannot** guarantee that someone won't use an older version of the package containing the `switch` with a newer version of the package containing the `enum`, so that combination must have some well-defined behavior.
|
||||
- When there is a reasonable default, use that so that the package continues to work, even if it's not the ideal behavior.
|
||||
- When there is no reasonable default, throw a clear `UnimplementedError` so the client knows they need a new version of the package.
|
||||
|
||||
## README code
|
||||
|
||||
All new code samples in `README.md` files must `<?code-excerpt?>` pragmas to manage the code. With `<?code-excerpt?>`, the source of truth for the code is an actual Dart file, which is analyzed, compiled, and tested by our CI. This ensures that it stays updated as the package APIs, Flutter, Dart, and repository analyzer settings change.
|
||||
|
||||
### Updating `<?code-excerpt?>`-managed examples
|
||||
|
||||
If a code block has a `<?code-excerpt ...?>` tag just before it, it is already using `code-excerpt`. To update it:
|
||||
1. Find the file referenced in that tag (e.g., `<?code-excerpt "lib/main.dart (AppLifecycle)"?>` comes from `lib/main.dart`; if there is a `<?code-excerpt path-base=""?>` directive earlier in the file, paths are resolved relative to the given `path-base` instead of the markdown file's path).
|
||||
2. Update the code in that file. If you are fixing a bug, add unit tests or widget tests for the change.
|
||||
3. Run the `update-excerpts` [repository tool command](https://github.com/flutter/packages/blob/main/script/tool/README.md#update-readmemd-from-example-sources), which will update `README.md`. From the root of the packages repository, the command to run this is: `dart run script/tool/bin/flutter_plugin_tools.dart update-excerpts`
|
||||
|
||||
### Add or converting a code block
|
||||
|
||||
To add a new code block, or fix a legacy code block:
|
||||
|
||||
1. Optionally, if this is the first code block to be added, add the following line to the start of the package's `README.md`:
|
||||
|
||||
```
|
||||
<?code-excerpt path-base="example/lib"?>
|
||||
```
|
||||
|
||||
replacing `example/lib` with the directory from which samples will be taken. This sets the base against which other paths are resolved. By default, the base is the path of the markdown file being updated. The base itself is resolved relative to the path of that file as well.
|
||||
|
||||
2. Find or write the code that you want to use in the example, then annotate it with `#docregion` and `#enddocregion` comments. Ideally the code should be in one of the examples, but you could also put the code in a test. The key is to put the code somewhere that is analyzed and, ideally, tested in CI.
|
||||
|
||||
For example:
|
||||
|
||||
~~~
|
||||
// #docregion purple
|
||||
const Color purple = Color(0xFFE6E6FA);
|
||||
// #enddocregion purple
|
||||
~~~
|
||||
|
||||
3. Reference the code from the `README.md` (or other markdown file where you want the sample to appear):
|
||||
|
||||
~~~
|
||||
<?code-excerpt "{example/lib/-relative filename} ({excerpt name})"?>
|
||||
```dart
|
||||
```
|
||||
~~~
|
||||
|
||||
So if you added `#docregion Foo` to `example/lib/main.dart` and specified `example/lib` as the path base, you would put the following in `README.md`:
|
||||
|
||||
~~~
|
||||
<?code-excerpt "main.dart (Foo)"?>
|
||||
```dart
|
||||
```
|
||||
~~~
|
||||
|
||||
4. Follow the steps in the "Updating" section above to automatically fill the new block with the code excerpt.
|
||||
|
||||
### Documentation
|
||||
|
||||
Samples can come from any file. In XML and HTML files, use `<!--#docregion sectionname-->` and `<!--#enddocregion sectionname-->`. In CSS files, use `/* #docregion sectionname */` and `/* #enddocregion sectionname */`. In YAML files, use `# #docregion sectionname` and `# #enddocregion sectionname`. In C++, Dart, JS, Kotlin, Swift, and other similar languages, use `// #docregion sectionname` and `// #enddocregion sectionname`.
|
||||
|
||||
You can extract multiple segments into one sample by just having multiple docregions with the same name. The regions will be concatenated with a language-appropriate comment such as `// ···`. You can control what this looks like by using the `plaster` control, as in:
|
||||
|
||||
<?code-excerpt "main.dart (Foo)" plaster="more..."?>
|
||||
```dart
|
||||
```
|
||||
|
||||
To disable this feature, use `plaster="none"`.
|
||||
|
||||
The plaster is indented as much as the `#enddocregion` of the region where the splice occurs.
|
||||
|
||||
Regions are maximally unindented before being injected into the markdown files (while preserving relative indentation within the block).
|
||||
|
||||
## Swift Migration for 1P Plugins
|
||||
|
||||
### Preparation
|
||||
|
||||
1. Read the [Swift migration design doc](https://docs.google.com/document/d/1XsaulkJA6_ZSpM7chkQLhQY25sQqhEMiqHMYzw8H85o/edit?resourcekey=0-_cUjF1c0iBvRLKfV-3gK5A), which covers several important topics such as the ["top down approach"](https://docs.google.com/document/d/1XsaulkJA6_ZSpM7chkQLhQY25sQqhEMiqHMYzw8H85o/edit?resourcekey=0-_cUjF1c0iBvRLKfV-3gK5A#heading=h.reauq7bq8vak). Feel free to leave any comments and feedback in the doc.
|
||||
|
||||
2. Read Google's [Swift Style Guide](https://google.github.io/swift/) and Apple's [API Design Guidelines](https://www.swift.org/documentation/api-design-guidelines/) (which is endorsed by Google's Swift Style Guide).
|
||||
|
||||
3. Pick a plugin that you are interested in from the [umbrella GitHub issue](https://github.com/flutter/flutter/issues/119015). This is for multiple contributors to coordinate with each other, and to avoid duplicate or conflicting work.
|
||||
|
||||
### Project Settings
|
||||
|
||||
1. Remove custom modulemap ([example](https://github.com/flutter/plugins/pull/6229/files)). This is due to a limitation in Cocoapods ([details](https://github.com/flutter/plugins/pull/6369#issue-1363961940)). This unfortunately means that we cannot use `Test` submodules, and all ObjC headers are exposed publicly during the migration.
|
||||
|
||||
2. Add Swift dependency information to the podspec ([example](https://github.com/flutter/packages/blob/617f9d99954fe394dc91258c431c9a2626921e08/packages/quick_actions/quick_actions_ios/ios/quick_actions_ios.podspec#L17-L22)). Note that `.h` and `.m` should be removed from the `spec.source_files` after migration is done.
|
||||
|
||||
3. After the plugin class is migrated to Swift, update `pluginClass` in `pubspec.yaml` ([example](https://github.com/flutter/packages/blob/617f9d99954fe394dc91258c431c9a2626921e08/packages/quick_actions/quick_actions_ios/pubspec.yaml#L16)).
|
||||
|
||||
### Format your Swift code
|
||||
|
||||
1. Install [swift-format](https://github.com/apple/swift-format). If you also contribute to the flutter engine, there is [an issue](https://github.com/flutter/flutter/issues/41129#issuecomment-1400812109) with the swift-format under `depot_tools`. Make sure to set up the export PATH properly to run your own copy of `swift-format`.
|
||||
|
||||
2. Run `./script/tool_runner.sh format`
|
||||
|
||||
### Testing
|
||||
|
||||
To reduce the risk of regression, it is important to backfill unit tests to full coverage before the migration, and maintain full coverage during the migration. If possible (i.e., if adding testing does not require refactoring the plugin to make it testable), adding test coverage should be done in a separate PR before the conversion of the implementation.
|
||||
|
||||
We do not report code coverage on the CI, since the number can actually be misleading (for example, a 100% coverage may make PR reviewers think that everything is fine, which is not necessarily true). Instead, you (and your PR reviewer) should evaluate whether the test is complete, by actually reading the test code (rather than just looking at the coverage). You may well want to use a coverage tool as part of your evaluation.
|
||||
|
||||
During the migration, especially when backfilling tests, it is possible to discover existing bugs. Migration PRs should just focus on migration and should not contain bug fixes. You can either (1) fix the bug in ObjC first in a separate PR, or (2) if the bug is too hard to fix, just acknowledge the bug in a comment so that someone can fix it in the future.
|
||||
139
docs/unsorted_wiki/Contributor-access.md
Normal file
139
docs/unsorted_wiki/Contributor-access.md
Normal file
@@ -0,0 +1,139 @@
|
||||
For people who make the occasional contribution to Flutter (filing an issue, submitting the occasional PR, chatting on Discord), the default set of permissions is fine. However, if you are a frequent contributor, whether helping us in triage, or often fixing bugs, or regularly improving our documentation, or regularly helping others in our #help channel, or participating in high-level design discussions and prioritization, you may find your life is more pleasant with commit access (also known as "contributor access", "being a member of the flutter-hackers group", "being a member of the Flutter team").
|
||||
|
||||
We grant commit access (which includes full rights to the issue database, such as being able to edit labels, and grants access to our internal chat channels) to people who have gained our trust and demonstrated a commitment to Flutter.
|
||||
|
||||
Specifically, if you meet one of the following criteria and you have a sponsor (someone who already has contributor access and agrees that you should be granted access), then please ask your sponsor to propose, on the #server-support [[chat]] channel, that you be made a member of the team, and then reply to that message explaining which criteria below you are claiming to meet. The possible criteria are:
|
||||
|
||||
* You have a long history of participating productively, e.g. in our [[chat]] channels, helping with [[Triage]], helping other contributors track down problems, finding meaningful issues in submitted PRs, helping people in our #help channel, etc, all while demonstrating exemplary behavior that closely aligns with our [code of conduct](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md).
|
||||
* You have recently submitted several PRs that have landed successfully (received an LGTM, PR was merged, no regressions reported, PR was not reverted), without needing extensive tutoring in the process.
|
||||
* You are employed by a company with a history of contributing to Flutter, for the purpose of yourself regularly contributing to Flutter.
|
||||
* You represent a development team that creates applications, plugins, or packages using Flutter and have a close relationship with our developer relations team, including having a customer label, and have a great need to regularly update labels on issues (see [Issue hygiene, Customers](https://github.com/flutter/flutter/wiki/Issue-hygiene#customers)). (This is rare.)
|
||||
|
||||
Being granted access means that you will be added to the "flutter-hackers" group on GitHub and the "team" role on Discord. This privilege is granted with some expectation of responsibility: contributors are people who care about Flutter and want to help Flutter along our [[roadmap]]. A contributor is not just someone who can make changes or comment on issues, but someone who has demonstrated their ability to collaborate with the team, get the most knowledgeable people to review code, contribute high-quality code, follow through to fix bugs (in code or tests), and provide meaningful insights on issues.
|
||||
|
||||
We grant access optimistically based on a reasonably small volume of evidence of good faith. Correspondingly, we will remove access quickly if we find our trust has been violated. Contributors with commit access must still follow all our processes and policies, and must follow our [code of conduct](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md) rigorously. (Please read it, it's stricter than most.)
|
||||
|
||||
|
||||
### Responsibilities
|
||||
|
||||
#### Code of conduct
|
||||
|
||||
If you have commit access or "team" access on the Discord server, you are responsible for enforcing our [code of conduct](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md).
|
||||
|
||||
Our code of conduct is much, much stricter than most. We do not wait until someone has been actively rude or insulting. Being disrespectful in any way is grounds for action. For example, passive-aggressive whining and general unconstructive negativity are all violations of the code of conduct. If someone is in a bad mood, we would rather they avoided contributing to Flutter on that day.
|
||||
|
||||
When you see something that might be described as unwelcoming or is in some other way a violation of our code of conduct, promptly contact the offender and ask them to read the code of conduct and consider how they might more effectively espouse its philosophy. Most people react very positively to this.
|
||||
|
||||
If they react negatively, or if they continue to make the environment unpleasant, they should be removed from the environment. On Discord, this would be kicking them from the channel. Repeat offenders should be banned. On GitHub, they can be blocked from our organisation (you may need to ask @Hixie or another admin of our GitHub org to do this). Please let the #server-support [[chat]] channel know when you do anything like this, so that we can keep an eye on how common it is.
|
||||
|
||||
#### Maintaining documentation
|
||||
|
||||
Part of being a contributor is making sure our documentation is up to date, including our internal (team-facing) documentation such as this wiki. If you spot something wrong, please fix it! As a contributor, you have access to the wiki.
|
||||
|
||||
For the wiki specifically, since there's no code review, it's good to mention on Discord that you've made a change when you make one.
|
||||
|
||||
### Privileges
|
||||
|
||||
Being in the GitHub "flutter-hackers" group gives you the following:
|
||||
|
||||
* The ability to merge your own PRs once they are reviewed (see [[Tree Hygiene]]).
|
||||
|
||||
* The ability to add labels, milestones, etc, on issues on GitHub (see [[Issue Hygiene]]).
|
||||
|
||||
* PRs will run their tests slightly faster.
|
||||
|
||||
Being in the Discord "team" group gives you the following:
|
||||
|
||||
* The ability to talk without rate-limiting on the #hackers-* channels.
|
||||
|
||||
* The ability to kick people.
|
||||
|
||||
* The ability to manage the server emoji.
|
||||
|
||||
|
||||
## Process
|
||||
|
||||
The actual process (as followed by Flutter repo admins) is as follows:
|
||||
|
||||
1. Verify that they qualify under all the terms described above. Make sure they have a sponsor who isn't you.
|
||||
1. Verify the identity of the person making the request. Ask them to confirm, on Discord, that they have read the style guide, issue or tree hygiene wiki page, code of conduct, and other documents relevant to them.
|
||||
1. Add them to our private spreadsheet (go/flutter-organization-members).
|
||||
1. Click the "Add a member" button on [the flutter-hackers team page](https://github.com/orgs/flutter/teams/flutter-hackers/members) on GitHub.
|
||||
1. Type their name in the text field, select them, then click the "Invite" button.
|
||||
1. Add them to the "team" group on Discord. Be sure to verify that you are promoting the right person; multiple people can have the same nickname on Discord!
|
||||
|
||||
*For new Googlers joining the team*: You need to ask someone in the team to add you to get added. It's not an automatic process after you join the flutter Google group.
|
||||
|
||||
|
||||
## Inactivity
|
||||
|
||||
We occasionally check for account with commit access that have not been used for a while. It takes very little to count as "active" (e.g. commenting on an issue, even adding an emoji reaction to an issue). If your account has been inactive for over a year we will try to reach out (e.g. by e-mail or on Discord) before removing access.
|
||||
|
||||
If your account access was removed but you wish to return to contributing to Flutter, you are most welcome to do so; just reach out on the Discord (see [[Chat]]) and ask someone to renominate you according to the process described above.
|
||||
|
||||
|
||||
# Access rights to Flutter dashboard
|
||||
|
||||
The [Flutter dashboard](https://flutter-dashboard.appspot.com/) shows what recently landed and what tests passed or failed with those commits. To see rerun tasks, you need to be added to an allowlist. Anyone with commit access is eligible to be added to that allowlist, but only certain team members have the permissions required to update the backend database where the permissions are stored. To get access, ask on #hackers-infra to be added to the allowlist.
|
||||
|
||||
## Adding a contributor to Flutter Dashboard
|
||||
|
||||
*This is only for team members with access to the Flutter Dashboard Datastore.*
|
||||
|
||||
1. Open [flutter-dashboard datastore](https://console.cloud.google.com/datastore/entities;kind=AllowedAccount;ns=__$DEFAULT$__/query/kind?project=flutter-dashboard)
|
||||
2. Click `Create Entity`
|
||||
3. Click `Email: Empty` -> Edit property. Insert contributor Google account
|
||||
4. Click `Create`
|
||||
|
||||
# Access to LUCI recipes and configuration repositories
|
||||
|
||||
If you need access to the LUCI recipes, you need to be added to the relevant ACLs. Ask in #hackers-infra to be added to the LUCI ACLs.
|
||||
|
||||
## Process
|
||||
|
||||
A Googler has to be the one to grant permission. Documentation on how to use the relevant tools is available at: https://goto.google.com/gob-ctl#add-or-remove-users-in-host-acl
|
||||
|
||||
# Access to Flutter Gold
|
||||
|
||||
If you need access to triage images in [Flutter Gold](https://flutter-gold.skia.org/), you need to be added as an authorized user.
|
||||
Users in the `@google.com` domain are already authorized to use Flutter Gold, but `@gmail.com` addresses can also be added to the allow list.
|
||||
|
||||
## Process
|
||||
The list of authorized users is maintained in the [skia build-bot repository](https://skia.googlesource.com/buildbot), in [this file](https://skia.googlesource.com/buildbot/+/refs/heads/master/golden/k8s-instances/flutter/flutter-skiacorrectness.json5). Googlers can submit a change to add to the authorized users.
|
||||
|
||||
This repository is also [mirrored on GitHub.](https://github.com/google/skia-buildbot)
|
||||
|
||||
# fcontrib.org accounts
|
||||
|
||||
If you are a team member who wants to share design docs (see [[Chat]]) but you don't want to use your own personal account, you can ask a Flutter admin for an fcontrib.org account. Ping @Hixie or another admin in the #server-support channel on Discord.
|
||||
|
||||
## Process
|
||||
|
||||
You’ll need the user’s email account somewhere else, first and last name, and desired fcontrib.org account login before you begin.
|
||||
|
||||
To add a fcontrib.org participant:
|
||||
1. Open an incognito window and log in using _your_ admin fcontrib credentials at https://admin.google.com/. (q.v. valentine)
|
||||
2. Under “Users” in the upper left of the main content area, click “Add a User” and follow the prompts.
|
||||
3. For a password, choose “Generate Password” and email the password to the new account holder using their non-fcontrib account -- they’ll be able to log in with that and then choose a new password.
|
||||
|
||||
# Review teams
|
||||
|
||||
Some parts of the codebase have teams specified so that PRs get round-robin assigned for review.
|
||||
|
||||
To join one of these teams, request members be added/deleted, or change any settings, ping @Hixie on Discord. Members must be a member of the Flutter Hackers group (as documented at the top of this page).
|
||||
|
||||
We currently have the following review teams:
|
||||
|
||||
* [`android-reviewers`](https://github.com/orgs/flutter/teams/android-reviewers): for folks working on the Android port of Flutter; use `#hackers-android` for discussions.
|
||||
* [`devtools-reviewers`](https://github.com/orgs/flutter/teams/devtools-reviewers): for the [devtools](https://github.com/flutter/devtools) repo; use `#hackers-devexp` for discussions.
|
||||
* [`website-reviewers`](https://github.com/orgs/flutter/teams/website-reviewers): for folks working on www.flutter.dev and docs.flutter.dev; use `#hackers-devrel` for discussions.
|
||||
|
||||
To create a new team, contact @Hixie. You will also need to create a `CODEOWNERS` file to actually trigger the review assignment.
|
||||
|
||||
# Pusher permissions
|
||||
|
||||
Some branches are protected to avoid accidents. Only people in the specific branches can push to them. Anyone can ask to be added or removed from these groups, they exist only to reduce accidents, not for security.
|
||||
|
||||
To join one of these teams, request members be added/deleted, or change any settings, ping @Hixie on Discord. Members must be a member of the Flutter Hackers group (as documented at the top of this page).
|
||||
|
||||
The following groups have been defined for these purposes: pushers-beta, pushers-fuchsia
|
||||
134
docs/unsorted_wiki/Crashes.md
Normal file
134
docs/unsorted_wiki/Crashes.md
Normal file
@@ -0,0 +1,134 @@
|
||||
## Symbolicating stack traces for engine crashes
|
||||
|
||||
The easiest way to symbolicate stack traces for Android and iOS is running the [dart_ci symbolizer locally](https://github.com/dart-lang/dart_ci/blob/main/github-label-notifier/symbolizer/README.md#using-this-locally). If that is not an option, the steps below explain how to do it manually.
|
||||
|
||||
### Android
|
||||
|
||||
#### Get the symbols
|
||||
|
||||
1. Get the Flutter Framework or Flutter Engine revision from the report. If you have the Engine revision, skip to step 3.
|
||||
|
||||
2. Get the Engine revision from the Framework (this could be automated). https://github.com/flutter/flutter/blob/master/bin/internal/engine.version is the file which contains the information. Substitute the framework hash for `master` in that url.
|
||||
|
||||
3. With the full engine revision (e.g. cea5ed2b9be42a981eac762af3664e4a17d0a53f), you can now get the proper symbol files:
|
||||
|
||||
To view the available artifacts for a build, visit this URL in a browser (replacing the engine hash with your hash): `https://console.cloud.google.com/storage/browser/flutter_infra_release/flutter/cea5ed2b9be42a981eac762af3664e4a17d0a53f`
|
||||
|
||||
To download the symbols for android-arm, download this URL _using your browser_ (replacing the hash again, and noting that this URL is on a different host, "storage", compared to the one above, which uses "console"): `https://storage.cloud.google.com/flutter_infra_release/flutter/cea5ed2b9be42a981eac762af3664e4a17d0a53f/android-arm/symbols.zip`.
|
||||
|
||||
Please be aware that the type of the symbol must match your Apps release type. In above example, this refers to a android-arm **debug** build. If you work with a **release** or **profile** build, the URLs would look like this:
|
||||
|
||||
* https://storage.cloud.google.com/flutter_infra_release/flutter/cea5ed2b9be42a981eac762af3664e4a17d0a53f/android-arm-release/symbols.zip
|
||||
* https://storage.cloud.google.com/flutter_infra_release/flutter/cea5ed2b9be42a981eac762af3664e4a17d0a53f/android-arm-profile/symbols.zip
|
||||
|
||||
You have to use your browser because it does authentication.
|
||||
|
||||
#### Symbolicate with ndk-stack
|
||||
|
||||
Once you have the symbols unzipped, you can use ndk-stack from your Android NDK. Suppose `stack.txt` contains the stack (including the leading `*** *** ***` line from the crash):
|
||||
|
||||
```bash
|
||||
.../ndk/prebuilt/linux-x86_64/bin/ndk-stack -sym .../path/to/downloaded/symbols < stack.txt
|
||||
```
|
||||
|
||||
Or on macOS:
|
||||
```bash
|
||||
.../ndk/prebuilt/darwin-x86_64/bin/ndk-stack -sym .../path/to/downloaded/symbols < stack.txt
|
||||
```
|
||||
|
||||
Some debugging tools, like _pidcat_ may not show the full tombstone logs. In that case, please use `adb logcat` directly and copy the full output.
|
||||
|
||||
#### Symbolicate with addr2line
|
||||
|
||||
A alternative way to symbolicate is by using the addr2line tool. It is bundled with the NDK.
|
||||
To use it, simply call it with a path to the .so file downloaded above and feed the stack addresses to it manually. For example, on macOS:
|
||||
|
||||
```
|
||||
% $ANDROID_HOME/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-addr2line -e ~/Downloads/libflutter.so
|
||||
```
|
||||
_The tool is now awaiting your input, so let's feed it a memory address_:
|
||||
```
|
||||
0x00000000006a26ec
|
||||
/b/s/w/ir/cache/builder/src/out/android_release_arm64/../../third_party/dart/runtime/vm/dart_api_impl.cc:1366
|
||||
```
|
||||
This revealed address `0x00000000006a26ec` to correspond with `dart_api_impl.cc:1366`.
|
||||
|
||||
#### Making sure you got the right libflutter.so
|
||||
|
||||
The build system sets a build id for each `libflutter.so` file. In the tombstones, you would see the ID like so:
|
||||
|
||||
```
|
||||
#00 pc 000000000062d6e0 /data/app/com.app-tARy3eLH2Y-QN8J0d0WFog==/lib/arm64/libflutter.so!libflutter.so (offset 0x270000) (BuildId: 34ad5bdf0830d77a)
|
||||
```
|
||||
|
||||
This equals to a build id of **34ad5bdf0830d77a**. The `libflutter.so` debug files downloaded as shown above could be verified using the `file` command:
|
||||
|
||||
```
|
||||
% file ~/Downloads/libflutter.so
|
||||
/Users/user/Downloads/libflutter.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[xxHash]=34ad5bdf0830d77a, with debug_info, not stripped
|
||||
```
|
||||
|
||||
Ensure the build IDs match, else you will not be able to symbolicate.
|
||||
|
||||
#### Expanding Git Revisions
|
||||
|
||||
Go to a commit page with the short commit as the last fragment of the URL:
|
||||
(e.g. https://github.com/flutter/flutter/commit/9cb914df1 or https://github.com/flutter/engine/commit/2a13567) and then find the full revision on the page.
|
||||
|
||||
|
||||
#### Symbolicating local builds
|
||||
|
||||
If you have made your own builds, you can use ndk-stack directly:
|
||||
|
||||
```bash
|
||||
# dev/engine is where your engine's .gclient file is
|
||||
# android_debug_unopt is whatever build of your engine you are using
|
||||
adb logcat | ~/dev/engine/src/third_party/android_tools/ndk/prebuilt/linux-x86_64/bin/ndk-stack -sym ~/dev/engine/src/out/android_debug_unopt
|
||||
```
|
||||
|
||||
### iOS
|
||||
|
||||
The dSYM file for `Flutter.framework` (which is the Flutter Engine) for ios-release builds can be downloaded from Google Cloud Storage. Follow the steps from the Android section in this guide, but in the last step use a download url following this schema: `https://storage.cloud.google.com/flutter_infra_release/flutter/38a646e14cc25f5a56a989c6a5787bf74e0ea386/ios-release/Flutter.dSYM.zip` (replace the engine hash with your hash).
|
||||
|
||||
#### Symbolicating local builds
|
||||
|
||||
If you built your local engine in debug or profile Dart modes, the framework's dylib's symbols aren't stripped and are available by default.
|
||||
|
||||
#### Crashes in Dart AOT code
|
||||
|
||||
If the crash is in AOT Dart code (in `--release` or `--profile` builds) on iOS, and you can build your own engine, these steps will be helpful for the VM team to fix the bug:
|
||||
|
||||
* Prepare a reduced test case.
|
||||
* Compile the engine in profile mode and disable optimizations for symbolicated traces.
|
||||
* `sky/tools/gn --ios --unopt --runtime-mode profile; ninja -C out/ios_profile_unopt -j800`.
|
||||
* Launch the application via the Xcode project and make it crash in the debugger.
|
||||
* File a bug on [dart-lang/sdk](https://github.com/dart-lang/sdk/issues/new).
|
||||
* Dump the register state and paste it into the bug.
|
||||
* In `lldb`, `register read`.
|
||||
* Copy the backtrace and paste it into the bug.
|
||||
* In `lldb`, `thread backtrace`. Assumes you are on the thread that crashed. If not, `thread select n`.
|
||||
* Disassemble the last frame and paste it into the bug.
|
||||
* In `lldb`, `frame select 0` then `disassemble --frame`.
|
||||
* Disassemble using the `gen_snapshot` and paste the function into the bug for more detailed information.
|
||||
* In the backtrace, look for the name of the precompiled function that caused the crash.
|
||||
* Open `SnapshotterInvoke` from Xcode and to the `RunCommand ... Snapshotter` call, add the `--disassemble` flags.
|
||||
* Modify the `RunCommand` function to dump to a file.
|
||||
* Build again. The results should end up in the file.
|
||||
* Look for the function name (by substring match) in this file and copy out that information to the bug.
|
||||
* Ping someone on dart-lang/sdk.
|
||||
|
||||
|
||||
### Android Local Engine Builds
|
||||
|
||||
When running with a local engine build, the symbolization workflow can be cumbersome and unecessary. Instead, it is possible to build the engine itself with symbols and disable Gradle's automatic symbol stripping. This is also required to see symbol names in Android Studio CPU profiles.
|
||||
|
||||
1. In the android engine configuration, provide a --no-stripped argument to gn. For example: `gn --android --android-cpu=arm64 --unopt --no-stripped`
|
||||
|
||||
2. In the flutter project file `android/app/build.gradle`, add the following line under the `android` block:
|
||||
|
||||
```
|
||||
packagingOptions{
|
||||
doNotStrip "**/*.so"
|
||||
}
|
||||
|
||||
```
|
||||
23
docs/unsorted_wiki/Custom-Flutter-Engine-Embedders.md
Normal file
23
docs/unsorted_wiki/Custom-Flutter-Engine-Embedders.md
Normal file
@@ -0,0 +1,23 @@
|
||||
The Flutter Engine is window toolkit agnostic. If you want to build Flutter embedders on one of the platforms not supported out of the box (i.e, iOS & Android), this page is for you.
|
||||
|
||||
This is a very low level API and is not suitable for beginners.
|
||||
|
||||
* The window toolkit agnostic component of the Flutter engine is available as a dynamic library in the `flutter_engine` GN target in [`//shell/platform/embedder:flutter_engine`](https://github.com/flutter/engine/blob/080fbcb1759e5916f0d6cdcdfd945c053320e6b3/shell/platform/embedder/BUILD.gn#L51).
|
||||
* That target must be built as part of the host GN build. Such builds are already available for desktop Linux & Mac. If you want to target another platform, you will have to configure a GN toolchain for the same.
|
||||
* You may build this target yourself or download the same artifacts uploaded by the buildbots on each commit.
|
||||
* The Mac buildbot uploads the artifacts to a known location. Access it here [`https://storage.googleapis.com/flutter_infra_release/flutter/FLUTTER_ENGINE/darwin-x64/FlutterEmbedder.framework.zip`](https://storage.googleapis.com/flutter_infra_release/flutter/080fbcb1759e5916f0d6cdcdfd945c053320e6b3/darwin-x64/FlutterEmbedder.framework.zip).
|
||||
* Replace `FLUTTER_ENGINE` with the SHA of the Flutter engine you wish to use.
|
||||
* The Linux buildbot uploads the artifacts to a known location. Access it here [`https://storage.googleapis.com/flutter_infra_release/flutter/FLUTTER_ENGINE/linux-x64/linux-x64-embedder`](https://storage.googleapis.com/flutter_infra_release/flutter/080fbcb1759e5916f0d6cdcdfd945c053320e6b3/linux-x64/linux-x64-embedder)
|
||||
* Replace `FLUTTER_ENGINE` with the SHA of the Flutter engine you wish to use.
|
||||
* The binary is not stripped and contains debug information. Embedders are advised to strip the binary before deployment.
|
||||
* The Windows buildbot uploads the artifacts to a known location. Access it here [`https://storage.googleapis.com/flutter_infra_release/flutter/FLUTTER_ENGINE/windows-x64/windows-x64-embedder.zip`](https://storage.googleapis.com/flutter_infra_release/flutter/080fbcb1759e5916f0d6cdcdfd945c053320e6b3/windows-x64/windows-x64-embedder.zip)
|
||||
* Replace `FLUTTER_ENGINE` with the SHA of the Flutter engine you wish to use.
|
||||
* You can also obtain that SHA from the [`engine.version`](https://github.com/flutter/flutter/blob/master/bin/internal/engine.version) file in your Flutter framework checkout. This allows you to exactly match the engine version with the Flutter framework version.
|
||||
* The Flutter engine API has no platform specific dependencies, has a stable ABI and is available in its entirety in a [single C header file available here](https://github.com/flutter/engine/blob/main/shell/platform/embedder/embedder.h).
|
||||
* To use as a guide, you may use [this example embedder that uses GLFW](https://github.com/flutter/engine/blob/main/examples/glfw/FlutterEmbedderGLFW.cc) for window management and rendering.
|
||||
|
||||
While we do not object to teams creating custom builds of the Flutter engine for their purposes, we do not support this configuration. Not supporting it means that we do not commit to any timelines for fixing bugs that may come up in such a configuration, even for customers for which we would usually be willing to make commitments (see the [[Issue Hygiene]] page). It also means that we encourage teams to view such configurations as short-term solutions only and encourage teams to transition away from such configurations at the earliest possible opportunity.
|
||||
|
||||
We do not expect custom engine builds to be long-term sustainable. They are not supported on any platform where we plan to be the publisher of a Flutter runtime distinct from the applications that run on the runtime, and they require significant effort to port to our new target platforms such as Web and desktop. There is also an expensive maintenance burden (for example, if we add new features, a custom engine build would need to be updated to support that feature).
|
||||
|
||||
We would generally recommend using custom engine builds only when porting Flutter to platforms that are not supported out of the box, for example in embedded hardware.
|
||||
@@ -0,0 +1,132 @@
|
||||
This document is intended for developers of third party embedders who wish to package and ship their Flutter applications for AOT mode operation. A third party embedder uses [the stable C embedder API](https://github.com/flutter/engine/blob/869d9f528503778be1e5ab27ba53502f0cb20de2/shell/platform/embedder/embedder.h) to embed Flutter applications on their platform.
|
||||
|
||||
## Building an AOT Flutter Engine
|
||||
|
||||
By default, the Flutter engine packaged for embedders assumes that the mode of operation is JIT. An engine configured for JIT packages a VM that is incompatible with AOT snapshots. Build an AOT engine using the following invocation. This is also the invocation where custom target, sysroot and toolchain selection flags can be specified.
|
||||
|
||||
```
|
||||
./flutter/tools/gn --runtime-mode release <custom target flags as necessary>
|
||||
```
|
||||
|
||||
**Note:** Throughout this document, the `gn` flags mentioned work fine with other non-runtime mode or configuration selection options (stuff like `--no-lto`,` --unoptimized`, etc..). Such options are particularly useful during development and their use is highly encouraged.
|
||||
|
||||
This will produce a Flutter engine configured for AOT mode targeting the host. Note that we are repurposing Flutter’s “release” mode policy to prepare an AOT engine. The application of this policy to third party embedders is optional and a decision the authors of such embedders need to make themselves.
|
||||
|
||||
## Building the Architecture Specific `gen_snapshot`
|
||||
|
||||
The binary that converts Dart code to architecture specific AOT instructions is called `gen_snapshot`. A successful invocation of `gen_snapshot` should produce four binary blobs. These are the Dart VM heap and instructions snapshots as well as the isolate heap and instruction snapshots. Refer to the [wiki article on engine operation in AOT mode](https://github.com/flutter/flutter/wiki/Flutter-engine-operation-in-AOT-Mode) for the purpose of these snapshots.
|
||||
|
||||
A specific `gen_snapshot` can only produce AOT instructions for one target architecture. To verify that the `gen_snapshot` you have is producing instructions for the architecture you care about, invoke the same with the `--version` flag. It should produce something like the following.
|
||||
|
||||
```
|
||||
Dart VM version: 2.1.1-dev.2.0.flutter-ac1bf656c4 (Thu Jan 17 16:55:19 2019 +0000) on "macos_x64"
|
||||
```
|
||||
|
||||
The final string denotes the host/target pair. In the case of the example above, the host is `macos` and the target `x64`. An example of a `gen_snapshot` that produces instructions for `aarch64` would read “macos_simarm64” (the author is on MacOS X).
|
||||
|
||||
It is easiest to just pick the supported Flutter target whose architecture is closest to the one of the embedder. For example, if the target is `armv7`, the following invocation will generate a `gen_snapshot` that is suitably configured for that target.
|
||||
|
||||
```
|
||||
./flutter/tools/gn --android --runtime-mode release
|
||||
```
|
||||
|
||||
Another useful invocation for aarch64 AOT targeted `gen_snapshot` is:
|
||||
|
||||
```
|
||||
./flutter/tools/gn --android --runtime-mode release --android-cpu arm64
|
||||
```
|
||||
|
||||
**Important:** Calling convention and alignment must be the same (in addition to just the target architecture) for the AOT instructions generated by `gen_snapshot` and the target. Repurposing Flutter’s build targets makes sure that all those subtleties are taken care of. But it is still up to the embedder to pick and match the AOT instructions. For example, the `--android` --android-cpu arm64`configured`gen_snapshot`will not generate completely compatible instructions for iOS on`aarch64` (even though the target architectures are the same). A mismatch between the snapshot's architecture/ABI and the device's architecture/ABI will be detected when the snapshot is loaded and clearly reported.
|
||||
|
||||
## Building the AOT Snapshot
|
||||
|
||||
There are two separate steps involved in the generation of AOT instructions for the target architecture. First, a target architecture agnostic kernel snapshot (~AST) of the Flutter Dart application needs to be generated. Then, this snapshot is given to `gen_snaphost` which generates the AOT snapshot in the form of the four blobs (~machine code) listed above (and detailed on the wiki page).
|
||||
|
||||
### The Short and Easy Way
|
||||
|
||||
Both iOS and Android AOT modes need to do this step when they build their artifacts. So, if the embedder targets are similar, the workflow supported by the Flutter tooling can be repurposed for custom AOT embedders. For example, in the case of `aarch64` AOT instructions for Android like targets, the following instructions will generated the four AOT blobs in the intermediates.
|
||||
|
||||
```bash
|
||||
flutter --local-engine <local_engine_configuration> --local-engine-host <local_host_engine_configuration> build aot --target-platform android-arm64 --release
|
||||
```
|
||||
|
||||
**Note:** The `--local-engine` (and `--local-engine-host`) flag is technically optional. However, not specifying the flag will make the tools pick the released version on of the Flutter engine. This version may contain subtle version mismatches with the engine you are using to prepare the `gen_snapshot` binary. So it is safer to just make sure the version are the same.
|
||||
See [running with a local engine](https://github.com/flutter/flutter/wiki/Debugging-the-engine#running-a-flutter-app-with-a-local-engine) for more details.
|
||||
|
||||
The result of the invocation will be the generation of the following binary blobs in the `build/aot directory`:
|
||||
|
||||
- `vm_snapshot_data`: The VM snapshot data.
|
||||
- `vm_snapshot_instr`: The VM snapshot instructions.
|
||||
- `isolate_snapshot_data`: The Isolate snapshot data.
|
||||
- `isolate_snapshot_instr`: The isolate snapshot instructions.
|
||||
|
||||
### The Hard Way
|
||||
|
||||
To generate the four AOT snapshot blobs directly, you will have to generate the kernel snapshot and then prepare the AOT snapshot manually. The exact flags to use are rather esoteric but self explanatory. And, when necessary, the `-v` flag can be passed to the `flutter build aot` instruction to dump the exact flags used by Flutter. These can then be modified as necessary for the target architecture.
|
||||
|
||||
#### Generating the Kernel Snapshot
|
||||
|
||||
The following invocation will generate a file called `kernel_snapshot.dill` in the build directory. Make sure you run `flutter packages get` in your project first to fetch all package dependencies.
|
||||
|
||||
```
|
||||
$FLUTTER_ENGINE_OUT_DIR/dart \
|
||||
$FLUTTER_ENGINE_OUT_DIR/frontend_server.dart.snapshot \
|
||||
--sdk-root $FLUTTER_ENGINE_OUT_DIR/flutter_patched_sdk/ \
|
||||
--strong \
|
||||
--target=flutter \
|
||||
--aot \
|
||||
--tfa \
|
||||
-Ddart.vm.product=true \
|
||||
--packages .packages \
|
||||
--output-dill build/kernel_snapshot.dill \
|
||||
package:flutter_gallery/main.dart
|
||||
```
|
||||
|
||||
#### Generating the AOT Snapshot
|
||||
|
||||
Once the `kernel_snapshot.dill` file has been obtained, `gen_snapshot` can be invoked with the following arguments to generate the four blobs that form the AOT snapshot.
|
||||
|
||||
```
|
||||
$FLUTTER_ENGINE_OUT_DIR/gen_snapshot \
|
||||
--causal_async_stacks \
|
||||
--packages=.packages \
|
||||
--deterministic \
|
||||
--snapshot_kind=app-aot-blobs \
|
||||
--vm_snapshot_data=build/vm_snapshot_data \
|
||||
--isolate_snapshot_data=build/isolate_snapshot_data \
|
||||
--vm_snapshot_instructions=build/vm_snapshot_instr \
|
||||
--isolate_snapshot_instructions=build/isolate_snapshot_instr \
|
||||
--no-sim-use-hardfp \
|
||||
--no-use-integer-division \
|
||||
build/kernel_snapshot.dill
|
||||
```
|
||||
|
||||
**Note:** The `-no*` flags in the invocation above may not be necessary for all targets and can be skipped. As always, when in doubt, call `flutter build aot -v` after selecting the most similar target and see the flags used by Flutter.
|
||||
|
||||
## Packaging the AOT Blobs
|
||||
|
||||
The four AOT blobs need to be shipped with the application and are necessary for the `FlutterEngineRun` call. Embedders have to make a decision about how best to package and ship these blobs to the target.
|
||||
|
||||
On the target at runtime, these blobs need to be mapped into the address space with the following restrictions:
|
||||
|
||||
- `vm_snapshot_data`: Read-Only.
|
||||
- `vm_snapshot_instr`: Read-Execute.
|
||||
- `isolate_snapshot_data`: Read-Only.
|
||||
- `isolate_snapshot_instr`: Read-Execute.
|
||||
|
||||
The responsibility of keeping the mappings alive is upto the embedder. The mappings must be maintained as long as the `FlutterEngine` is running and alive.
|
||||
|
||||
## Configuring the Engine for AOT Operation
|
||||
|
||||
In the `FlutterProjectArgs` struct given the `FlutterEngineRun` call, provide the following options:
|
||||
|
||||
- `vm_snapshot_data`: Pointer to the read-only VM snapshot mapping.
|
||||
- `vm_snapshot_data_size`: Size of the VM snapshot mapping.
|
||||
- `vm_snapshot_instructions`: Pointer to the read-execute VM instructions mapping.
|
||||
- `vm_snapshot_instructions_size`: Size of the VM instructions mapping.
|
||||
- `isolate_snapshot_data`: Pointer to the read-only isolate snapshot mapping.
|
||||
- `isolate_snapshot_data_size`: Size of the isolate snapshot mapping.
|
||||
- `isolate_snapshot_instructions`: Pointer to the read-execute isolate instructions mapping.
|
||||
- `isolate_snapshot_instructions_size`: Size of the isolate instructions mapping.
|
||||
|
||||
Flutter Engine is now running in AOT mode!
|
||||
40
docs/unsorted_wiki/Dashboards.md
Normal file
40
docs/unsorted_wiki/Dashboards.md
Normal file
@@ -0,0 +1,40 @@
|
||||
The index of Flutter dashboards is available at: https://flutter-dashboard.appspot.com/
|
||||
|
||||
## Using the Skia Performance dashboard
|
||||
|
||||
There are two, one for [benchmarks derived from running flutter/flutter tests](https://flutter-flutter-perf.skia.org/e/), and one [derived from flutter/engine tests](https://flutter-engine-perf.skia.org/e/).
|
||||
|
||||
### Viewing results for a specific benchmark
|
||||
|
||||
Each data set (results from a benchmark value) consists of date/value pairs associated with a set of parameters. These parameters include things like the branch that was being tested, the benchmark test name ("test"), and the specific value ("sub_result"). There are other parameters but they aren't important (see below).
|
||||
|
||||
1. Click Query.
|
||||
2. A dialog shows, with a "Filter" text field focused. Type into that field the parts of the benchmark name you want to see that you remember.
|
||||
3. Click "test" in the list box. This causes a second list box to appear.
|
||||
4. Select the specific test from the list box that you care about.
|
||||
5. Refocus the "Filter" text field, and type the name of the specific data point (the sub_result name) you care about.
|
||||
6. Click "sub_result" in the list box.
|
||||
7. Select the specific sub_result that you care about.
|
||||
8. Click "Time Range", then "Date Range".
|
||||
9. Click the calendar icon next to the "Begin" text field. (Don't just type in a new date, because https://bugs.chromium.org/p/skia/issues/detail?id=11279.)
|
||||
10. Select the start date you care about.
|
||||
11. Click "Plot".
|
||||
|
||||
You can navigate the X axis of the graph using WASD.
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
The parameters for a data set are as follows:
|
||||
|
||||
sub_result: the specific data stream provided by the test. Tests can provide multiple data points, in a JSON map; each key in that map becomes a sub_result in the Skia Perf system.
|
||||
|
||||
branch: the branch that was being tested.
|
||||
|
||||
config: always "default".
|
||||
|
||||
originId: always "devicelab" except for data that was migrated from the old database, which are labeled "legacy-flutter".
|
||||
|
||||
test: the name of the test that ran to collect the data.
|
||||
|
||||
unit: in theory, the units in which the data was collected (so each sub_result should only ever be associated with one unit). In practice this parameter is often incorrect.
|
||||
535
docs/unsorted_wiki/Data-driven-Fixes.md
Normal file
535
docs/unsorted_wiki/Data-driven-Fixes.md
Normal file
@@ -0,0 +1,535 @@
|
||||
# Data-driven Fixes
|
||||
|
||||
_This documentation is preliminary. Suggestions for improvements are welcome. Do not edit this page directly, it is copied from an internal source._
|
||||
|
||||
Data-driven fixes is a feature that allows the Flutter package authors to provide data about changes that have been made to the package's public API and uses that data to help users of the package update their code when updating to a newer version of the package. It is not supported for other package authors.
|
||||
|
||||
The data is used by two tools:
|
||||
- The analysis server uses it to provide quick fixes (also known as code actions) in the IDE.
|
||||
- The `dart fix` command uses it to apply bulk edits to the code in a file or directory.
|
||||
|
||||
The purpose of this document is to describe how to write and test the data used by these tools. It contains four sections:
|
||||
- [Overview](#overview) provides an overview of how this feature is intended to be used and what kind of data can be expressed.
|
||||
- [Examples](#examples) provides examples of how to express some common kinds of changes.
|
||||
- [Reference](#reference) provides a complete definition of the data and how that data is used to update client code.
|
||||
- [Testing](#testing) provides a guide for how this data can be tested.
|
||||
|
||||
|
||||
## Overview
|
||||
|
||||
The data used by this feature describes the changes made to the public API of a package. It's contained in a [data file](#data-file) in the package that defines the API.
|
||||
|
||||
The data is organized around the individual elements of the API, where an [element](#element) is anything that can be referenced outside the library in which it's declared. This includes top-level declarations, such as classes and extensions, and their members, such as methods and fields.
|
||||
|
||||
The changes to an element that can be described are designed to be both fine-grained and high-level.
|
||||
|
||||
By "fine-grained" we mean that the overall change to an API is described in terms of small, composable changes. For example, instead of describing all of the ways in which a method's signature has changed, there are individual changes for adding and removing individual parameters, renaming parameters, etc. This reduces the complexity of describing the overall change.
|
||||
|
||||
By "high-level" we mean that the changes are described in terms of how the API changed, not in terms of what needs to be done to client code in response to those changes. For example, if a parameter is added to a method the data would describe the parameter and the value to be used in invocations, but doesn’t describe how to find invocations or how to find overrides. It's the responsibility of the tools to figure out how to modify the client code in response to those changes. This reduces the amount of work required of package authors initially and allows the tools to adjust as the Dart language evolves, removing the need for package authors to refine the data.
|
||||
|
||||
The description of an [element](#element) and the [change](#change)s to that element are encapsulated in a [transform](#transform) and the [data file](#data-file) is essentially a list of [transform](#transform)s.
|
||||
|
||||
The changes are applied when an analysis of the client code produces diagnostics. For example, if a method is renamed then invocations of the old method will produce a diagnostic indicating that the method isn’t defined. This also works if the old method is still declared and marked as being deprecated because a diagnostic is also produced in that case. Because of that, we encourage you to add data for an API when the API is first deprecated. If the API doesn’t go through a deprecation period, then the changes should be added to the data when the changes are made.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
This section provides examples of how to express some common kinds of changes.
|
||||
|
||||
Each example includes the API being changed, both the old API marked as deprecated and the new API that replaced it. As noted in the [Overview](#overview), it isn’t necessary for the old API to still be declared in order for the tools to be able to apply the changes, but it’s included in the examples for clarity.
|
||||
|
||||
As a result of always including both the old and new APIs in the examples, the elements are always renamed. It isn’t necessary to rename an element in order for the tools to be able to apply the changes.
|
||||
|
||||
### Rename a method
|
||||
|
||||
One of the most common API changes is to rename an element. In this section we'll show how to specify that a method has been renamed. Let's assume that your package defines a class `C` in the file `lib/c.dart` with a renamed method similar to the following:
|
||||
|
||||
```dart
|
||||
class C {
|
||||
@deprecated
|
||||
int oldName(String s) => newName(s);
|
||||
|
||||
int newName(String s) { ... }
|
||||
}
|
||||
```
|
||||
|
||||
In the data file we need to specify which method was renamed, what it's old name was, and what it's new name is. We do that by writing a data file like the following:
|
||||
|
||||
```yaml
|
||||
version: 1
|
||||
transforms:
|
||||
- title: 'Rename to newName'
|
||||
date: 2020-11-20
|
||||
element:
|
||||
uris: ['c.dart']
|
||||
method: 'oldName'
|
||||
inClass: 'C'
|
||||
changes:
|
||||
- kind: 'rename'
|
||||
newName: 'newName'
|
||||
```
|
||||
|
||||
This tells the tools that any references to the method `C.oldName` should be updated to refer to the method `C.newName`. That includes both invocations of the method as well as references where the method is being torn off. It also tells the tool that any methods that used to override the old method need to be renamed so that they now override the new method.
|
||||
|
||||
|
||||
## Reference
|
||||
|
||||
This section provides a complete definition of what data can be included in a [data file](#data-file) and how that data is used to update client code.
|
||||
|
||||
In the following subsections, the text `...` is a placeholder for a value that is described in a different subsection.
|
||||
|
||||
### data file
|
||||
|
||||
A _data file_ contains the data used to update clients of a package when the public API of the package has been changed. The data is represented by a single [transform set](#transform-set).
|
||||
|
||||
The data is stored in a file named `fix_data.yaml` in the `lib` directory of the package. There is a single data file per package.
|
||||
|
||||
You might find it useful to include a comment at the beginning of the file that has a link to this documentation for easy reference.
|
||||
|
||||
### transform set
|
||||
|
||||
A _transform set_ describes a set of changes made to the API of a single package. It's represented as a map with two keys: `version` and `transforms`.
|
||||
|
||||
The `version` key is required. The value of the `version` key is an integer used to identify the version of the file's content. The version described by this document is version `1`. The version key is typically the first line of the file.
|
||||
|
||||
The version key lets the tooling continue to work with older versions of data files when the format of the file needs to be changed, and allows older versions of the SDK determine when a package is using a newer and not understood format.
|
||||
|
||||
The `transforms` key is required. The value of the `transforms` key is a list of [transform](#transform) objects. While the list is allowed to be empty, there’s no value in having a data file unless there's at least one transform.
|
||||
|
||||
For example, the basic content of a data file generally looks like this:
|
||||
|
||||
```yaml
|
||||
version: 1
|
||||
transforms:
|
||||
- ...
|
||||
- ...
|
||||
```
|
||||
|
||||
The transforms can be in any order, but to make it easier to maintain the file we recommend putting newer changes at the beginning of the file, just like you would in a change log. You might find it useful to use comments to group sets of transforms, possibly based on the published version of the package in which the changes were made.
|
||||
|
||||
### transform
|
||||
|
||||
A _transform_ describes a set of changes made to a single element in the API. It's represented as a map with seven keys: `title`, `date`, `bulkApply`, `element`, `oneOf`, `changes`, and `variables`.
|
||||
|
||||
The `title` key is required. The value of the `title` key is a string that is displayed in the IDE to describe the changes that will be made to the user's code. It's usually shown as a label in a menu, so it should be kept short. And because most APIs can be referenced in multiple ways, the description should be general enough to cover all of those cases. For example, if a method is renamed then the name will need to be updated both at invocation sites and anywhere the old method was being overridden. Using a title like “Invoke newMethod” wouldn't be appropriate for updating an override, so a better title would be “Rename to newMethod”, which would work for both cases.
|
||||
|
||||
The `date` key is required. The value of the `date` key is a string encoding of a date. The format of the string is required to be the same as the format accepted by the method [`DateTime.parse`](https://api.dart.dev/dart-core/DateTime/parse.html).
|
||||
|
||||
The `bulkApply` key is optional. The value of the `bulkApply` key is a Boolean value indicating whether the transform should be applied when bulk fixes are being made. The default value is `true`. You need to disallow a transform from being used in a bulk fix tool in cases where there are multiple transforms for a single API. If there's a clear default, then you can allow that one transform to be applied.
|
||||
|
||||
The `element` key is required. The value of the `element` key is an [element](#element) object. It specifies the element in the API that was changed, such as a class or a method.
|
||||
|
||||
Either the `oneOf` key or the `changes` key is required, but it isn't valid to have both. These keys are two different ways to specify the list of changes that will be applied when a reference to the element is found.
|
||||
|
||||
The value of the `oneOf` key is a list of [conditional change](#conditional-change) objects. For each reference to the element that's found, the first conditional change whose condition is true will determine the list of changes to be applied to that reference. If more than one conditional change has a condition that's true, only the first one will be applied. If none of the conditions is true, then no changes will be applied.
|
||||
|
||||
The value of the `changes` key is a list of [change](#change) objects. The list of changes is unconditionally selected as the changes that will be applied.
|
||||
|
||||
The `variables` key is optional.The value of the `variables` key is a [variable map](#variable-map).
|
||||
|
||||
For example, you can specify a transform like this:
|
||||
|
||||
```yaml
|
||||
title: 'Descriptive title'
|
||||
date: 2020-09-14
|
||||
element: ...
|
||||
changes:
|
||||
- ...
|
||||
- ...
|
||||
```
|
||||
|
||||
You might find it useful to include a comment to provide more information about each transform, such as design documents, issues, or even PRs that motivated or implemented the change.
|
||||
|
||||
### element
|
||||
|
||||
An _element_ describes a single element in the API that was changed, such as a class or a method. It's represented as a map with either two or three keys depending on the kind of element being described. All elements have a `uris` key and a second key that specifies the type and name of the element, such as `class` or `method`. Elements that are members of a top-level element have a third key specifying the containing element.
|
||||
|
||||
The `uris` key is required. The value of the `uris` key is a list of [uri](#uri)s, each of which is the URI of a public library that includes the element (or the container of the element in the case of members such as methods).
|
||||
|
||||
The second key, which is required, indicates the kind and name of the element. The kind is given by the key itself and the name is given as the value of the second key, which is a string. The possible keys, and hence kinds, are:
|
||||
- class
|
||||
- constant (from an enum)
|
||||
- constructor
|
||||
- enum
|
||||
- extension
|
||||
- field
|
||||
- function (top-level)
|
||||
- getter
|
||||
- method
|
||||
- mixin
|
||||
- setter
|
||||
- typedef
|
||||
- variable (top-level)
|
||||
|
||||
If the element is a member of a top-level element, then the third key is required and it indicates the kind and name of the top-level element containing the member. The possible container keys are:
|
||||
- inClass
|
||||
- inEnum
|
||||
- inExtension
|
||||
- inMixin
|
||||
|
||||
For example, you can specify a class named `C`:
|
||||
|
||||
```yaml
|
||||
uris: ['lib.dart']
|
||||
class: 'C'
|
||||
```
|
||||
|
||||
or specify a method named `m` in a class named `C`:
|
||||
|
||||
```yaml
|
||||
uris: ['lib.dart']
|
||||
method: 'm'
|
||||
inClass: 'C'
|
||||
```
|
||||
|
||||
To specify the unnamed constructor in a class, use an empty string for the name of the constructor:
|
||||
|
||||
```yaml
|
||||
uris: ['lib.dart']
|
||||
constructor: ''
|
||||
inClass: 'C'
|
||||
```
|
||||
|
||||
Despite the fact that the names of named parameters are used by clients to associate an argument with the parameter, they aren't considered separate API elements and therefore can't be described by an element object. If you have modified the parameters of a method or function, then the element that was changed is the method or function associated with the parameter.
|
||||
|
||||
### conditional change
|
||||
|
||||
A _conditional change_ is a list of [change](#change)s that is applied only when a condition is true. It's represented as a map with two keys: `if` and `changes`.
|
||||
|
||||
The `if` key is required. The value of the `if` key is a [condition](#condition). Any variables declared for the whole transform can be referenced in the condition.
|
||||
|
||||
The `changes` key is required. The value of the `changes` key is a list of [change](#change) objects.
|
||||
|
||||
### condition
|
||||
|
||||
A _condition_ is a Boolean-valued expression. It's represented by a string that uses a subset of Dart’s expression syntax to express the condition. The currently supported syntax is:
|
||||
```
|
||||
<condition> ::= <logicalAndExpression>
|
||||
|
||||
<logicalAndExpression> ::= <equalityExpression> ('&&' <equalityExpression>)*
|
||||
|
||||
<equalityExpression> ::= <primary> (<equalityOperator> <primary>)?
|
||||
|
||||
<equalityOperator> ::= '==' | '!='
|
||||
|
||||
<primary> ::= <variableName> | <stringLiteral>
|
||||
```
|
||||
|
||||
where `<variableName>` is the name of a variable from a [variable map](#variable-map) and `<stringLiteral>` is a single-line string literal with single quote delimiters.
|
||||
|
||||
### change
|
||||
|
||||
A _change_ describes a single change that was made to the element. It's represented as a map. The number and names of the keys depends on the kind of change being described, but all changes have a `kind` key.
|
||||
|
||||
The `kind` key is required. The value of the `kind` key is a string indicating the kind of change. The valid kinds are:
|
||||
- [addParameter](#addParameter)
|
||||
- [addTypeParameter](#addTypeParameter)
|
||||
- [removeParameter](#removeParameter)
|
||||
- [rename](#rename)
|
||||
- [renameParameter](#renameParameter)
|
||||
- [changeParameterType](#changeParameterType)
|
||||
- [replacedBy](#replacedBy)
|
||||
|
||||
Individual kinds of changes are described in the section below, titled by the kind.
|
||||
|
||||
#### addParameter
|
||||
|
||||
An _add parameter_ change indicates that a parameter was added to a function or method. It has five keys: `kind`, `index`, `name`, `style` and `argumentValue`.
|
||||
|
||||
The `index` key is required. The value of the `index` key is the zero-based index of the parameter after all the changes related to parameters have been applied. It's used to know:
|
||||
- where to add the parameter in method overrides. If parameter `p` is to be add to a method `m` in a class `A`, and the user has a subclass of `A` that overrides the method `m`, the tool will add the parameter at `index` to the method `m` in the subclass.
|
||||
- if the parameter is a positional parameter, which argument to remove at each invocation site.
|
||||
|
||||
The `name` key is required. The value of the `name` key is the name of the parameter. It's used as the name of new parameters added in overrides and, if the parameter is a named parameter, as the name of the argument at invocation sites.
|
||||
|
||||
The `style` key is required. The value of the `style` key is one of the following strings: `'optional_positional'`, `'required_positional'`, `'optional_named'`, `'required_named'`.
|
||||
|
||||
The `defaultValue` key is required if the added parameter is an optional parameter whose type is non-nullable. The value of the `defaultValue` key is a [code template](#code-template) object whose value will be used when adding the parameter to any methods that override the element.
|
||||
|
||||
The `argumentValue` key is required if the added parameter is a required parameter or is an optional positional parameter that was added before at least one pre-existing optional positional parameter. The value of the `argumentValue` key is a [code template](#code-template) object whose value will be used as the value of the corresponding argument at invocation sites.
|
||||
|
||||
```yaml
|
||||
kind: 'addParameter'
|
||||
index: 0
|
||||
name: 'a'
|
||||
style: optional_positional
|
||||
argumentValue: ...
|
||||
```
|
||||
|
||||
#### addTypeParameter
|
||||
|
||||
An _addTypeParameter_ change indicates that an element was given a new type parameter. It has five keys: `kind`, `index`, `name`, `extends` and `argumentValue`.
|
||||
|
||||
The `index` key is required. The value of the `index` key is an integer indicating the index of the new type parameter after all the changes related to type parameters have been applied. It's used to know where to add new type parameters in overrides and where to add new type arguments in references to the element.
|
||||
|
||||
The `name` key is required. The value of the `name` key is a string containing the name of the type parameter. It's used as the name of new type parameters added in overrides.
|
||||
|
||||
The `extends` key is required if the type parameter has an extends clause. The value of the `extends` key is a [code template](#code-template) object whose value will be used in the `extends` clause of new type parameters added in overrides.
|
||||
|
||||
The `argumentValue` key is required. The value of the `argumentValue` key is a [code template](#code-template) object whose value will be used as the type argument when updating references to the element.
|
||||
|
||||
```yaml
|
||||
kind: 'addTypeParameter'
|
||||
index: 0
|
||||
name: 'T'
|
||||
extends: ...
|
||||
argumentValue: ...
|
||||
```
|
||||
|
||||
#### removeParameter
|
||||
|
||||
A _remove parameter_ change indicates that one of the parameters of a function or method was removed. It has three keys: `kind`, `index`, and `name`.
|
||||
|
||||
The `index` key is required unless the `name` key is provided, and isn't allowed if a `name` key is provided. The `index` key specifies that a positional parameter was removed and its value is the zero-based index of the parameter before the function was modified. It's used to know which parameters to remove in overrides and which arguments to remove at invocation sites.
|
||||
It's used to know:
|
||||
- where to remove the parameter in method overrides. If parameter `p` is to be removed from a method `m` in a class `A`, and the user has a subclass of `A` that overrides the method `m`, the tool will remove the parameter at `index` from the method `m` in the subclass.
|
||||
- if the argument is a positional parameter, which argument to remove at each invocation site.
|
||||
|
||||
For example, if the second positional parameter is removed you would write:
|
||||
|
||||
```yaml
|
||||
kind: 'removeParameter'
|
||||
index: 1
|
||||
```
|
||||
|
||||
The `name` key is required unless the `index` key is provided, and isn't allowed if an `index` key is provided. The `name` key specifies that a named parameter was removed and its value is the name of the parameter before the function was modified. It's used to know which parameters to remove in overrides and which arguments to remove at invocation sites.
|
||||
|
||||
For example, if the named parameter `p` is removed you would write:
|
||||
|
||||
```yaml
|
||||
kind: 'removeParameter'
|
||||
name: 'p'
|
||||
```
|
||||
|
||||
#### rename
|
||||
|
||||
A _rename_ change indicates that an element was renamed. It has two keys: `kind` and `newName`.
|
||||
|
||||
The `newName` key is required. The value of the `newName` key is a string containing the new name of the element. It's used to replace the old name of the element (provided in the element object) in references to the element.
|
||||
|
||||
For example, to rename an element to `B` you would write:
|
||||
|
||||
```yaml
|
||||
kind: 'rename'
|
||||
newName: 'B'
|
||||
```
|
||||
|
||||
This change is only intended to support simple renames, such as renaming a class or a method. It therefore assumes that the new element is like the old element in several ways:
|
||||
|
||||
- it’s in the same library (that is, the URI’s by which it’s imported don’t change),
|
||||
|
||||
- it’s the same kind of element (for example, you can’t rename a class and change it to be a mixin using this change), and
|
||||
|
||||
- if the element being renamed is a member (such as a method), then the renamed element is a member of the same container.
|
||||
|
||||
If the change that was made doesn’t fit within those constraints, then using a rename to capture it might not work in all situations. You should consider using a [replacedBy](#replacedBy) change instead.
|
||||
|
||||
#### renameParameter
|
||||
|
||||
A _renameParameter_ change indicates that a named parameter in a function or method was renamed. As such, the element in the transform must be a method or function. It has three keys: `kind`, `oldName`, and `newName`.
|
||||
|
||||
The `oldName` key is required. The value of the `oldName` key is a string containing the old name of the parameter. It's used to locate the parameter that was renamed.
|
||||
|
||||
The `newName` key is required. The value of the `newName` key is a string containing the new name of the parameter. It's used to replace the old name of the parameter, both in overrides of a method and in references to the method or function.
|
||||
|
||||
For example, to rename the parameter `a` to `b` you would write:
|
||||
|
||||
```yaml
|
||||
kind: 'renameParameter'
|
||||
oldName: 'a'
|
||||
newName: 'b'
|
||||
```
|
||||
|
||||
#### changeParameterType
|
||||
|
||||
A _changeParameterType_ change can be used to indicate that a parameter has been made non nullable. It has five keys: `kind`, `index`, `name`, `nullability` and `argumentValue`.
|
||||
|
||||
The `index` key is required unless the `name` key is provided, and isn't allowed if a `name` key is provided. The `index` key specifies that the position of the parameter that was changed.
|
||||
|
||||
The `name` key is required unless the `index` key is provided, and isn't allowed if an `index` key is provided. The `name` key specifies the name of the parameter that has the type change.
|
||||
|
||||
The `nullability` key is required and indicates the type of change made to the parameter. Currently `non_null` is the only type change that is supported.
|
||||
|
||||
The `argumentValue` key is optional and if provided will be used as the default value of the parameter. The value of the argumentValue key is a [code template](https://github.com/flutter/flutter/wiki/Data-driven-Fixes#code-template) object.
|
||||
|
||||
For eg, changing the parameter `a` to non null with a default value you would write:
|
||||
|
||||
```yaml
|
||||
kind: 'changeParameterType'
|
||||
name: 'a'
|
||||
nullability: 'non_null'
|
||||
argumentValue:
|
||||
expression: "'newValue'"
|
||||
```
|
||||
|
||||
|
||||
#### replacedBy
|
||||
|
||||
A _replacedBy_ change indicates that the specified element was replaced by another element. It has two keys: `kind` and `newElement`.
|
||||
|
||||
The `newElement` key is required. The value of the `newElement` key is an [element](#element) representing the element that replaces the specified element.
|
||||
|
||||
For example, to replace a top level variable `v` with a static field `C.f` you would write:
|
||||
|
||||
```yaml
|
||||
kind: 'replacedBy'
|
||||
newElement:
|
||||
uris: ['lib.dart']
|
||||
field: 'f'
|
||||
inClass: 'C'
|
||||
```
|
||||
|
||||
This change currently has two limitations that you should be aware of.
|
||||
|
||||
First, it doesn’t allow the list of URIs for the new element to be different from the list for the old element. That means that it currently might not correctly update the imports to make the new element visible in scope.
|
||||
|
||||
Second, it doesn’t support replacing every kind of element, nor can the replacement element be every possible kind. What it does support is the following cases:
|
||||
|
||||
- Replacing one constructor with a different constructor, even when the constructors are in different classes. It doesn’t correctly handle the case of replacing a `const` constructor with a non-`const` constructor.
|
||||
|
||||
- Replacing a function (either a top-level function or a static method) with a different function.
|
||||
|
||||
- Replacing a getter (either a top-level getter, a top-level variable, a static getter, or a static field) with a different getter.
|
||||
|
||||
- Replacing a setter (either a top-level setter, a top-level non-`final` variable, a static setter, or a non-`final` static field) with a different setter.
|
||||
|
||||
As with constructors, if a static member is being replaced by another static member, the members can be in different containers (classes, mixins, or extensions).
|
||||
|
||||
There isn’t currently any way for the tool to detect whether a method, getter, or setter is static, so it’s possible to specify an instance member. As a result, specifying an instance member (as either the replaced or replacing element) might produce invalid changes for your users.
|
||||
|
||||
Similarly, there isn’t currently any way for the tool to detect whether a top-level variable or a static field is `final` (which includes `const`). As a result, specifying a final element (as either the replaced or replacing element) might produce invalid changes for your users.
|
||||
|
||||
### code template
|
||||
|
||||
A _code template_ describes code that can be generated when fixing user code. It's represented as a map with three keys: `expression`, `requiredIf`, and `variables`.
|
||||
|
||||
The `expression` key is required. The value of the key is a template: a string containing Dart code, possibly with embedded references to variables. Variables are referenced by enclosing the name of the variable between `{%` and `%}` delimiters.
|
||||
|
||||
The `requiredIf` key is optional, but is only allowed if the code template is inside an `addParameter` change and the style of the parameter is `'optional_named'`. The value of the `requiredIf` key is a [condition](#condition) that will be evaluated for each invocation of the method or function that was changed. Normally arguments are not added for optional named parameters, but the argument _will_ be added if the `requiredIf` key is provided and the condition evaluates to `true`.
|
||||
|
||||
The `variables` key is optional. The value of the `variables` key is a [variable map](#variable-map). If neither the `expression` template nor the `requiredIf` condition use any variables then the `variables` key can be omitted.
|
||||
|
||||
Variables serve two purposes. The first, and most obvious, is to allow the replacement text to contain values based on the context in which it will appear. For example, if a parameter was removed then it’s possible that the value of the corresponding argument will need to appear somewhere else in the updated code.
|
||||
|
||||
The second purpose is to allow the tool to automate some of the changes for you. For example, if the replacement text needs to refer to an imported name, you should use a variable to do so, and the definition of the variable can specify where the name is imported from. The tool can then determine whether any changes need to be made to the imports in the library being edited and make them correctly.
|
||||
|
||||
The variables that can be referenced in the template are the variables defined in the code template and any variables defined in the enclosing transform whose name isn't hidden by a variable defined in the code template.
|
||||
|
||||
```yaml
|
||||
expression: '{% type %}({% arg %})'
|
||||
variables:
|
||||
arg: ...
|
||||
type: ...
|
||||
```
|
||||
|
||||
### variable map
|
||||
|
||||
A _variable map_ defines one or more variables. It's represented as a map. The keys of the map are variable names and the values are [value](#value) objects.
|
||||
|
||||
The name of a variable is any identifier containing either uppercase or lowercase letters.
|
||||
|
||||
### value
|
||||
|
||||
A _value_ describes a way of computing a string that can be injected into a template. It's represented as a map. The number and names of the keys depends on the kind of value being described, but all value objects have a `kind` key.
|
||||
|
||||
The `kind` key is required. The value of the `kind` key is a string indicating the kind of value. The valid kinds are:
|
||||
- [fragment](#fragment)
|
||||
- [import](#import)
|
||||
|
||||
Individual kinds of value objects are described in the sections below, titled by the kind.
|
||||
|
||||
#### fragment
|
||||
|
||||
A _fragment_ value indicates that the value is a fragment copied from the code being updated. It has two keys: `kind` and `value`.
|
||||
|
||||
The `value` key is required. The `value` key specifies the fragment of code to be copied and is expressed as a chain of references in a simplified AST model of the code. The details follow the example.
|
||||
|
||||
```yaml
|
||||
kind: fragment
|
||||
value: 'arguments[0]'
|
||||
```
|
||||
|
||||
The code fragment is described by a dot separated non-empty list of accessors:
|
||||
|
||||
```
|
||||
<fragment> ::= <accessor> ('.' <accessor>)*
|
||||
```
|
||||
|
||||
Each accessor consists of an identifier followed by an index operator:
|
||||
|
||||
```
|
||||
<accessor> ::= <identifier> '[' (<integer> | <identifier>) ']'
|
||||
```
|
||||
|
||||
When an accessor is evaluated it takes a target node and either produces a result node or fails. The target node of the first accessor is always the node representing the invocation being updated (whether it’s the invocation of a function, method, getter, setter or constructor). The target node of all other accessors is the result node of the preceding accessor.
|
||||
|
||||
There are currently two supported identifiers: `arguments` and `typeArguments`.
|
||||
|
||||
The `arguments` accessor takes any node that includes an argument list and returns one of the arguments to the invocation. The index operator selects the argument to be returned. A zero-based integer is used to select a positional argument and an identifier is used to select a named argument.
|
||||
|
||||
The `typeArguments` accessor takes any node that includes a type argument list and returns one of the type arguments. The index operator selects the argument to be returned using a zero-based integer.
|
||||
|
||||
Here are some examples:
|
||||
- `arguments[0]` copies the code for the first argument in the argument list.
|
||||
- `arguments[child]` copies the code for the argument named `child`.
|
||||
- `arguments[0].typeArguments[0]` copies the code for the first type argument in the expression that is the first argument in the argument list.
|
||||
|
||||
#### import
|
||||
|
||||
An _import_ value indicates that the value is a top-level declaration from a library. It has three keys: `kind`, `uris` and `name`.
|
||||
|
||||
The `uris` key is required. The value of the `uris` key is a list of [uri](#uri)s, each of which is the URI of a public library from which the name can be imported. They will be used to add an `import` directive, if one is needed, to any library in which the value of the code template will be used. If there are multiple URIs in the list and none of them are imported into the library being modified, then the first URI will be used.
|
||||
|
||||
The `name` key is required. The `name` key specifies the name of the top-level declaration and its value is a string containing that name. The name is also the value of the variable. Any use of the variable in the template will ensure that the library is imported into the library being changed and that the name is visible.
|
||||
|
||||
```yaml
|
||||
kind: import
|
||||
uris: [ 'package:flutter/material.dart' ]
|
||||
name: 'Widget'
|
||||
```
|
||||
|
||||
### uri
|
||||
|
||||
A _uri_ is a string containing a URI. The URI can be one of the following:
|
||||
- a `dart:` URI,
|
||||
- a `package:` URI, or
|
||||
- an abbreviated URI.
|
||||
|
||||
An abbreviated URI is the portion of the URI following the name of the package containing the data file. For example, if a package named `sample` contains a library named `sample.dart` in the root of the `lib` directory, then within the data file for the package `sample` the URI for that library can be written as either `package:sample/sample.dart` or `sample.dart`.
|
||||
|
||||
### test folder
|
||||
|
||||
A _test folder_ contains dart files and their curresponding golden master `.expect` files that are used to test the data in the [data file](#data-file). These files are located in a folder (conventionally named `test_fixes`) in the package directory. See the [Testing](#testing) section for more documentation.
|
||||
|
||||
You might find it useful to include a `README.md` file that has a link to this documentation for easy reference.
|
||||
|
||||
|
||||
## Testing
|
||||
|
||||
This section provides a guide for testing data driven fixes.
|
||||
|
||||
All the test files are contained in the [test folder](#test-folder). Every dart file has a golden counterpart file, which is named as `<dart-file-name>.dart.expect`.
|
||||
|
||||
Every test has two parts:
|
||||
1. All possible usages of the public API that is changed by the data driven fix. This is contained in the dart file.
|
||||
2. All the usages in the dart file with the expected change applied. This is contained in the golden file.
|
||||
|
||||
Extending on the example shown in [Rename a method](#rename-a-method), the change can be tested as below:
|
||||
```dart
|
||||
// test_fixes/C.dart
|
||||
import 'package:<package-name>/C.dart';
|
||||
|
||||
C.oldName('Fix me'); // usage before the change.
|
||||
```
|
||||
|
||||
```dart
|
||||
// test_fixes/C.dart.expect
|
||||
import 'package:<package-name>/C.dart';
|
||||
|
||||
C.newName('Fix me'); // expected usage after the change.
|
||||
```
|
||||
|
||||
To run these tests locally, execute the below command in the [test folder](#test-folder).
|
||||
```bash
|
||||
dart fix --compare-to-golden
|
||||
```
|
||||
32
docs/unsorted_wiki/Debugging-issues-on-the-Web.md
Normal file
32
docs/unsorted_wiki/Debugging-issues-on-the-Web.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Debugging issues on the Web
|
||||
|
||||
The tips below can help you debug Web issues quicker and file more readable Github issues.
|
||||
|
||||
## Chrome DevTools
|
||||
|
||||
Dart Dev Tools are not available when running an app in profile or release mode. However, you can still debug your app using [Chrome DevTools][chrome_dev_tools]. When Flutter builds your app it also produces _source maps_. [Source maps][source_maps] is a browser technology that allows you to debug applications that are compiled from any language to JavaScript. Dart, TypeScript, CoffeeScript, and even JavaScript minifiers use it for debugging.
|
||||
|
||||
To open Chrome DevTools enter Ctrl + Shift + J (on Linux or Windows) or Command + Options + J (on Mac).
|
||||
|
||||
Chrome DevTools provide network request/response information, performance profiling tools, a memory profiler, HTML element debugger, a console with REPL (JavaScript-only), and more.
|
||||
|
||||
## Getting readable stack traces and profile traces
|
||||
|
||||
When building in release mode the dart2js compiler _minifies_ your code to reduce the size of the app's JavaScript bundle. This process results in obfuscated class, method, and function names. An exception may look like this:
|
||||
|
||||
```
|
||||
Uncaugh TypeError: Cannot read property 'c' of undefined js_helper.dart:1234
|
||||
at a3R.$0 (app.dart:123)
|
||||
at afG.b (util.dart:321)
|
||||
```
|
||||
|
||||
To get more readable stack-traces in release builds, you can build and run your app in `--profile` mode. While the compiler does optimize the app in profile mode, it does not obfuscate the symbols from the original source code, making stack traces and profile traces much more readable.
|
||||
|
||||
Here's an example of a profile trace recorded in Chrome DevTools in profile mode:
|
||||
|
||||

|
||||
|
||||
You can see that symbols appear unchanged, e.g. "makeSkRRect", and "fillLiteralMap".
|
||||
|
||||
[chrome_dev_tools]: https://developers.google.com/web/tools/chrome-devtools
|
||||
[source_maps]: https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps
|
||||
147
docs/unsorted_wiki/Debugging-the-engine.md
Normal file
147
docs/unsorted_wiki/Debugging-the-engine.md
Normal file
@@ -0,0 +1,147 @@
|
||||
This page has some hints about debugging the engine.
|
||||
|
||||
See also [[Crashes]] for advice on handling engine crashes (specifically around obtaining stack traces, and reporting crashes in AOT Dart code).
|
||||
|
||||
## Running a Flutter app with a local engine
|
||||
|
||||
First, make sure the appropriate version of the engine is built (see [[Compiling the engine]]).
|
||||
|
||||
### Using the Flutter tool
|
||||
|
||||
Run your Flutter app with:
|
||||
|
||||
```bash
|
||||
flutter run --local-engine=XXXX --local-engine-host=YYYY
|
||||
```
|
||||
|
||||
to run an app with the local engine where `XXXX` should be replaced with the version you wish to use. For example, use `--local-engine=android_debug_unopt --local-engine-host=host_debug_unopt` to run a debug android engine or `--local-engine=ios_debug_sim_unopt --local-engine-host=host_debug_unopt` to run a debug iOS simulator engine.
|
||||
|
||||
> 💡 **TIP**: When developing on a Mac with ARM (M CPU), use `--local-engine-host=host_debug_unopt_arm64`.
|
||||
>
|
||||
> You can continue to use `host_debug_unopt` (required for Intel Macs), but the engine will be run under Rosetta
|
||||
> which may be slower. See [Developing with Flutter on Apple Silicon](https://github.com/flutter/flutter/wiki/Developing-with-Flutter-on-Apple-Silicon)
|
||||
> for more information.
|
||||
|
||||
|
||||
It is important to always have a `host_XXXX` version of the engine built when using a local engine since Flutter uses the host build's version of Dart.
|
||||
|
||||
### Using Visual Studio Code
|
||||
|
||||
You will need to add a new [launch configuration](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) in the `launch.json` file:
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch (local engine)",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"args": ["--local-engine", "XXX", "--local-engine-host", "YYY"]
|
||||
}
|
||||
|
||||
// Other profiles below..
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Bisecting a roll failure
|
||||
|
||||
If the engine roll is failing (see [[Autorollers]]), you can use `git bisect` on the engine repo to track down the offending commit, using the `--local-engine` and `--local-engine-host` arguments as described above to run the failing framework test with each version of the engine.
|
||||
|
||||
## Tracing OpenGL calls in Skia
|
||||
|
||||
All OpenGL calls in Skia are guarded by either the `GR_GL_CALL_NOERRCHECK` or `GR_GL_CALL_RET_NOERRCHECK` macros. Trace events may be added in these macros to trace all GL calls made by Skia, for example [in a patch like this](https://gist.github.com/chinmaygarde/607eb86d5447615b9cf2804a4f8fb1ce).
|
||||
|
||||
Due to the number of events traced to the timeline, the trace buffer may be filled up very quickly. Unless you want to see only the traces for the past few frames, use an endless trace buffer (`flutter run --endless-trace-buffer` turns on an endless trace buffer).
|
||||
|
||||
Also, make sure to run your application with the `--trace-skia` flag.
|
||||
|
||||
## Debugging iOS builds with Xcode
|
||||
|
||||
Building with `flutter --local-engine` will set a `LOCAL_ENGINE` Xcode build setting in your Flutter application's `ios/Flutter/Generated.xcconfig` file. This will be set until you run `flutter run` again with either a different `--local-engine` option, or with none at all (which will unset it).
|
||||
|
||||
You can speed up your workflow by adding the `--config-only` flag to set up the Xcode build settings and plugins, but not compile the app. For example:
|
||||
|
||||
```bash
|
||||
flutter build ios --local-engine ios_debug_unopt --local-engine-host host_debug_unopt --config-only
|
||||
```
|
||||
|
||||
To start debugging, open your Flutter app `ios/Runner.xcworkspace` file in Xcode. Ensure **Product > Scheme > Edit Scheme > Run > Build Configuration** matches your engine runtime mode (defaults to `Debug`).
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/682784/76341195-ee050680-62b9-11ea-956d-c27d65e5eec9.png" alt="Product > Scheme > Edit Scheme > Run > Build Configuration" width="900"/>
|
||||
|
||||
Add an engine symbol breakpoint via **Debug > Breakpoints > Create Symbolic Breakpoint...**. The **Symbol** field should be the engine symbol you're interested in, like `-[FlutterEngine runWithEntrypoint:]` (note the `-[` prefix has no space).
|
||||
|
||||
You can also set a breakpoint directly with [lldb](https://lldb.llvm.org/tutorial.html) by expanding **Flutter > Runner** in the Runner Project Navigator. Put a breakpoint in `AppDelegate.swift`'s `application(didFinishLaunchingWithOptions:)` (Swift project) or `main.m`'s `main()` (Objective-C project) and start the application by clicking the Run button (CMD + R). Then, set your desired breakpoint in the engine in `lldb` via `breakpoint set -...`.
|
||||
|
||||
## Debugging Android builds with gdb
|
||||
|
||||
See https://github.com/flutter/engine/blob/master/sky/tools/flutter_gdb#L13
|
||||
|
||||
## Debugging native engine code on Android with Android Studio
|
||||
|
||||
1. Build the local engine with the `--no-stripped` flag.
|
||||
2. Decide on a Flutter app that you with to debug and run it with `flutter run` and the local engine flags. i.e.: `--debug --local-engine-src-path path/to/my/engine/src --local-engine=android_debug_unopt_arm64`
|
||||
3. Open Android Studio and use `File > Profile or Debug APK`. The location of the debug build APK should be `build/app/outputs/apk/debug/app-debug.apk` under the Flutter app project.
|
||||
4. To attach the debugger, use `Run > Attach Debugger to Android Process`. For "Use Android Debugger Settings from" choose `[Use default settings]`, and for "Debug Type" choose `Native Only`.
|
||||
5. Once attached, you can use Android Studio to open local engine C++ source files and set breakpoints.
|
||||
|
||||
## Debugging Windows builds with Visual Studio
|
||||
|
||||
Compiling the engine creates a Visual Studio solution file. You can use it to debug the engine:
|
||||
|
||||
1. Launch your Flutter app using a locally built engine `flutter run -d windows --local-engine host_debug_unopt --local-engine-host host_debug_unopt`
|
||||
2. Using Visual Studio, open the engine's solution file `.\out\host_debug_unopt\all.sln`
|
||||
3. Open `Debug` > `Attach to Process...` (or press `CTRL+ALT+P`)
|
||||
4. Choose your Flutter app using either `Select Window`, or, the list of available processes.
|
||||
5. Press the `Attach` button
|
||||
|
||||
Building a Flutter app also creates a Visual Studio solution file. You can use it to debug the
|
||||
engine, your app's runner, and your app's plugins:
|
||||
|
||||
1. Build your Flutter app using a locally built engine using `flutter build windows --debug --local-engine host_debug_unopt --local-engine-host host_debug_unopt`
|
||||
2. Using Visual Studio, open the Flutter app's `.\build\windows\<project_name>.sln`
|
||||
3. In the `Solution Explorer` pane, right click the project whose name matches your app, and select `Set as Startup Project`
|
||||
|
||||

|
||||
|
||||
4. Now run your app by pressing `F5` or `DEBUG` > `Start Debugging`. This will launch your app with Visual Studio's debugger attached.
|
||||
|
||||
Read this guide to [learn how to debug C++ using Visual Studio](https://learn.microsoft.com/visualstudio/debugger/getting-started-with-the-debugger-cpp?view=vs-2022).
|
||||
|
||||
## Debugging with gdb on Linux
|
||||
|
||||
Once you have built the engine, you'll find the unstripped libraries in `out/host_debug_unopt/lib.unstripped`, and the executables in `out/host_debug_unopt/exe.unstripped`.
|
||||
|
||||
So, for instance, to run the unit tests under the debugger you would execute:
|
||||
|
||||
```shell
|
||||
flutter/tools/gn --runtime-mode=debug --unoptimized
|
||||
ninja -C out/host_debug_unopt
|
||||
gdb out/host_debug_unopt/exe.unstripped/flutter_linux_unittests
|
||||
```
|
||||
|
||||
And then debug the test normally using GDB commands.
|
||||
|
||||
To debug a Flutter app using GDB, the stripped flutter engine GTK library in the built application needs to be replaced with the unstripped one in the engine build output directory.
|
||||
|
||||
First, in your Flutter project, build your Flutter app using the local engine:
|
||||
|
||||
```shell
|
||||
flutter build linux --debug --local-engine=host_debug_unopt --local-engine-host=host_debug_unopt lib/main.dart
|
||||
```
|
||||
|
||||
Then, replace the library in your Flutter application's build directory: `build/linux/x64/debug/bundle/lib/libflutter_linux_gtk.so` with a copy or symbolic link to the engine build's output file `out/host_debug_unopt/lib.unstripped/libflutter_linux_gtk.so`.
|
||||
|
||||
Then you can open it in the debugger with:
|
||||
|
||||
```shell
|
||||
gdb build/linux/x64/debug/bundle/your_app_name
|
||||
```
|
||||
|
||||
Note that this won't help you debug the Dart portion of the app: this is just for debugging the engine code. If you need to simultaneously debug the Dart portion, you can connect to the observatory port given when you run the app in `gdb`.
|
||||
|
||||
## Logging in the engine
|
||||
|
||||
Flutter tool will by default parse out any non-error output from the engine. Error logs will be displayed. Logging is handled though the FML library's `logging.h`.
|
||||
305
docs/unsorted_wiki/Deferred-Components.md
Normal file
305
docs/unsorted_wiki/Deferred-Components.md
Normal file
@@ -0,0 +1,305 @@
|
||||
# Deferred Components
|
||||
|
||||
Deferred components is a set of features and tooling that allows developers to write dart code that can be AOT compiled into separate split dynamic libraries as well as package them together with assets into runtime downloadable modules on Android. The primary goal of deferred components is to reduce install apk size as well as reduce storage space taken up by the app by omitting features the user may not use.
|
||||
|
||||
This feature is currently an experimental/preview feature that is only available on Android. It takes advantage of Android and Google Play Store’s dynamic feature modules to deliver the deferred components packaged as Android modules. This does not impact other platforms, which continue to build as normal with all deferred components and assets included at initial install time.
|
||||
|
||||
Though modules can be defer loaded, the entire application must be completely built and uploaded as a single Android App Bundle (`.aab`). Dispatching partial updates without re-uploading new Android App Bundles for the entire application (eg, code push) is not supported.
|
||||
|
||||
This feature only does deferred loading in release and profile mode. In debug mode, all deferred components are present at launch and will instantly load.
|
||||
|
||||
A step by step guide on how to integrate deferred components with your app can be found on the [Flutter.dev documentation](https://flutter.dev/docs/perf/deferred-components).
|
||||
|
||||
## APK size gallery case study
|
||||
|
||||
Flutter Gallery implements deferred components for the crane study. Here, we will examine the initial install size gains in a [fully deferred Flutter gallery branch](https://github.com/flutter/gallery/tree/fully-deferred-gallery) (branch not kept up to date with master) where we implement deferred components for all studies and demos (not just crane). In this example, we have moved all the splittable assets and fonts into deferred components. Compared to a non-deferred components application, the initial installed APK file size breakdown is as follows:
|
||||
|
||||
Deferred components:
|
||||
|
||||
* base-arm64_v8a.apk - 12,325,372 bytes
|
||||
* base-master.apk - 37,889,309 bytes
|
||||
* Total deferred components initial installation size: 50,214,681 bytes
|
||||
|
||||
Non-deferred components (regular app):
|
||||
|
||||
* base-arm64_v8a.apk - 12,521,900 bytes
|
||||
* base-master.apk - 80,605,796 bytes
|
||||
* Total regular initial installation size: 93,127,696 bytes
|
||||
|
||||
Here, we can see a ~200kB decrease in compiled dart code size (base-arm64_v8a.apk) and a ~43mB decrease in assets (base-master.apk) on initial download. Overall, there is a 46% reduction in initial installation size. The dart code, assets, and google fonts are instead moved into separate components downloaded at runtime only when needed:
|
||||
|
||||
* Crane
|
||||
* Fortnightly
|
||||
* Rally
|
||||
* Shrine
|
||||
* Cupertino
|
||||
* Material
|
||||
* Reference
|
||||
|
||||
The total installed size with all components installed is slightly larger than the non-deferred app, but this increase is on the order of a few kb due to overhead in the dart shared libraries from ELF headers and cross-loading-unit calls.
|
||||
|
||||
## Deferred components app structure
|
||||
|
||||
The deferred Dart libraries are interpreted by `gen_snapshot` (Dart’s compiler) to produce “loading units”, each of which are output as a split AOT shared library (`.so` file) when building in profile or release mode. A loading unit is the smallest set of libraries that are imported exclusively with the deferred keyword by the main code and can be split off of the base libraries.
|
||||
|
||||
The following diagram shows an example app structure and a “lifecycle” of how deferred dart libraries are compiled into loading units and packaged into a `.aab` file.
|
||||
|
||||

|
||||
|
||||
This example app has the following properties:
|
||||
|
||||
* Four Dart libraries, with Dart libraries `lib1` and `lib2` dependent on each other. `lib1`, `lib3`, and `lib4` are imported in the flutter app’s main code as deferred.
|
||||
* Four loading units, with one being the base loading unit with id 1 and loading unit 2 containing both `lib1` and `lib2`. Loading units 3 and 4 contain `lib3` and `lib4` respectively.
|
||||
* Three defined deferred components, plus an implicit base component. `component1` contains loading unit 2 and assets. `component2` contains both loading units 3 and 4 and no assets. `component3` is an assets only component.
|
||||
* `app-release.aab` is the completed build output file, and contains all three components as well as the base component.
|
||||
|
||||
There will always be an implicit base loading unit that contains core flutter packages as well as your base application code. Any libraries that are not fully imported as deferred by your base app code will be included in the base loading unit. If no additional loading units other than base are generated, it likely means you imported your files incorrectly.
|
||||
|
||||
Multiple Dart libraries are compiled as a single loading unit if they import each other eagerly (non-deferred):
|
||||
|
||||

|
||||
|
||||
## Lifecycle of a `loadLibrary()` call
|
||||
|
||||
Deferred components are primarily triggered to be downloaded, installed, and loaded via the `loadLibrary()` dart call. This call is handled differently in dart2js vs aot/native. Here, we will trace how the `loadLibrary()` call is translated into an installation of a deferred component:
|
||||
|
||||

|
||||
|
||||
The `loadLibrary()` dart call's native side implementation calls a `Dart_DeferredLoadHandler` callback that is set using `Dart_SetDeferredLoadHandler` in `DartIsolate::Initialize`. Dart internally retrieves the loading unit ID assigned to the library and passes it to the callback. The callback is implemented as `DartIsolate::OnDartLoadLibrary`.
|
||||
|
||||
The loading unit ID is then passed on through the runtime controller, engine shell and platform view until it passes into the FlutterJNI in the Android embedder. Here, the loading unit ID is passed into the `DeferredComponentsManager`'s `installDeferredComponent` where the ID is converted from an integer to a String name identifying the pubspec-defined deferred component the requested library belongs to. This conversion is handled by a AndroidManifest metadata mapping that is created and verified during the build phase.
|
||||
|
||||
`PlayStoreDeferredComponentManager` then invokes the play store split compat APIs to download the android module. Once the Android module is installed, the manager locates the .so files and passes the paths to the engine to `dlopen`. The engine then passes the symbols to the runtime and and dart isolate, which is able to load the symbols into the dart VM. The loading must be associated with a loading unit ID or the load will not complete the Dart Future returned by `loadLibrary()`.
|
||||
|
||||
Keep in mind that multiple loading units may be contained in a deferred component, but a `loadLibrary` call will only load the dart symbols from the specific dart library the call was made from. Each loading unit must have separate `loadLibrary` calls before use. Subsequent `loadLibrary` calls on components that are already downloaded should complete much faster, however, the loading can never happen synchronously and there will be at least one frame between call and completion.
|
||||
|
||||
### Installation by deferred component string name
|
||||
|
||||
We also provide a [framework-side DeferredComponent utility class](https://master-api.flutter.dev/flutter/services/DeferredComponent-class.html) that allows direct installation via deferred component name as a string.
|
||||
|
||||
This installation path may be used for two purposes:
|
||||
|
||||
* Installing asset-only deferred components that do not have any Dart code to call `loadLibrary()` on.
|
||||
* Pre-downloading components to use later. However, `loadLibrary()` must still be called in order to use any dart code from the pre-downloaded component. This is useful when the exact dart library needed is not known yet.
|
||||
|
||||
The direct API uses platform channels to directly invoke the `installDeferredComponent` method on the `DynamicFeatureManager` and will not trigger any of the dart code packed in the component to load due to lack of a specified loading unit. Assets will be loaded. To use any dart code, `loadLibrary()` must still be called.
|
||||
|
||||
### Uninstallation
|
||||
|
||||
The [DeferredComponent](https://master-api.flutter.dev/flutter/services/DeferredComponent-class.html) framework utility class also provides an `uninstallDeferredComponent` method that uses platform channels to request that the OS uninstall and remove the files associated with the specified deferred component. Uninstallation is dependent on how the platform handles it and in Android's case, the removal of the files is queued and may take a long time before actually executed.
|
||||
|
||||
Uninstallation may only be requested directly with the string name of the component to be uninstalled. Uninstallation by loading unit id or direct call on a dart import is not yet supported.
|
||||
|
||||
## Tooling
|
||||
|
||||
Deferred components must be built as Android App Bundles (`.aab`) to function. If built as debug or an apk file, dart will compile normally and produce a single `.so` file.
|
||||
|
||||
Deferred components makes use of the existing `$ flutter build appbundle` command and checks for the existence of the `deferred-components:` entry in the `pubspec.yaml` to decide whether to build deferred or not. When the app is opted-in to deferred components and the build mode is release, `gen_snapshot` is passed a `--loading_unit_manifest` path, which tells `gen_snapshot` to attempt to produce split AOT artifacts. This includes a base file as well as a `.so` for every deferred library in the codebase. Each of these split units is called a "loading unit" and is assigned an internal integer ID called the loading unit ID.
|
||||
|
||||
The build process also relies on project setup to function. Each deferred component must correspond to an Android module defined in the `android` directory of your app. The base module is build as the `app` module while each additional component should have a module with the same name as the component. The base module `AndroidManifest.xml` also needs to include the mapping between loading unit IDs and deferred components.
|
||||
|
||||
The `flutter build appbundle` command assists in setting up the project with a validator that guides developers through the changes needed to build properly. This validator is necessary since the exact loading units produced by `gen_snapshot` is not known until `gen_snapshot` finishes compiling. Thus, some project setup can only be done after the `gen_snapshot` step in the build appbundle process.
|
||||
|
||||
Since mistakenly importing a deferred file as non-deferred can cause the file to be compiled into the base loading unit, the deferred components validator also has a mechanism for preventing accidental changes to the app's final generated loading units. This check will cause the build to fail if the generated loading units do not match the results of the previous run which is cached in the `deferred_components_loading_units.yaml` file. After throwing an error upon detecting changes, the build will automatically pass this check on next run if no additional changes are made. This means that this check is not error proof as you are still free to ignore the mismatched loading unit error if the change was intended and accounted for and continue to build.
|
||||
|
||||
***
|
||||
|
||||
# Fully deferring Flutter in add-to-app
|
||||
|
||||
When using add-to-app, it's possible to convert the entire Flutter module into an Android dynamic feature module to install at runtime.
|
||||
|
||||
Since the structures of add-to-app scenarios are highly variable, Flutter doesn't provide direct tooling to automate/validate full Flutter deferring. Instead, this guide provides details for implementing the components required for full Flutter deferring. The architecture described here is one of the many ways this can work, and is up to you to determine how best to integrate this into your apps.
|
||||
|
||||
Integrating full Flutter deferring is experimental. It requires custom implementations, and setup that is not fully tested due to variability in different apps. Therefore, this feature is considered a very advanced feature, and Flutter may not be able to provide guarantees or technical support for specific use cases.
|
||||
|
||||
Full Flutter deferral requires implementing `SplitInstallManager` in the base app module, as well as adding the dependency on `com.google.android.play:core` in `build.gradle` as an implementation. The dynamic feature module containing Flutter must depend on the base module.
|
||||
|
||||
The base module can no longer include any references to Flutter code. Therefore, the `:flutter` dependency in `build.gradle` should be removed.
|
||||
|
||||
The process described below uses the [fullscreen add-to-app example](https://github.com/flutter/samples/tree/master/add_to_app/fullscreen).
|
||||
|
||||
## SplitInstallManager base module "bootstrapper"
|
||||
|
||||
The base module must use `SplitInstallManager` to install the Flutter dynamic feature. For example, here is a bare-bones implementation called `SplitUtility` that downloads a dynamic feature module named `flutter` when `installFlutterModule` is called:
|
||||
|
||||
```java
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.play.core.splitinstall.SplitInstallException;
|
||||
import com.google.android.play.core.splitinstall.SplitInstallManager;
|
||||
import com.google.android.play.core.splitinstall.SplitInstallManagerFactory;
|
||||
import com.google.android.play.core.splitinstall.SplitInstallRequest;
|
||||
import com.google.android.play.core.splitinstall.SplitInstallSessionState;
|
||||
import com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener;
|
||||
import com.google.android.play.core.splitinstall.model.SplitInstallErrorCode;
|
||||
import com.google.android.play.core.splitinstall.model.SplitInstallSessionStatus;
|
||||
|
||||
class SplitUtility {
|
||||
private @NonNull SplitInstallManager splitInstallManager;
|
||||
private @NonNull FeatureInstallStateUpdatedListener listener;
|
||||
|
||||
private class FeatureInstallStateUpdatedListener implements SplitInstallStateUpdatedListener {
|
||||
@SuppressLint("DefaultLocale")
|
||||
public void onStateUpdate(SplitInstallSessionState state) {
|
||||
int sessionId = state.sessionId();
|
||||
switch (state.status()) {
|
||||
case SplitInstallSessionStatus.FAILED:
|
||||
break;
|
||||
case SplitInstallSessionStatus.INSTALLED:
|
||||
break;
|
||||
case SplitInstallSessionStatus.CANCELED:
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SplitUtility(Context context) {
|
||||
splitInstallManager = SplitInstallManagerFactory.create(context);
|
||||
listener = new FeatureInstallStateUpdatedListener();
|
||||
splitInstallManager.registerListener(listener);
|
||||
}
|
||||
|
||||
void installFlutterModule() {
|
||||
SplitInstallRequest request =
|
||||
SplitInstallRequest.newBuilder().addModule("flutter").build();
|
||||
|
||||
splitInstallManager
|
||||
// Submits the request to install the module through the
|
||||
// asynchronous startInstall() task. Your app needs to be
|
||||
// in the foreground to submit the request.
|
||||
.startInstall(request)
|
||||
// Called when the install request is sent successfully. This is different than a successful
|
||||
// install which is handled in FeatureInstallStateUpdatedListener.
|
||||
.addOnSuccessListener(
|
||||
sessionId -> {
|
||||
// store sessionId somewhere if you want to reference it again.
|
||||
})
|
||||
.addOnFailureListener(
|
||||
exception -> {
|
||||
switch (((SplitInstallException) exception).getErrorCode()) {
|
||||
case SplitInstallErrorCode.NETWORK_ERROR:
|
||||
break;
|
||||
case SplitInstallErrorCode.MODULE_UNAVAILABLE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
splitInstallManager.unregisterListener(listener);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The base module should install the Flutter module when appropriate. `PlayStoreDeferredComponentsManager` actually provides much of the same functionality, but it lives inside the Flutter Android embedding, and thus cannot be referenced from the base module.
|
||||
|
||||
## Project configuration
|
||||
|
||||
`build.gradle` of the base module as well as the flutter module should be modified to convert it into a dynamic feature module. The default Flutter android module used is located in the `.android/Flutter` directory.
|
||||
|
||||
It's recommended that you change the path of the Android module as the `.android` directory may be cleared or regenerated by cleaning tasks. You can set a different module or a clone of the default one as the module root directory with `project(":flutter").projectDir = new File(“<relative>.<path>.<to>.<module>”)` in your main android project’s `settings.gradle`.
|
||||
|
||||
The following configuration changes are the base changes needed to convert a fullscreen Flutter add-to-app implementation into a dynamic feature module.
|
||||
|
||||
Base module `build.gradle`:
|
||||
|
||||
* Add `dynamicFeatures = [':flutter']` to the `android` section of the base module `build.gradle`.
|
||||
* Remove `implementation project(':flutter')` from the dependencies section (the dynamic feature module must depend on the base module).
|
||||
* Add `implementation "com.google.android.play:core:1.8.0"` to the dependencies section.
|
||||
|
||||
Flutter module `build.gradle`:
|
||||
|
||||
* Replace `apply plugin: 'com.android.library'` with `apply plugin: 'com.android.dynamic-feature'` in the Flutter module `build.gradle`
|
||||
* Add a dependencies section to the Flutter module `build.gradle`:
|
||||
|
||||
```gradle
|
||||
dependencies {
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
implementation project(":app")
|
||||
api 'androidx.test:core:1.2.0'
|
||||
}
|
||||
```
|
||||
|
||||
Flutter module `AndroidManifest.xml`:
|
||||
|
||||
* Add `xmlns:dist="http://schemas.android.com/apk/distribution"` to the `manifest` section
|
||||
* Add the dynamic feature module section:
|
||||
|
||||
```xml
|
||||
<dist:module
|
||||
dist:instant="false"
|
||||
dist:title="@string/title_fluttermodule">
|
||||
<dist:delivery>
|
||||
<dist:on-demand />
|
||||
</dist:delivery>
|
||||
<dist:fusing dist:include="true" />
|
||||
</dist:module>
|
||||
```
|
||||
|
||||
Any references to the Flutter Java API will need to be done within your newly dynamic feature module. You are no longer able to directly launch a `FlutterActivity` from your main activity, and must now wrap it in a new class inside your dynamic feature module.
|
||||
|
||||
It is recommended to create a new Android Activity in your dynamic Flutter module that implements all of the behavior from your base application and base Activity. After installing the Flutter Android split, the new dynamic Flutter Activity can then be launched.
|
||||
|
||||
Depending on your specific apps, additional configuration may be needed to build and run your apps.
|
||||
|
||||
## Regular deferred components integration
|
||||
|
||||
We have not yet tested integration with a pure Flutter app using deferred components.
|
||||
|
||||
Flutter's tooling doesn't yet support building add-to-app and deferred components together. However, it is technically possible to run `gen_snapshot` in split AOT mode, and then package the different `.so` files into additional dynamic feature modules. See the Custom Implementation below for additional details.
|
||||
|
||||
***
|
||||
|
||||
# Custom Implementations
|
||||
|
||||
It's possible to write a custom implementation that bypasses the Android Play store. This is only recommended for advanced developers, and is primarily aimed at apps with very unique needs such as extremely large asset components, specific download behavior, or distribution in a region that does not have access to the Play Store (e.g. China).
|
||||
|
||||
### Overview
|
||||
|
||||
The Flutter Embedder allows custom implementations that handle customer-unique download and unpacking of deferred components while still allowing access to the core Dart callbacks that register a loading unit with the Dart runtime. This process is far more involved than the default play store version.
|
||||
|
||||
To implement a custom deferred components system, the following major pieces are required:
|
||||
|
||||
* Android embedder implementation of `DeferredComponentManager` that handles communication between the app and the server as well as extracting the `.so` file and assets from the downloaded component.
|
||||
* Tooling to package the components in a way that is compatible with your `DeferredComponentManager` and to interpret `gen_snapshot` output of loading units.
|
||||
* A server to host the downloadable components. Without the Play Store acting as a distributor for Android dynamic feature modules, this must be custom.
|
||||
|
||||
The following sections provide a high level guide of what needs to be done in a custom implementation.
|
||||
|
||||
### DeferredComponentManager - Android Embedder
|
||||
|
||||
The Embedder is responsible for downloading and installing the packaged component files. This can be done by implementing the abstract class `DeferredComponentManager` in the Android Embedder.
|
||||
|
||||
The entry point into this class is `installDeferredComponent` which provides both a loading unit id and the component name to help determine what to install.
|
||||
|
||||
`loadLibrary()` calls will pass only a loading unit id while `DeferredComponent.installDeferredComponent()` calls from the framework services package will pass only a component name to load an assets-only component.
|
||||
|
||||
In order to resolve a specific component from the loading unit id, it is typically necessary to store a mapping of loading unit ids to the component name. In the default implementation, we accomplish this by storing a string meta-data in the base app’s `AndroidManifest.xml`, but this can be accomplished in any way desired.
|
||||
|
||||
You may find detailed explanations of each method in `DeferredComponentManager` in the engine source file at `shell/platform/android/io/flutter/embedding/engine/deferredcomponents/DeferredComponentManager.java`.
|
||||
|
||||
The default Play Store implementation is found at `shell/platform/android/io/flutter/embedding/engine/deferredcomponents/PlayStoreDeferredComponentManager.java` and can be used as a rough guide on what needs to be implemented.
|
||||
|
||||
To load Dart libraries, call `FlutterJNI.loadDartDeferredLibrary` with the loading unit id, and a list of paths that potentially contain the `.so` file in your `loadDartLibrary` implementation. The engine will call `dlopen` on each of the paths provided until one is successfully opened.
|
||||
|
||||
To load new assets, create an Android `AssetManager` that has access to the newly downloaded assets. Pass this `AssetManager` to `FlutterJNI.updateJavaAssetManager`.
|
||||
|
||||
The `FlutterJNI` instance is passed in via `setJNI`.
|
||||
|
||||
### Tooling
|
||||
|
||||
Flutter’s tooling comes with the capability to instruct `gen_snapshot` to build split AOT, and pack the `.so` files and assets into an Android dynamic feature module.
|
||||
|
||||
Custom implementations are typically unable to make use of this tooling. Therefore, you may have to write custom tooling to package the `.so` files and assets, so they work alongside the custom `DeferredComponentManager` implementation.
|
||||
|
||||
To make `gen_snapshot` generate loading units, and the `.so` shared libraries, pass the `--loading_unit_manifest=<manifestPath>` option to `gen_snapshot`.
|
||||
|
||||
This will create a .json file at your `manifestPath` that contains the loading units and corresponding `.so` libs generated. The `.so` file and assets can then be packed in whatever format you wish to distribute on your file server. It is also your responsibility to unpack this format in your `DeferredComponentManager` implementation.
|
||||
|
||||
### File server
|
||||
|
||||
Since custom implementations typically do not use the Play store, a custom system for hosting and serving files to end users should be implemented. This part is highly variable in how it can be accomplished, and the only requirement is that it functions in tandem with the `DeferredComponentManager` implementation, so it delivers the files needed to load Dart shared libraries, and assets.
|
||||
65
docs/unsorted_wiki/Design-Documents.md
Normal file
65
docs/unsorted_wiki/Design-Documents.md
Normal file
@@ -0,0 +1,65 @@
|
||||
If you want to write a design doc for people to review, we recommend using Google Docs.
|
||||
We have a template you can use, at [flutter.dev/go/template](https://flutter.dev/go/template). It describes the process for minting a `flutter.dev/go/foo` shortlink for your design doc.
|
||||
We recommend you use that template so that people can immediately recognize that this is a Flutter design document and that it is shared publicly.
|
||||
|
||||
Don't forget to configure your document's Sharing settings so that everyone has comment access. The idea of sharing the document in this way is not necessarily to proactively obtain feedback from the entire community; it is to make it _possible_ for people to share the document with anyone in the community, whether they work for your employer or not, and whether you have personally shared the document with them yet or not.
|
||||
|
||||
The template discusses how to create a shortlink for your design doc (flutter.dev/go/...). When creating the shortlink, remember to test the URL you are publishing in an incognito window!
|
||||
|
||||
Googlers: Design docs must be created by non-corp accounts! See [Contributor Access](https://github.com/flutter/flutter/wiki/Contributor-access#fcontriborg-accounts) for details on getting `fcontrib.org` accounts if you don't want to use your personal GMail account.
|
||||
|
||||
When you implement a design, document it in the source code in detail. The API documentation is the usual place where we document our designs. It's perfectly reasonable for API docs to be multiple pages long with subheadings (e.g. see the docs for [RenderBox](https://master-api.flutter.dev/flutter/rendering/RenderBox-class.html)!). Do not assume that anyone will ever read your design doc after the discussion has finished. Similarly, do not assume that anyone will look at closed GitHub issues or PR discussions.
|
||||
|
||||
_See also: [list of current design docs](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3A%22design+doc%22)_
|
||||
|
||||
## Purpose of design docs
|
||||
|
||||
The Flutter project uses design docs as a tool for guiding discussions.
|
||||
|
||||
Decisions are made in PRs, not in design docs.
|
||||
|
||||
Approvals are given in PRs, not in design docs.
|
||||
|
||||
## Soliciting feedback
|
||||
|
||||
If you wish to get feedback on your design doc, you have many options for doing so, depending on how much feedback you want:
|
||||
|
||||
* If there is an issue already filed on the topic, definitely put a link to the design doc there. People who have found the issue and want to get updates on the topic will have subscribed to the issue, so this is the most effective way to communicate with them.
|
||||
|
||||
* File a new issue to track the design doc using [the design doc issue template](https://github.com/flutter/flutter/issues/new?labels=design+doc&template=8_design_doc.yml). Assign it to yourself.
|
||||
|
||||
* Post the link on Discord. You can post it to #hidden-chat to just get feedback from team members. You can post it to one or more of the #hackers-* channels if you want feedback from people who are interested in the general area. You can post it to the global #hackers channel if you want feedback from anyone interested in working on Flutter. If you really want feedback, you can post a request to #announcements and publish it to any server that is following ours.
|
||||
|
||||
* If you want feedback from the broad community, tweet out the link and let other team members know so that we can retweet it. Similarly, you can post the request to one of the Flutter reddit channels, such as r/FlutterDev.
|
||||
|
||||
* You can ask our developer relations (devrel) team to broadcast a request for comments. (Start by asking in #hackers-devrel; if nobody responds, ping Hixie on that channel.)
|
||||
|
||||
* You can ask our user experience researcher (UXR) team to study the proposal and potentially test it with real users, or collect relevant data from the next quarterly survey. (Start by asking in #hackers-devexp; if nobody responds, ping Hixie on that channel.)
|
||||
|
||||
* If you have commit access, you can ask to talk about the design doc at the next Dash Forum meeting (normally held on Tuesdays at 11am US west coast time). Ping Hixie on #hidden-chat to get on the schedule, or use the form to request to be added, the link for which is pinned in the #hidden-chat channel.
|
||||
|
||||
### How to get good feedback
|
||||
|
||||
Often, you will solicit feedback, and get none. There are many causes of this.
|
||||
|
||||
Maybe your proposal is unclear, and so people don't really know what to suggest. People are often reluctant to provide broad criticisms. Consider if you can improve the clarity of your design doc. Do you have a clear problem statement separate from your solution? Do you show example code of the problem? Do you have screenshots or diagrams of the problem? For your solution, do you start from first principles and explain it? Often it's easy to forget that your readers don't have the same context you do, so without a gentle introduction they'll get lost very quickly. Do you have sample code of your proposed solution(s)? Do you need more diagrams or screenshots? Ask someone you trust if they think your document is sufficiently clear.
|
||||
|
||||
Maybe your proposal is too big for anyone to get their head around. Can it be split into smaller components, so that each one can be understood separately, before bringing all the pieces together into your grand design? (You can do this all in the same doc.)
|
||||
|
||||
Maybe people don't know what to provide feedback about. If you have an area you are particularly interested in getting feedback about, it can be very helpful to explicitly invite such feedback.
|
||||
|
||||
Maybe you are asking the wrong people. Consider the suggestions in the earlier section, and reach out explicitly to people who are affected by your proposal. Consider escalating, asking more and more people until you get the volume of feedback you desire.
|
||||
|
||||
Maybe everyone agrees. Consider leaving some intentionally sketchy details in your proposal to encourage people to engage! (This is a risky strategy, sometimes people end up _liking_ your "bad" ideas...)
|
||||
|
||||
Maybe your proposal is too obvious or uninteresting. Sometimes, a change is so uncontroversial and simple that frankly it would be better just to write the PR and submit it.
|
||||
|
||||
## Content in design docs
|
||||
|
||||
### Screen captures
|
||||
|
||||
The easiest way to capture videos for design docs is using macOS. Press Command+Shift+5 for a whole bunch of options.
|
||||
|
||||
### Diagrams
|
||||
|
||||
As we use Google Docs for the text portion of design docs, the easiest way to draw diagrams is using Google Diagrams. Select `Insert` > `Drawing` > `New` to create a new diagram.
|
||||
@@ -0,0 +1,32 @@
|
||||
Flutter includes support for developing on macOS devices with [Apple Silicon (M1) hardware](https://www.apple.com/mac/m1/). This wiki page documents ongoing work relating to the Flutter toolchain providing native support for this processor architecture.
|
||||
|
||||
We recommend using Flutter 2.5 or later on Apple Silicon machines. You must also have the [Rosetta 2 translation environment](https://developer.apple.com/documentation/apple_silicon/about_the_rosetta_translation_environment) available, which you can install manually by running:
|
||||
|
||||
```sh
|
||||
$ sudo softwareupdate --install-rosetta --agree-to-license
|
||||
```
|
||||
|
||||
If you see CocoaPods crashes related to `ffi`, try reinstalling the Ruby gem with the `--enable-libffi-alloc` flag:
|
||||
```
|
||||
sudo gem uninstall ffi && sudo gem install ffi -- --enable-libffi-alloc
|
||||
```
|
||||
|
||||
## Using macOS on Apple Silicon to develop Flutter apps (host)
|
||||
|
||||
You can use Apple Silicon-based Mac devices as a developer workstation (host) for building Flutter apps. While some tools still use Rosetta, Apple Silicon-based Macs are fully supported as a host.
|
||||
|
||||
As we build more Apple Silicon support into the tooling, and depending on your tolerance for risk, [you may want to experiment with the `beta` channel](https://flutter.dev/docs/development/tools/sdk/upgrading#switching-flutter-channels). (This was previously also available on the dev channel, but [it has been retired](https://medium.com/flutter/whats-new-in-flutter-2-8-d085b763d181#34c4).)
|
||||
|
||||
[Issue 60118](https://github.com/flutter/flutter/issues/60118) tracks the full set of work to support this feature.
|
||||
|
||||
## Developing Flutter apps for macOS running on Apple Silicon (target)
|
||||
|
||||
Flutter has [support for building macOS apps](https://flutter.dev/desktop), with beta snapshots available in the `stable` channel and ongoing development taking place.
|
||||
|
||||
Compiled Intel macOS binaries work on Apple Silicon without change thanks to the [Rosetta 2 translation environment](https://developer.apple.com/documentation/apple_silicon/about_the_rosetta_translation_environment), which converts x86_64 instructions to ARM64 equivalents.
|
||||
|
||||
We also plan to offer support for compilation directly to ARM64, as well as universal binaries that combine x86_64 and ARM64 assets. [Issue 60113](https://github.com/flutter/flutter/issues/60113) is the umbrella bug tracking this work.
|
||||
|
||||
## Filing Issues
|
||||
|
||||
If you experience a problem relating to using Flutter on Apple Silicon hardware, please [file an issue on GitHub](https://github.com/flutter/flutter/issues/new?assignees=&labels=&template=1_activation.md&title=) with specific repro steps and information about your hardware and software configuration (paste the results of `flutter doctor -v`). Thank you!
|
||||
56
docs/unsorted_wiki/Engine-Clang-Tidy-Linter.md
Normal file
56
docs/unsorted_wiki/Engine-Clang-Tidy-Linter.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# Engine Clang Tidy Linter
|
||||
|
||||
## Description
|
||||
|
||||
In May 2020, [`clang-tidy`](https://clang.llvm.org/extra/clang-tidy/) was added as a CI step to the Flutter Engine. Previously the only lint checks that were happening in the engine were formatting, there were no semantic checks. Now there are, but that means there is work to be done migrating all the code to conform to all the lint checks.
|
||||
|
||||
If a file has `// FLUTTER_NOLINT` at the top, it has issues with the lint that haven't been addressed and the linter will ignore it. As the issues are fixed the comments should be removed.
|
||||
|
||||
You can run the linter locally by running `flutter/ci/lint.sh`.
|
||||
|
||||
## CI background information
|
||||
|
||||
* The clang-tidy ci step is run 4 times: host_debug on mac, ios_debug on mac, host_debug on linux, android_debug_arm64 on linux.
|
||||
* Before the linter can run, the target must be built in order to generate code.
|
||||
* Clang-tidy jobs are sharded such that the intersection of files in iOS and macOS are shared, similarly for Linux and Android.
|
||||
|
||||
## FAQs
|
||||
|
||||
### I don't understand this lint error, where do I get help?
|
||||
|
||||
You can ask on the `hackers-engine` discord channel. Ping @gaaclarke or @zanderso if you don't get the response you want.
|
||||
|
||||
### Hey, why are/aren't you checking for X?
|
||||
|
||||
The checks that are enabled are negotiable. If you think we are missing something, please discuss it on `hacker-engine`.
|
||||
|
||||
### Can I just use `NOLINT` to turn off the error?
|
||||
|
||||
You can, but please get explicit approval to do from someone on the team.
|
||||
|
||||
### How do I turn on a large new lint?
|
||||
|
||||
Here are things that can make it easier to land large new lints.
|
||||
|
||||
#### Tips
|
||||
|
||||
* Try to reduce the number of checks you are turning on at a time, they can have cascading effects where fixing one check with "clang-tidy fix" can cause violations with other checks.
|
||||
* Prefer using NOLINTNEXTLINE over NOLINT since auto formatting can move NOLINT comments and break them.
|
||||
|
||||
#### Clang-tidy fix on CI
|
||||
|
||||
Instead of running clang-tidy fix locally on your machines 4 times you can get the CI bots to print out the fix. Here's steps on how to do that:
|
||||
|
||||
1. Edit `//ci/clang_tidy.sh`:
|
||||
```diff
|
||||
# To run on CI, just uncomment the following line:
|
||||
-# FLUTTER_LINT_PRINT_FIX=1
|
||||
+FLUTTER_LINT_PRINT_FIX=1
|
||||
```
|
||||
This will run on _all_ files, and print out the patch generated by `clang-tidy fix` in the CI bots.
|
||||
|
||||
2. Make a draft PR with the check added and FLUTTER_LINT_PRINT_FIX=1
|
||||
3. Look at the output of failed clang-tidy runs and make sure that it didn't garble the fix. Sometimes that happens and if it does, you'll have to manually fix where it garbled the fix or use NOLINTNEXTLINE.
|
||||
4. Copy the patch the CI bot printed out to the clipboard, in the terminal, at the engine repo, use `git apply`, paste the patch, press ctrl+d then enter. Watch out that there can be overlapping patches between the mac runs and the linux runs since we don't shard across platforms.
|
||||
5. Commit and push that.
|
||||
6. When the 4 CI runs are green, remove FLUTTER_LINT_PRINT_FIX=1 and put up for review
|
||||
33
docs/unsorted_wiki/Engine-disk-footprint.md
Normal file
33
docs/unsorted_wiki/Engine-disk-footprint.md
Normal file
@@ -0,0 +1,33 @@
|
||||
## Treemaps
|
||||
|
||||
For each commit to [flutter/engine](https://github.com/flutter/engine) the Chromebots generate treemaps illustrating the sizes of the individual components within release builds of `libflutter.so`. The treemap is uploaded to Google Cloud Storage and linked from the [LUCI](https://ci.chromium.org/p/flutter/g/engine/console) console: Select a "Linux aot" build and search for "Open Treemap".
|
||||
|
||||
Alternatively, a link to a treemap can be constructed as follows:
|
||||
|
||||
`https://storage.googleapis.com/flutter_infra_release/flutter/<REVISION>/<VARIANT>/sizes/index.html` where:
|
||||
* `<REVISION>` is the git hash from [flutter/engine](https://github.com/flutter/engine) for which you want the treemap, and
|
||||
* `<VARIANT>` can be any android release build, e.g. `android-arm-release` or `android-arm64-release`.
|
||||
|
||||
## Benchmarks
|
||||
|
||||
In [devicelab](https://github.com/flutter/flutter/tree/master/dev/devicelab) we run various benchmarks to track the APK/IPA sizes and various (engine) artifacts contained within. These benchmarks run for every commit to [flutter/flutter](https://github.com/flutter/flutter) and are visible on our [build dashboard](https://flutter-dashboard.appspot.com/). The most relevant benchmarks for engine size are:
|
||||
|
||||
* APK/IPA size of Flutter Gallery
|
||||
* Android: `flutter_gallery_android__compile/release_size_bytes`
|
||||
* iOS: `flutter_gallery_ios__compile/release_size_bytes`
|
||||
* APK/IPA size of minimal hello_world app
|
||||
* Android: `hello_world_android__compile/release_size_bytes`
|
||||
* iOS: `hello_world_ios__compile/release_size_bytes`
|
||||
* Size of bundled `icudtl.dat`
|
||||
* Compressed in APK: `hello_world_android__compile/icudtl_compressed_bytes`
|
||||
* Uncompressed: `hello_world_android__compile/icudtl_uncompressed_bytes`
|
||||
* Size of bundled `libflutter.so` (release mode)
|
||||
* Compressed in APK: `hello_world_android__compile/libflutter_compressed_bytes`
|
||||
* Uncompressed: `hello_world_android__compile/libflutter_uncompressed_bytes`
|
||||
* Size of VM & isolate snapshots (data and instructions)
|
||||
* Compressed in APK: `hello_world_android__compile/snapshot_compressed_bytes`
|
||||
* Uncompressed: `hello_world_android__compile/snapshot_uncompressed_bytes`
|
||||
|
||||
## Comparing AOT Snapshot Sizes
|
||||
|
||||
A detailed comparison of AOT snapshot sizes can be performed using the [instructions documented here](https://github.com/flutter/flutter/wiki/Comparing-AOT-Snapshot-Sizes).
|
||||
79
docs/unsorted_wiki/Engine-pre‐submits-and-post‐submits.md
Normal file
79
docs/unsorted_wiki/Engine-pre‐submits-and-post‐submits.md
Normal file
@@ -0,0 +1,79 @@
|
||||
The Flutter engine repo runs both pre-submit (before merging) and post-submit (after merging) suites of tests and checks, defined in [`.ci.yaml`](https://github.com/flutter/engine/blob/main/.ci.yaml).
|
||||
|
||||
> [!TIP]
|
||||
> See [Cocoon Scheduler](https://github.com/flutter/cocoon/blob/main/CI_YAML.md) for details.
|
||||
|
||||
Failure to run appropriate tests for changes can (and do) result in the engine tree turning red, which in turn causes an expensive cascade of developers being blocked, investigative work, reverts, and roll-forwards. Where possible, all attempts should be made to run any/all tests _before_ merging a PR. See nuances (below) for exceptional cases.
|
||||
|
||||
<!-- Github Wikis do not support an automatic index, sorry -->
|
||||
|
||||
* [Pre-submit](#pre-submit)
|
||||
* [Post-submit](#post-submit)
|
||||
* [Running post-submits eagerly](#running-post-submits-eagerly)
|
||||
|
||||
## Pre-submit
|
||||
|
||||
Presubmits run (and are required to be passing) to merge a PR:
|
||||
|
||||
<img width="839" alt="Checks" src="https://github.com/flutter/flutter/assets/168174/dff8e2b4-2a71-4929-b163-2ac437675380">
|
||||
|
||||
<p>
|
||||
|
||||
For example, the `linux_host_engine` target above runs based on the configuration in [`ci/builders/linux_host_engine.json`](https://github.com/flutter/engine/blob/458956228dad9837956aeb78b2988879e764a0b2/ci/builders/linux_host_engine.json).
|
||||
|
||||
### Nuances
|
||||
|
||||
Typically, pre-submits _always_ run on every PR, and don't need any special attention (other than keeping them green). There are two exceptions:
|
||||
|
||||
1. Targets that provide a `runIf: ...` configuration
|
||||
2. Changes that impact Clang Tidy
|
||||
|
||||
> [!WARNING]
|
||||
>
|
||||
> `runIf: ...` is a powerful (but dangerous) feature that trades predictability for speed.
|
||||
>
|
||||
> `runIf` will skip certain targets if a particular file (or commonly, sets of files) are not changed in a given PR.
|
||||
>
|
||||
> For example, the [`linux_clang_tidy_presubmit`](https://github.com/flutter/engine/blob/991676f3bc9482eaaeb3764b6b835f0e3ff8b3c5/.ci.yaml#L219-L235) target will not run if only markdown (`*.md`) files are changed.
|
||||
|
||||
Clang Tidy, on the other hand, is only run on _files that have changed in a given PR_. For example, if you have:
|
||||
|
||||
```h
|
||||
// impeller/a.h
|
||||
struct A {}
|
||||
```
|
||||
|
||||
... files that import that header, such as `impeller/foo/bar/baz.cc`, will _not_ be run in pre-submit. This means that changing (or updating the `DEPS` of libraries that provide) headers is _not_ a safe change, and will _not_ be detected in pre-submit. As an example, [#48705](https://github.com/flutter/engine/pull/48705) had to be reverted (despite passing all pre-submit checks), because the Clang Tidy _post-submit_ caught a failure.
|
||||
|
||||
See [post-submit](#post-submit) below for options to run post-submits eagerly (i.e. as a pre-submit).
|
||||
|
||||
## Post-submit
|
||||
|
||||
Some (albeit fewer) targets are configured with the property `presubmit: false`:
|
||||
|
||||
```yaml
|
||||
- name: Mac mac_clang_tidy
|
||||
recipe: engine_v2/engine_v2
|
||||
presubmit: false
|
||||
```
|
||||
|
||||
These targets will _not_ show up during a PR, and will not be executed, but can (and do) turn the tree red.
|
||||
|
||||
### Running post-submits eagerly
|
||||
|
||||
We've intentionally chosen to make it _easier_ to land PRs, at the cost of turning the tree red periodically because post-submit checks catch something that the developer did not intend (or even know about). As a code author (or reviewer), you can optionally turn on post-submits to run eagerly (during pre-submit) by adding the label `test: all` (available only in the `flutter/engine` repo).
|
||||
|
||||
Add the label, and push the PR (or a new commit, **the scheduler will not understand the label being added without a commit**):
|
||||
|
||||
<img width="311" alt="Screenshot 2023-12-07 at 1 55 48 PM" src="https://github.com/flutter/flutter/assets/168174/9a4d88b8-8e67-4e96-805a-adb21f06a4c2">
|
||||
|
||||
<p>
|
||||
|
||||
For example, [#48158](https://github.com/flutter/engine/pull/48158) ran _all_ of the checks, including what is typically post-submits:
|
||||
|
||||
<img width="319" alt="Screenshot 2023-12-07 at 1 55 39 PM" src="https://github.com/flutter/flutter/assets/168174/67abd263-c516-4240-b82b-a9b691543951">
|
||||
|
||||
<p>
|
||||
|
||||
> [!WARNING]
|
||||
> This increases the use of workers/capacity, and should be discouraged to be used on _all_ PRs.
|
||||
32
docs/unsorted_wiki/Engine-repo.md
Normal file
32
docs/unsorted_wiki/Engine-repo.md
Normal file
@@ -0,0 +1,32 @@
|
||||
This is an index of team-facing documentation for the [flutter/engine repository](https://github.com/flutter/engine/).
|
||||
|
||||
- [[Accessibility on Windows]]
|
||||
- [[Code signing metadata]] for engine binaries
|
||||
- [[Compiling the engine]]
|
||||
- [[Comparing AOT Snapshot Sizes]]
|
||||
- [[Crashes]]
|
||||
- [[Custom Flutter engine embedders]]
|
||||
- [[Custom Flutter Engine Embedding in AOT Mode]]
|
||||
- [[Debugging the engine]]
|
||||
- [[Flutter engine operation in AOT Mode]]
|
||||
- [[Flutter Test Fonts]]
|
||||
- [[Flutter's modes]]
|
||||
- [[Engine Clang Tidy Linter]]
|
||||
- [[Engine disk footprint]]
|
||||
- [[Engine-specific Service Protocol extensions]]
|
||||
- [[Engine pre‐submits and post‐submits]]
|
||||
- [[Image Codecs in the Flutter Engine]]
|
||||
- [[Impeller]] documentation index
|
||||
- [[Life of a Flutter Frame]]
|
||||
- [[Reduce Flutter engine size with MLGO]]
|
||||
- [[Resolving common build failures]]
|
||||
- [[Setting up the Engine development environment]]
|
||||
- [[Supporting legacy platforms]]
|
||||
- [[Testing Android Changes in the Devicelab on an Emulator]]
|
||||
- [[Testing the engine]]
|
||||
- [[Testing presubmit Engine PRs with the Flutter framework]]
|
||||
- [[The Engine architecture]]
|
||||
- [[Upgrading Engine's Android API version]]
|
||||
- [[Using the Dart Development Service (DDS) and Flutter DevTools with a custom Flutter Engine Embedding]]
|
||||
- [[Using Sanitizers with the Flutter Engine]]
|
||||
- [[Why we have a separate engine repo]]
|
||||
@@ -0,0 +1,203 @@
|
||||
The Flutter engine adds several extensions to the [Dart VM Service Protocol](https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md). The Flutter Engine specific extensions are documented here. Applications may also choose to register their [own extensions](https://api.dartlang.org/stable/1.24.3/dart-developer/registerExtension.html).
|
||||
|
||||
## List views: `_flutter.listViews`
|
||||
|
||||
Tooling requests this very early in the application lifecycle to ask for the details of the root isolate.
|
||||
|
||||
No arguments.
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "FlutterViewList",
|
||||
"views": [
|
||||
{
|
||||
"type": "FlutterView",
|
||||
"id": "_flutterView/0x1066096d8",
|
||||
"isolate": {
|
||||
"type": "@Isolate",
|
||||
"fixedId": true,
|
||||
"id": "isolates/453229818",
|
||||
"name": "main.dart$main-453229818",
|
||||
"number": 453229818
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Isolate Restart or Cold Reload: `_flutter.runInView`
|
||||
|
||||
The IDE has requested (or the user pressed ‘R’ from the ‘flutter run’ interactive console) a cold reload. For example, this happens when the user presses the green play button.
|
||||
|
||||
Used to "cold reload" a running application where the shell (along with the platform view and its rasterizer bindings) remains the same but the root isolate is torn down and restarted with the new configuration. Only used in the development workflow.
|
||||
|
||||
The previous root isolate is killed and its identifier invalidated after this call. Callers can query the new isolate identifier using the `_flutter.listViews` method.
|
||||
|
||||
Four arguments:
|
||||
|
||||
```
|
||||
viewId = _flutterView/0x14ba08c68
|
||||
mainScript = /path/to/application/lib/main.dart
|
||||
packagesFile = /path/to/application/.packages
|
||||
assetDirectory = /path/to/application/build/flutter_assets
|
||||
```
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "Success",
|
||||
"view": {
|
||||
"type": "FlutterView",
|
||||
"id": "_flutterView/0x104e0ab58",
|
||||
"isolate": {
|
||||
"type": "@Isolate",
|
||||
"fixedId": true,
|
||||
"id": "isolates/1056589762",
|
||||
"name": "main.dart$main-1056589762",
|
||||
"number": 1056589762
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The object in the **view** key is constructed in the same way as the views in the **List Views** method.
|
||||
|
||||
|
||||
## Flush UI thread tasks: `_flutter.flushUIThreadTasks`
|
||||
|
||||
Does nothing but waits for all pending tasks on the UI thread to be completed before returning success to the service protocol caller.
|
||||
|
||||
No arguments.
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{"type": "Success"}
|
||||
```
|
||||
|
||||
## Get screenshot of view as PNG: `_flutter.screenshot`
|
||||
|
||||
Get the screenshot as PNG of a random Flutter view on the device. The screenshot data will be base64 encoded in the response body.
|
||||
|
||||
No arguments.
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "Screenshot",
|
||||
"screenshot": "<base64_data>"
|
||||
}
|
||||
```
|
||||
|
||||
## Get screenshot of view as Skia picture: `_flutter.screenshotSkp`
|
||||
|
||||
Get the Skia SKP of a random Flutter view on the device. The SKP data will be base64 encoded in the response body.
|
||||
|
||||
No arguments.
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "ScreenshotSkp",
|
||||
"skp": "<base64_data>"
|
||||
}
|
||||
```
|
||||
|
||||
## Update asset bundle path: `_flutter.setAssetBundlePath`
|
||||
|
||||
In case of a hot-reload, the service protocol handles source code updates. However, there may be changes to assets. The DevFS updates assets in an separate directory that needs to be used by the engine.
|
||||
|
||||
Two arguments:
|
||||
|
||||
```
|
||||
viewId = _flutterView/0x15bf057f8
|
||||
assetDirectory = /path/to/flutter_assets
|
||||
```
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "Success",
|
||||
"view": {
|
||||
"type": "FlutterView",
|
||||
"id": "_flutterView/0x104e0ab58",
|
||||
"isolate": {
|
||||
"type": "@Isolate",
|
||||
"fixedId": true,
|
||||
"id": "isolates/1056589762",
|
||||
"name": "main.dart$main-1056589762",
|
||||
"number": 1056589762
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The object in the **view** key is constructed in the same way as the views in the **List Views** method.
|
||||
|
||||
## Get the display refresh rate: `_flutter.getDisplayRefreshRate`
|
||||
|
||||
Get the display refresh rate of the actual device that runs the Flutter view. For example, most devices would return an fps of 60, while iPad Pro would return an fps of 120.
|
||||
|
||||
One argument:
|
||||
|
||||
```
|
||||
viewId = _flutterView/0x15bf057f8
|
||||
```
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "DisplayRefreshRate",
|
||||
"fps": 60.0
|
||||
}
|
||||
```
|
||||
|
||||
## Get Skia SkSL shader artifacts: `_flutter.getSkSLs`
|
||||
|
||||
Get Skia SkSL shader artifacts from an actual device that runs the Flutter view. Such artifacts can be used to warm up shader compilations and avoid jank. One has to first tell Flutter to prepare SkSL shaders by `flutter run --cache-sksl` or `flutter drive --cache-sksl`, and trigger some shader compilations by going through some animations/transitions. Otherwise, this service protocol extension may return an empty set of SkSLs.
|
||||
|
||||
The key of the returned `SkSLs` map will be Base32 encoded. It should be used directly as the filename of the shader artifact. The value in that map is the Base64 encoded SkSL shader. Once decoded, it should be the content of the shader artifact file.
|
||||
|
||||
One argument:
|
||||
|
||||
```
|
||||
viewId = _flutterView/0x15bf057f8
|
||||
```
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "GetSkSLs",
|
||||
"SkSLs": {
|
||||
"CAZAAAACAAAAAAAAAAABGAABAAOAAFAADQAAGAAQABSQAAAAAAAAAAAAAABAAAAAEAAGGAA": "eQ=="
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Estimate raster cache memory usage: `_flutter.estimateRasterCacheMemory`
|
||||
|
||||
Estimate the memory usage of both picture and layer raster cache. For each picture or layer cached, there is a rasterized `SkImage` of that picture or layer to speed up future draws. Only `SkImage`'s memory usage is counted as other objects in the cache system are often much smaller compared to `SkImage`. Function `SkImageInfo::computeMinByteSize` is used to estimate the `SkImage` memory usage.
|
||||
|
||||
One argument
|
||||
|
||||
```
|
||||
viewId = _flutterView/0x15bf057f8
|
||||
```
|
||||
|
||||
Response:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "EstimateRasterCacheMemory",
|
||||
"layerBytes": 40000,
|
||||
"pictureBytes": 400
|
||||
}
|
||||
```
|
||||
16
docs/unsorted_wiki/Engineering-Productivity.md
Normal file
16
docs/unsorted_wiki/Engineering-Productivity.md
Normal file
@@ -0,0 +1,16 @@
|
||||
This is an index of team-facing documentation for topics relating to Engineering Productivity (also known as EngProd, and including topics relating to our CI infrastructure, security, autorollers, etc).
|
||||
|
||||
- [[Autorollers]]
|
||||
- [[Autosubmit bot]]
|
||||
- [[Dashboards]]
|
||||
- [[Flutter FirebaseLab Tests]]
|
||||
- [[Flutter Infrastructure Foundation]]
|
||||
- [[Flutter Installation Bundles]]
|
||||
- [[Flutter Self Service Index]]
|
||||
- [[Flutter Test Fonts]]
|
||||
- [Flutter's Build Infrastructure](https://github.com/flutter/flutter/blob/master/dev/bots/README.md)
|
||||
- [[Flutter's repository architecture]]
|
||||
- [[GitHub Action Workflows]]
|
||||
- [[Infra Ticket Queue]]
|
||||
- [[Labeling PRs]]
|
||||
- [[New Android Version]]
|
||||
1
docs/unsorted_wiki/Experimental-Add-Flutter-Activity.md
Normal file
1
docs/unsorted_wiki/Experimental-Add-Flutter-Activity.md
Normal file
@@ -0,0 +1 @@
|
||||
This document has been moved to https://flutter.dev/docs/development/add-to-app/android/add-flutter-screen
|
||||
@@ -0,0 +1,43 @@
|
||||
_**Everything in this doc and linked from this doc is experimental. These details WILL change. Do not use these instructions or APIs in production code because we will break you.**_
|
||||
|
||||
# Add Flutter as a Fragment in a ViewPager
|
||||
|
||||
Tabbed navigation often expects the presence of a `ViewPager`, such that the user can swipe left/right to navigate between tabbed pages. This guide shows you how to integrate Flutter as one or more of the pages in your `ViewPager`.
|
||||
|
||||
Start by implementing standard tabbed navigation in Android with a `ViewPager`. Consider following [this guide](https://developer.android.com/training/implementing-navigation/lateral).
|
||||
|
||||
Next, alter your `FragmentPagerAdapter` to return a `FlutterFragment` for the desired page(s).
|
||||
|
||||
```java
|
||||
/**
|
||||
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
|
||||
* one of the sections/tabs/pages.
|
||||
*/
|
||||
public class SectionsPagerAdapter extends FragmentPagerAdapter {
|
||||
|
||||
public SectionsPagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
if (position == FLUTTER_PAGE_INDEX) {
|
||||
// In this case we construct a FlutterFragment that will run
|
||||
// our main() method in Dart and start with an initial route of "/".
|
||||
return new FlutterFragment.createDefault();
|
||||
} else {
|
||||
// return some other page's Fragment
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
// You need to define PAGE_COUNT
|
||||
return PAGE_COUNT;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You should now have a Flutter UI as one or more pages within your tabbed navigation.
|
||||
|
||||
You may notice a delay between creation of your `FlutterFragment` and the display of your Flutter UI. This delay is caused by the warm-up time for the `FlutterEngine`. This warm-up issue a standard concern that applies to all uses of Flutter, including `FlutterActivity`. The way to minimize this visual delay is to use pre-warmed `FlutterEngine`s. Please see [the page about pre-warming FlutterEngines](https://github.com/flutter/flutter/wiki/Experimental:-Reuse-FlutterEngine-across-screens).
|
||||
1
docs/unsorted_wiki/Experimental-Add-Flutter-Fragment.md
Normal file
1
docs/unsorted_wiki/Experimental-Add-Flutter-Fragment.md
Normal file
@@ -0,0 +1 @@
|
||||
See [Add a Flutter Fragment to an Android App](https://www.google.com/url?q=https://docs.flutter.dev/add-to-app/android/add-flutter-fragment&sa=D&source=editors&ust=1715879907376746&usg=AOvVaw3G6E8LxUnKldq2WVx0CsZW)
|
||||
68
docs/unsorted_wiki/Experimental-Add-Flutter-View.md
Normal file
68
docs/unsorted_wiki/Experimental-Add-Flutter-View.md
Normal file
@@ -0,0 +1,68 @@
|
||||
_**Everything in this doc and linked from this doc is experimental. These details WILL change. Do not use these instructions or APIs in production code because we will break you.**_
|
||||
|
||||
# Add a Flutter View
|
||||
|
||||
Flutter can be added to an Android app as a single `View` in an `Activity`'s `View` hierarchy.
|
||||
|
||||
Before adding Flutter as a single `View`, you should consider if it is possible to add Flutter as a `Fragment` or an `Activity` to reduce your development burden.
|
||||
|
||||
* [How to use a `FlutterActivity`](https://github.com/flutter/flutter/wiki/Experimental:-Add-Flutter-Activity)
|
||||
* [How to use a `FlutterFragment`](https://github.com/flutter/flutter/wiki/Experimental:-Add-Flutter-Fragment)
|
||||
|
||||
If you really need to add Flutter as a single `View` then do the following.
|
||||
|
||||
## How to use FlutterView
|
||||
|
||||
### Create and start a FlutterEngine
|
||||
|
||||
Create and start a `FlutterEngine` by following the appropriate instructions. See the [FlutterEngine page](https://github.com/flutter/flutter/wiki/Experimental:-Reuse-FlutterEngine-across-screens)
|
||||
|
||||
### Create a FlutterView and add to layout
|
||||
|
||||
```java
|
||||
// Instantiate a new FlutterView.
|
||||
FlutterView flutterView = new FlutterView(this);
|
||||
|
||||
// Add your FlutterView wherever you'd like. In this case we add
|
||||
// the FlutterView to a FrameLayout.
|
||||
FrameLayout frameLayout = findViewById(R.id.framelayout);
|
||||
frameLayout.addView(flutterView);
|
||||
```
|
||||
|
||||
Your `FlutterView` will not render anything at this point because it is not backed by any particular Flutter app.
|
||||
|
||||
### Attach your FlutterView to your FlutterEngine
|
||||
|
||||
```java
|
||||
flutterView.attachToFlutterEngine(flutterEngine);
|
||||
```
|
||||
|
||||
At this point you should see your Flutter UI rendering to your `FlutterView`, and touch interaction should work.
|
||||
|
||||
### Create and configure platform plugin
|
||||
|
||||
TODO(mattcarroll): update this info about the platform plugin
|
||||
|
||||
Fundamental communication between the Android platform and your Flutter app takes place over a `MethodChannel` with the name `"flutter/platform"`. For example, Android's `onPostResume()` call must be forwarded over the `flutterPlatformChannel` with the message `"AppLifecycleState.resumed"`.
|
||||
|
||||
```java
|
||||
platformPlugin = new PlatformPlugin(activity);
|
||||
MethodChannel flutterPlatformChannel = new MethodChannel(
|
||||
flutterEngine.getDartExecutor(),
|
||||
"flutter/platform",
|
||||
JSONMethodCodec.INSTANCE
|
||||
);
|
||||
flutterPlatformChannel.setMethodCallHandler(platformPlugin);
|
||||
```
|
||||
|
||||
### Add accessibility support
|
||||
|
||||
TODO(mattcarroll)
|
||||
|
||||
### Add support for plugins
|
||||
|
||||
TODO(mattcarroll)
|
||||
|
||||
### Handling orientation change
|
||||
|
||||
TODO(mattcarroll)
|
||||
1
docs/unsorted_wiki/Experimental-Create-Flutter-Plugin.md
Normal file
1
docs/unsorted_wiki/Experimental-Create-Flutter-Plugin.md
Normal file
@@ -0,0 +1 @@
|
||||
See https://docs.flutter.dev/development/platform-integration/android/plugin-api-migration for the final version of this document.
|
||||
@@ -0,0 +1,119 @@
|
||||
_**Everything in this doc and linked from this doc is experimental. These details WILL change. Do not use these instructions or APIs in production code because we will break you.**_
|
||||
|
||||
# Launch Flutter with non-main entrypoint
|
||||
|
||||
Typically, a Flutter app begins execution at the Dart method called `main()`, however this is not required. Developers can specify a different Dart entrypoint:
|
||||
|
||||
## FlutterActivity
|
||||
|
||||
Two options are available to specify a non-standard Dart entrypoint for a `FlutterActivity`.
|
||||
|
||||
### Option 1: AndroidManifest.xml meta-data
|
||||
|
||||
Specify your desired Dart entrypoint as `meta-data` in your `AndroidManifest.xml`:
|
||||
|
||||
```xml
|
||||
<application ...>
|
||||
<activity
|
||||
android:name="io.flutter.embedding.android.FlutterActivity"
|
||||
...
|
||||
>
|
||||
<meta-data
|
||||
android:name="io.flutter.Entrypoint"
|
||||
android:value="myMainDartMethod"
|
||||
/>
|
||||
</activity>
|
||||
</application>
|
||||
```
|
||||
|
||||
Option 2: Subclass `FlutterActivity` and override a method
|
||||
|
||||
Override the `getDartEntrypointFunctionName()` method:
|
||||
|
||||
```java
|
||||
public class MyFlutterActivity extends FlutterActivity {
|
||||
@Override
|
||||
@NonNull
|
||||
public String getDartEntrypointFunctionName() {
|
||||
return "myMainDartMethod";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## FlutterFragment
|
||||
|
||||
Two options are available to specify a non-standard Dart entrypoint for a `FlutterFragment`.
|
||||
|
||||
### Option 1: Use FlutterFragmentBuilder
|
||||
|
||||
```java
|
||||
// Example for a FlutterFragment that creates its own FlutterEngine.
|
||||
//
|
||||
// Note: a Dart entrypoint cannot be set when using a cached engine because the
|
||||
// cached engine has already started executing Dart.
|
||||
FlutterFragment flutterFragment = new FlutterFragment
|
||||
.withNewEngine()
|
||||
.dartEntrypoint("myMainDartMethod")
|
||||
.build();
|
||||
```
|
||||
|
||||
### Option 2: Subclass FlutterFragment
|
||||
|
||||
```java
|
||||
public class MyFlutterFragment extends FlutterFragment {
|
||||
@Override
|
||||
@NonNull
|
||||
public String getDartEntrypointFunctionName() {
|
||||
return "myMainDartMethod";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## FlutterEngine
|
||||
|
||||
When manually initializing a `FlutterEngine`, you take on the responsibility of
|
||||
invoking the desired Dart entrypoint, even if you want the standard `main()` method.
|
||||
The following examples illustrate how to execute a Dart entrypoint with a
|
||||
`FlutterEngine`.
|
||||
|
||||
Example using standard entrypoint:
|
||||
|
||||
```java
|
||||
// Instantiate a new FlutterEngine.
|
||||
FlutterEngine flutterEngine = new FlutterEngine(context);
|
||||
|
||||
// Start executing Dart using a default entrypoint, which resolves to "main()".
|
||||
flutterEngine
|
||||
.getDartExecutor()
|
||||
.executeDartEntrypoint(
|
||||
DartEntrypoint.createDefault();
|
||||
);
|
||||
```
|
||||
|
||||
Example using custom entrypoint:
|
||||
|
||||
```java
|
||||
// Instantiate a new FlutterEngine.
|
||||
FlutterEngine flutterEngine = new FlutterEngine(context);
|
||||
|
||||
// Start executing Dart using a custom entrypoint.
|
||||
flutterEngine
|
||||
.getDartExecutor()
|
||||
.executeDartEntrypoint(
|
||||
new DartEntrypoint(
|
||||
FlutterMain.findAppBundlePath(),
|
||||
"myMainDartMethod"
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
# Avoid Tree Shaking in Release
|
||||
|
||||
When you build in release mode, your Dart code is tree-shaken. This means that the compiler removes any Dart code that it thinks you're not using. This includes your special entrypoints. To avoid crashing in release mode as a result of tree-shaking, be sure to place the following `@pragma` above each of your custom entrypoints.
|
||||
|
||||
```dart
|
||||
@pragma('vm:entry-point')
|
||||
void myMainDartMethod() {
|
||||
// implementation
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,71 @@
|
||||
_**Everything in this doc and linked from this doc is experimental. These details WILL change. Do not use these instructions or APIs in production code because we will break you.**_
|
||||
|
||||
# Re-use a FlutterEngine across screens
|
||||
|
||||
A `FlutterEngine` is responsible for executing Dart code, rendering a Flutter UI to a `FlutterView`, and connecting plugins to the core Flutter system. Each instance of `FlutterEngine` comes with a non-trivial "warm-up" time, which sets up a group of dedicated threads and other resources.
|
||||
|
||||
Due to the warm-up time of a `FlutterEngine` instance, developers may choose to cache one or more instances of `FlutterEngine`s and re-use those instances across different `Activity`s and/or `Fragment`s in their Android app. This document explains how to cache and re-use `FlutterEngine`s, as well as handle nuances when re-using those `FlutterEngine`s.
|
||||
|
||||
## Ensure Flutter is initialized
|
||||
|
||||
Flutter must be initialized before instantiating a single `FlutterEngine` instance. To ensure that Flutter is initialized, invoke the following methods before instantiating a `FlutterEngine`.
|
||||
|
||||
```java
|
||||
FlutterMain.startInitialization(...);
|
||||
FlutterMain.ensureInitializationComplete(...);
|
||||
```
|
||||
|
||||
## Initializing FlutterEngines
|
||||
|
||||
A `FlutterEngine` must go through 2 steps to be fully initialized. First, an instance is instantiated. Second, the `FlutterEngine` is instructed to execute a Dart entrypoint, e.g., `main()`.
|
||||
|
||||
```java
|
||||
// Instantiate a FlutterEngine.
|
||||
FlutterEngine engine = new FlutterEngine(appContext);
|
||||
|
||||
// Define a DartEntrypoint
|
||||
DartExecutor.DartEntrypoint entrypoint = new DartExecutor.createDefault();
|
||||
|
||||
// Execute the DartEntrypoint within the FlutterEngine.
|
||||
engine.getDartExecutor().executeDartEntrypoint(entrypoint);
|
||||
```
|
||||
|
||||
To cache one or more `FlutterEngine`s, store the initialized `FlutterEngine`s in a central place that you can access from your desired `Activity`s and `Fragment`s. You could choose to store these `FlutterEngine`s in your `Application` subclass, or you could store them in a statically accessible location of your choice. This choice is up to you, and should consider your specific application architecture and development practices.
|
||||
|
||||
## Using a cached FlutterEngine in a FlutterActivity
|
||||
|
||||
See the [FlutterActivity page](https://github.com/flutter/flutter/wiki/Experimental:-Add-Flutter-Activity#using-a-cached-flutterengine)
|
||||
|
||||
## Using a cached FlutterEngine in a FlutterFragment
|
||||
|
||||
See the [FlutterFragment page](https://github.com/flutter/flutter/wiki/Experimental:-Add-Flutter-Activity#using-a-cached-flutterengine)
|
||||
|
||||
## Dart entrypoint restrictions
|
||||
|
||||
A `FlutterEngine` can only execute a Dart entrypoint one time. Once a `FlutterEngine` has started executing Dart code, it will continue to execute that Dart code until the `FlutterEngine` is disposed. To re-use a `FlutterEngine` that needs to display different experiences at different times you will need to find an approach that accomplishes your goals without restarting Dart execution. Below are a couple options.
|
||||
|
||||
### Using a Navigator with routes
|
||||
|
||||
The `Navigator` widget in Flutter already has the ability to switch experiences at runtime. We call these different experiences `routes`, and your app is probably already using them. Typically, `routes` are controlled with Dart code, but the Android embedding also has a navigation system channel that allows you to `pushRoute(...)` and `popRoute(...)`. The `NavigationChannel` can be retrieved from a `FlutterEngine` instance.
|
||||
|
||||
```java
|
||||
myFlutterEngine.getNavigationChannel().pushRoute("myPage");
|
||||
```
|
||||
|
||||
You'll need to ensure that pushing a route at the desired time has the desired effect in your app. This approach of pushing routes may not work for all apps.
|
||||
|
||||
### Using method channels and a custom widget
|
||||
|
||||
Custom method channels offer a mechanism to implement your own solution for jumping between experiences. Method channels allow you to send any message you would like to your Flutter app, and then take whatever action you'd like.
|
||||
|
||||
Start by [setting up a method channel](https://flutter.dev/docs/development/platform-integration/platform-channels) with the navigation messages that you're interested in sending.
|
||||
|
||||
Once your method channel is setup, respond to your messages on the Flutter/Dart side by switching out your top-level widget, or by switching out any other widget in your hierarchy that makes sense for your use-case.
|
||||
|
||||
TODO(mattcarroll): add a code example here.
|
||||
|
||||
## Re-using FlutterEngines across screens
|
||||
|
||||
Re-using the same `FlutterEngine` across screens that are significantly separated should work as described above. However, developers must consider the possibility that one Flutter experience might show through to another. For example, consider an `Activity` that displays `flutterEngineA`, which then launches a native Android dialog, and that dialog is a `Fragment` that also displays `flutterEngineA`. This situation won't work because both the dialog and the underlying `Activity` are simultaneously visible and a single `FlutterEngine` can only render a single UI at a given moment.
|
||||
|
||||
When two Flutter experiences are shown back to back, you must carefully consider the possibility that Flutter might be instructed to show two different UIs at the same time. If such a situation occurs, you will need to switch your strategy to cache two `FlutterEngine`s instead of one, or you'll need to allow a new `FlutterEngine` to be instantiated for the second Flutter experience.
|
||||
@@ -0,0 +1,65 @@
|
||||
Flutter's v2 Android embedding includes reflection code that should find and register all plugins listed in your `pubspec.yaml` file without any intervention on your part. If your desired plugins are not registered automatically, please file an issue.
|
||||
|
||||
### Partial plugin registration
|
||||
|
||||
To prevent Flutter from registering all plugins and instead register only specific plugins of your choosing, do the following.
|
||||
|
||||
First, construct a `FlutterEngine` either as a [cached `FlutterEngine`](https://flutter.dev/docs/development/add-to-app/android/add-flutter-screen#step-3-optional-use-a-cached-flutterengine), or by overriding `provideFlutterEngine()` in [`FlutterActivity`](https://api.flutter.dev/javadoc/io/flutter/embedding/android/FlutterActivity.html#provideFlutterEngine-android.content.Context-) or [`FlutterFragment`](https://api.flutter.dev/javadoc/io/flutter/embedding/android/FlutterFragment.html#provideFlutterEngine-android.content.Context-) such that the `FlutterEngine` instance doesn't automatically register plugins.
|
||||
|
||||
```java
|
||||
FlutterEngine flutterEngine = new FlutterEngine(
|
||||
context,
|
||||
FlutterLoader.getInstance(),
|
||||
new FlutterJNI(),
|
||||
dartVmArgs, // or an empty array if no args needed
|
||||
false // this arg instructs the FlutterEngine NOT to register plugins automatically
|
||||
);
|
||||
```
|
||||
|
||||
Second, register the plugins that you want. If you overrode `provideFlutterEngine()` in `FlutterActivity` or `FlutterFragment` then override `configureFlutterEngine()` to add plugins:
|
||||
|
||||
```java
|
||||
public void configureFlutterEngine(FlutterEngine engine) {
|
||||
// The ShimPluginRegistry is how the v2 embedding works with v1 plugins.
|
||||
ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(
|
||||
flutterEngine,
|
||||
new PlatformViewsController()
|
||||
);
|
||||
|
||||
// Add any v1 plugins to the shim
|
||||
// MyV1Plugin.registerWith(
|
||||
// shimPluginRegistry.registrarFor("com.my.package.MyV1Plugin")
|
||||
// );
|
||||
|
||||
// Add any v2 plugins that you want
|
||||
// engine.getPlugins().add(new MyPlugin());
|
||||
}
|
||||
```
|
||||
|
||||
If you went with the cached `FlutterEngine` approach instead of `FlutterActivity` and `FlutterFragment` method overrides, then you can add plugins whenever you'd like. You can even add them immediately after instantiating your `FlutterEngine`. However, be advised that some v1 plugins expect an `Activity` to be available immediately upon registration. This will not be the case unless you add plugins in `configureFlutterEngine()` as shown earlier.
|
||||
|
||||
```java
|
||||
// Instantiate cached FlutterEngine.
|
||||
FlutterEngine flutterEngine = new FlutterEngine(
|
||||
context,
|
||||
FlutterLoader.getInstance(),
|
||||
new FlutterJNI(),
|
||||
dartVmArgs, // or an empty array if no args needed
|
||||
false // this arg instructs the FlutterEngine NOT to register plugins automatically
|
||||
);
|
||||
|
||||
// Immediately add plugins to the cached FlutterEngine.
|
||||
// The ShimPluginRegistry is how the v2 embedding works with v1 plugins.
|
||||
ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(
|
||||
flutterEngine,
|
||||
new PlatformViewsController()
|
||||
);
|
||||
|
||||
// Add any v1 plugins to the shim
|
||||
// MyV1Plugin.registerWith(
|
||||
// shimPluginRegistry.registrarFor("com.my.package.MyV1Plugin")
|
||||
// );
|
||||
|
||||
// Add any v2 plugins that you want
|
||||
// engine.getPlugins().add(new MyPlugin());
|
||||
```
|
||||
5
docs/unsorted_wiki/Fast-Start.md
Normal file
5
docs/unsorted_wiki/Fast-Start.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Fast Start
|
||||
|
||||
Fast Start is an experimental development for Flutter on Android that should startup faster on slower hardware. The APK used to install Flutter will only contain a minimal bootstrap application, which will require it to be rebuilt and reinstalled less frequently. This workflow may not work if you're using android_alarm_manager, or other plugins which start background isolates.
|
||||
|
||||
Fast start can be used by providing --fast-start as a command line option to flutter run. The first time this is used an APK must still be built, but on subsequent runs it will start up much faster. Note switching between --fast-start and regular development modes will still require the APK to be rebuilt.
|
||||
42
docs/unsorted_wiki/Flutter's-modes.md
Normal file
42
docs/unsorted_wiki/Flutter's-modes.md
Normal file
@@ -0,0 +1,42 @@
|
||||
We aspire to reach a state where developers are able to use the following modes for running Flutter code. Our tools should not expose any other combinations of features or modes. Each mode corresponds to a separate build of the engine that we provide.
|
||||
|
||||
1. **Debug** mode on device (including simulators, emulators): Turns on all the assertions in the world, includes all debugging information, enables all the debugger aids (e.g. observatory) and service extensions. Optimizes for fast develop/run cycles. Does not optimize for execution speed, binary size, or deployment. Used by `flutter run`. Built with `sky/tools/gn --android` or `sky/tools/gn --ios`. Also sometimes called "**checked** mode" or "**slow** mode".
|
||||
|
||||
2. **Release** mode on device (excluding simulators, emulators): Turns off all assertions, strips as much debugging information as possible, turns off all the debugger tools. Optimizes for fast startup, fast execution, small package sizes. Disables any debugging aids. Disables service extensions. Intended for deployment to end-users. Used by `flutter run --release`. Built with `sky/tools/gn --android --runtime-mode=release` or `sky/tools/gn --ios --runtime-mode=release`.
|
||||
|
||||
3. **Profile** mode on device (excluding simulators, emulators): Same as release mode except that profile-mode service extensions (like the one that turns on the performance overlay) is enabled, and tracing is enabled, as well as the minimum required to support using the tracing information (e.g. observatory can probably connect to the process). Used by `flutter run --profile`. Built with `sky/tools/gn --android --runtime-mode=profile` or `sky/tools/gn --ios --runtime-mode=profile`. Not available on simulators or emulators because profiling on simulators is not representative of real performance.
|
||||
|
||||
4. Headless **test** mode on desktop: Same as debug mode except headless and for desktop platforms. Used by `flutter test`. Built with `sky/tools/gn`.
|
||||
|
||||
In addition, for our purposes during development, each of the above should be able to be built in two modes: optimized, which is what end-developers use, and unoptimized, which is what we would use when debugging the engine. Optimized is the default, unoptimized engines are built by adding `--unoptimized` to the arguments.
|
||||
|
||||
|
||||
### Artifact differences
|
||||
|
||||
Debug mode produces a script snapshot, which is basically tokenized sources. Comments and whitespace are missing, literals are canonicalized. There is no machine code, tree-shaking or obfuscation.
|
||||
|
||||
Profile and release modes produce app-aot snapshots, either as dylibs (iOS and Fuchsia) or 4-tuples of blobs (Android). Both include machine code for all the compiled functions, code metadata, method dictionaries, class and library structures, types, etc. The machine code is fully position-independent. The dylib additionally has DWARF debug info such as function names and source positions. There is tree-shaking. Obfuscation is opt-in.
|
||||
|
||||
### Matrix
|
||||
|
||||
The following axes, as described above, exist:
|
||||
|
||||
* debug, release, profile
|
||||
* opt, unopt
|
||||
* iOS, Android, macOS, Linux, Windows
|
||||
|
||||
In addition, some versions can select alternative graphics backends:
|
||||
|
||||
* iOS can choose between: OpenGL, software
|
||||
* Android can choose between: Vulkan, OpenGL, software
|
||||
* macOS can choose between, OpenGL, software, headless (debug only)
|
||||
* Linux can choose between: OpenGL, software, headless (debug only)
|
||||
* Windows can choose between: OpenGL, software, headless (debug only)
|
||||
|
||||
Separate from all the above, Fuchsia has the following modes:
|
||||
|
||||
* AOT, JIT, interpreted DBC
|
||||
* Observatory present, observatory absent
|
||||
* opt, unopt
|
||||
|
||||
In total therefore there are 3×2×(2+3+2+2+2) + 1×2×3 + 3×2×2 modes, which is 84 modes.
|
||||
30
docs/unsorted_wiki/Flutter's-repository-architecture.md
Normal file
30
docs/unsorted_wiki/Flutter's-repository-architecture.md
Normal file
@@ -0,0 +1,30 @@
|
||||
Flutter uses a deeply multi-repository architecture, which includes, among many others, the following:
|
||||
|
||||
* github.com/flutter/flutter
|
||||
* github.com/flutter/engine
|
||||
* github.com/flutter/packages
|
||||
* github.com/dart-lang/sdk
|
||||
* llvm.googlesource.com
|
||||
* skia.googlesource.com
|
||||
* swiftshader.googlesource.com
|
||||
* android.googlesource.com
|
||||
* fuchsia.googlesource.com
|
||||
* boringssl.googlesource.com
|
||||
* chromium.googlesource.com, which mirrors a large number of further repositories
|
||||
* flutter.googlesource.com, which mirrors a large number of further repositories
|
||||
|
||||
There are, all told, hundreds of repositories involved in Flutter's development.
|
||||
|
||||
Generally, the boundaries between repositories represent integration points. For example, Dart is integrated into Flutter's engine, but is also used in other contexts. Dart therefore is in its own repository, separate from Flutter's engine. Flutter's engine is integrated into Flutter's tooling as a prebuilt binary, and therefore they are in separate repositories.
|
||||
|
||||
Our current architecture enables some important features, for example:
|
||||
|
||||
- flutter/packages can be tested against different versions of Flutter with a clean integration point.
|
||||
- flutter/flutter has an unambiguous integration with the Engine, including on release branches.
|
||||
- flutter/flutter is entirely code covered by a single license. (This is why that repo does not need a license script the way flutter/engine does.)
|
||||
- flutter/flutter can be delivered to developers in a way that they can step through the code in a debugger without significant parts of the repo providing distractions.
|
||||
- flutter/flutter is easy for new contributors to hack on, providing an easy on-ramp to grow the community from where people can get more deeply involved, e.g. with the engine.
|
||||
- flutter/engine can select specific versions of dependencies (e.g. Skia) rather than having to merge in the actual dependency code.
|
||||
- flutter/engine binaries can be built in the same way for CI testing as for release.
|
||||
|
||||
Some repositories that were historically split have been merged or are planned to be merged. For example, we have merged our various packages and plugins into a single repository (flutter/packages); previously, they were each in individual packages, then eventually two (plugins and packages). Combining these makes sense as they share near-identical CI testing and development tooling. Another example is flutter/buildroot and flutter/engine, which we plan to merge in due course (previously the buildroot was separated for ease of integration with Fuchsia).
|
||||
1
docs/unsorted_wiki/Flutter-CLI-crash-reporting.md
Normal file
1
docs/unsorted_wiki/Flutter-CLI-crash-reporting.md
Normal file
@@ -0,0 +1 @@
|
||||
See [Flutter Crash Reporting](https://www.google.com/url?q=https://docs.flutter.dev/reference/crash-reporting&sa=D&source=editors&ust=1715879907377300&usg=AOvVaw00lY-HSrn9NegCyjA5TTiG)
|
||||
83
docs/unsorted_wiki/Flutter-Cherrypick-Process.md
Normal file
83
docs/unsorted_wiki/Flutter-Cherrypick-Process.md
Normal file
@@ -0,0 +1,83 @@
|
||||
# Flutter Cherry-pick Process
|
||||
|
||||
## Goal
|
||||
With branching and branch testability being supported for Flutter & Dart releases, cherry-picking fixes is the preferred method to address issues for released software (beta and stable channels.) Stability of the release will be the overarching goal, so only highly impactful and critical cherrypicks will be allowed across Dart and Flutter. This document outlines the process for requesting and approval of cherrypicks.
|
||||
|
||||
**Note: This process applies to regressions from the previous release or serious bugs otherwise introduced by the current release. Feature work is not considered for cherry-picking and will need to wait for the next release.**
|
||||
|
||||
## Automatically Creates a Cherry Pick Request
|
||||
Eligibility:
|
||||
1. If your cherry pick is expecting to have a merge conflict, please skip this section and follow instructions in the FAQ section below to manually open a cherry pick request instead. (e.g. PRs that contain changes to .ci.yaml files are very likely to hit a merge conflict)
|
||||
2. The framework PR to be cherry picked needs to have a base commit later than [01/24/2024](https://www.google.com/url?q=https://github.com/flutter/flutter/pull/142058&sa=D&source=docs&ust=1706904517596608&usg=AOvVaw3cFfw8vyiBtY3EzM_N-PEi), and the engine PR to be cherry picked has a base commit later than [02/06/2024](https://github.com/flutter/engine/pull/50265)
|
||||
3. The target branch is either [beta](https://github.com/flutter/flutter/blob/beta/bin/internal/release-candidate-branch.version) or [stable](https://github.com/flutter/flutter/blob/stable/bin/internal/release-candidate-branch.version). (not a new beta branch that isn't yet created)
|
||||
|
||||
For automatic cherry pick:
|
||||
1. Add the `cp: beta` or `cp: stable` label to the pull request on flutter/flutter master. (you can find [beta](https://github.com/flutter/flutter/blob/beta/bin/internal/release-candidate-branch.version) and [stable](https://github.com/flutter/flutter/blob/stable/bin/internal/release-candidate-branch.version) candidate branch info by following the respective links)
|
||||
2. Wait about 30 seconds.
|
||||
3. If automatic cherry pick succeeds (no merge conflict), a new pull requested will be created and you will receive an email. Edit the cherry-pick details in the PR description of the generated pull request, and a release engineer will follow up on the request.
|
||||
4. If automatic cherry pick fails, a comment will be left on the original PR. In this case you will need to follow instructions in the FAQ section below to manually create a cherry pick PR.
|
||||
|
||||
For manual cherry pick:<br >
|
||||
refer to the FAQ section below
|
||||
|
||||
## Frequently asked questions
|
||||
|
||||
### How do I request a cherry-pick?
|
||||
To request a cherry-pick, utilize the [issue template](https://github.com/flutter/flutter/issues/new?assignees=&labels=cp%3A+review&template=7_cherry_pick.yml&title=%5BCP%5D+%3Ctitle%3E).
|
||||
|
||||
### Who can request a cherry-pick?
|
||||
|
||||
Anyone can request a cherry-pick.
|
||||
|
||||
### When do I request a cherry pick?
|
||||
|
||||
- Whenever you have identified a commit on the main/master that fixes an issue that is present on the beta or stable branch.
|
||||
- Whenever you need to update a pub dependency that fixes an issue that is present on the beta or stable branch (see [Updating dependencies](https://github.com/flutter/flutter/wiki/Updating-dependencies-in-Flutter#to-update-a-single-dependency-for-cherrypicks))
|
||||
|
||||
### Who reviews and approves cherry-pick requests?
|
||||
|
||||
The release engineering team will assign a cherry-pick reviewer who is an expert in the area of the code that your cherry-pick may affect.
|
||||
|
||||
### Lifecycle of a cherry-pick
|
||||
|
||||
1. The cherry-pick requester opens a cherry-pick pull request to the [beta](https://github.com/flutter/flutter/blob/beta/bin/internal/release-candidate-branch.version) or [stable](https://github.com/flutter/flutter/blob/stable/bin/internal/release-candidate-branch.version) **candidate** branch (follow the respective link to find the branch name)
|
||||
2. A cherry-pick issue is filled out completely and created utilizing the [cherry-pick template](https://github.com/flutter/flutter/issues/new?assignees=&labels=cp%3A+review&template=7_cherry_pick.yml&title=%5BCP%5D+%3Ctitle%3E) in the [flutter/flutter](https://github.com/flutter/flutter) repository.
|
||||
3. The release engineering team is notified that a cherry-pick request is in queue and assigns an appropriate reviewer who is an expert in the area who will review the cherry-pick issue and associated cherry-pick pull request.
|
||||
4. The release engineering team applies the `merge-to-beta` or `merge-to-stable` label.
|
||||
5. The cherry-pick request then enters one of the following states.
|
||||
1. Approved: The reviewer has approved the cherry-pick and cherry-pick pull request.
|
||||
The release engineering team will merge the cherry-pick pull request and apply the `cp: merged` label to the cherry-pick issue.
|
||||
2. Denied: The reviewer will comment on the cherry-pick issue why the cherry-pick is denied.
|
||||
The release engineering team will close the cherry-pick issue and associated cherry-pick pull request.
|
||||
6. The cherry-pick is picked up in the next release period.
|
||||
7. Once the cherry-pick has been added to a release, the release engineering team will close the cherry-pick issue.
|
||||
|
||||
### This is my first cherry-pick, how do I do it?
|
||||
|
||||
This is the perfect opportunity for you to learn and add cherry-picking to your toolbox. A typical cherry-pick request follows a process similar to the below.
|
||||
|
||||
**Note: Commands that are wrapped with < > are variables that apply to your specific situation.**
|
||||
|
||||
1. `git checkout <master/main>`
|
||||
2. `git fetch`
|
||||
3. `git pull` // ensure all changes from master/main have been pulled
|
||||
4. `git checkout <candidate branch you want to cherry-pick to>`
|
||||
5. `git checkout -b <your local branch name for cherry-picking>`
|
||||
6. `git cherry-pick <your commit hash>`
|
||||
7. `git push --set-upstream origin <your branch name>`
|
||||
|
||||
### What happens if my cherry-pick PR has merge conflicts?
|
||||
|
||||
In the case that your cherry-pick commit has a merge conflict, it is up to you to resolve it. If you can not resolve it, reach out to the original PR author who may be able to help resolve the conflict.
|
||||
|
||||
### What if the issue is on a previous stable?
|
||||
|
||||
If you discovered an issue on a X version that is no longer on the stable channel, we can still hotfix it in. For stables, we are more likely to do this as that is what most Flutter developers use.
|
||||
|
||||
Generally, if the stable is relatively fresh, such as we recently shipped the new stable and a large chunk of developers have not migrated, we would prioritize backporting a fix.
|
||||
|
||||
### When should I prioritize fixes to beta instead of stable?
|
||||
|
||||
Generally, we ship every third beta to stable, and prioritize fixes to those branches as those are soon to be stable. We have no official comms planned around this yet, but will encourage developers on Discord to try out this beta.
|
||||
|
||||
In the last few weeks of a stable, we may opt to only release hotfixes to the beta instead of stable. At end of 2023, we're planning to have more automation around releases, which will allow us to ship hotfixes to both channels easily, and this will be less of a concern.
|
||||
95
docs/unsorted_wiki/Flutter-FirebaseLab-Tests.md
Normal file
95
docs/unsorted_wiki/Flutter-FirebaseLab-Tests.md
Normal file
@@ -0,0 +1,95 @@
|
||||
## FirebaseLab Tests
|
||||
|
||||
Flutter FirebaseLab tests are used to build flutter applications and to run them using different versions of emulators and physical devices.
|
||||
|
||||
These tests consist of two parts:
|
||||
|
||||
* [Firebaselab recipe](https://flutter.googlesource.com/recipes/+/refs/heads/main/recipes/firebaselab/firebaselab.py)
|
||||
* [.ci.yaml](https://github.com/flutter/flutter/blob/master/.ci.yaml#L413) configuration file
|
||||
|
||||
The recipe supports three properties: **physical\_devices** to specify actual hardware connected to firebase infra to run tests, **virtual\_devices** to specify the virtual devices(avd) to use and **task\_name** for selecting the integration test to build.
|
||||
|
||||
physical\_device and virtual\_device are strings that take the **MODEL\_ID** format defined by firebase. Use `gcloud firebase test android models list` (assuming you have [gcloud](https://cloud.google.com/sdk/gcloud) installed) for a list of possible model id’s.
|
||||
|
||||
Task name is the subdirectory of [dev/integration\_tests](https://github.com/flutter/flutter/tree/master/dev/integration_tests) (e.g. android\_views, channels, etc ) that contains the integration test to build.
|
||||
|
||||
The following is an example of the properties format:
|
||||
|
||||
```json
|
||||
physical_devices: >-
|
||||
[
|
||||
"--device", "model=oriole,version=33",
|
||||
"--device", "model=griffin,version=24"
|
||||
],
|
||||
virtual_device: >-
|
||||
[
|
||||
"--device", "model=Nexus5,version=21",
|
||||
"--device", "model=Nexus6P,version=27"
|
||||
]
|
||||
```
|
||||
|
||||
The recipe executes the following workflow:
|
||||
|
||||
|
||||
|
||||
1. Reads **physical\_devices** property and if not empty it builds an app bundle for the integration test referenced by **task\_name**.
|
||||
2. Reads **virtual\_devices** property and if not empty it builds an apk for the integration test. Apks are built for virtual\_devices to prevent them from picking the wrong binary and using runtime translation.
|
||||
3. Uses the `gcloud firebase` command to upload the binary and delegates the execution of the test to firebase lab.
|
||||
4. The gcloud command blocks until the execution is complete
|
||||
5. The recipe reads the logcat and the test succeeds if no `E/flutter` is found in the logcat file.
|
||||
6. If the test fails it retries for maximum of 3 times
|
||||
7. The recipe also supports [infra\_failure\_codes = (1, 15, 20)](https://firebase.google.com/docs/test-lab/ios/command-line#script-exit-codes) to prevent firebaselab infrastructure failures from closing the tree.
|
||||
|
||||
|
||||
## Prerequisites (googlers)
|
||||
|
||||
This is only required for manually running the steps
|
||||
|
||||
* [Install gcloud CLI](https://cloud.google.com/sdk/docs/install)
|
||||
* Request access on demand write access to `flutter-infra-staging`
|
||||
* Build the application and run the gcloud command. You can check the [firebaselab recipe](https://flutter.googlesource.com/recipes/+/refs/heads/main/recipes/firebaselab/firebaselab.py) for the details.
|
||||
|
||||
## Adding a Firebaselab Test
|
||||
|
||||
* Step 1: Select the integration test to use from [dev/integration\_tests](https://github.com/flutter/flutter/tree/master/dev/integration_tests)
|
||||
* Step 2: Select the physical and virtual devices to run the test on. You can use `gcloud firebase test android models list` and `gcloud firebase test ios models list` to find the available devices.
|
||||
* Step 3: Write a .ci.yaml target configuration in the [flutter/flutter .ci.yaml](https://github.com/flutter/flutter/blob/master/.ci.yaml) file providing the task\_name, virtual\_devices, physical\_devices and recipe properties.
|
||||
* Step 4: Create a PR with the new target. The presubmit checks will run basic validations on yaml format.
|
||||
* Step 5: Wait for the change to propagate.
|
||||
* Step 6: Fix any potential issues and remove `bringup: true` to validate the changes end to end in presubmit.
|
||||
|
||||
The following is an example of a full target: **Linux firebase_oriol33_abstract_method_smoke_test**. By convention the name should follow the format “<host os> firebase\_<model id>\_<taskname>”
|
||||
|
||||
In the example below `recipe: firebaselab/firebaselab` refers to the recipe to use to run the test and should probably always be the same, `dependencies` refers to the android sdk to use for the test, in general all tests should use the same android sdk unless specifically testing something that changes across android sdk versions, `task_name` refers to the integration test to use see the definition above for where to find the code that is run, `physical_devices` `virtual_devices` are defined above.
|
||||
|
||||
```yaml
|
||||
- name: Linux firebase_oriol33_abstract_method_smoke_test
|
||||
# This is required for new tests to allow the
|
||||
# configuration to propagate.
|
||||
bringup: true
|
||||
recipe: firebaselab/firebaselab
|
||||
# The unit for timeout is minutes. 1 hour is enough
|
||||
# for most use cases unless the test is using a device
|
||||
# with low capacity and the queue is expected to be
|
||||
# longer than 30 minutes.
|
||||
timeout: 60
|
||||
Properties:
|
||||
# These top level dependencies are shared between firebaselab
|
||||
# tests. For the current values you can copy paste the
|
||||
# dependencies from another firebaselab target. Changing these
|
||||
# values are only necessary when upgrading to a new android sdk
|
||||
# version.
|
||||
dependencies: >-
|
||||
[
|
||||
{"dependency": "android\_sdk", "version": "version:33v6"}
|
||||
]
|
||||
# Use for metrics collection and to be able to filter tasks**
|
||||
# in swarming.
|
||||
tags: >
|
||||
["firebaselab"]
|
||||
task_name: abstract_method_smoke_test
|
||||
physical_devices: >-
|
||||
["--device", "model=oriole,version=33"]
|
||||
virtual_devices: >-
|
||||
[]
|
||||
```
|
||||
181
docs/unsorted_wiki/Flutter-Framework-Gardener-Rotation.md
Normal file
181
docs/unsorted_wiki/Flutter-Framework-Gardener-Rotation.md
Normal file
@@ -0,0 +1,181 @@
|
||||
The framework gardener role currently makes use of several tools and communication channels only available to Google employees. See [On-call scheduling for Flutter] for an overview of work required to make this process more open.
|
||||
|
||||
## Objective
|
||||
|
||||
The framework gardener's role is to eliminate impediments to engineering velocity on the framework, tool, and related teams working on the [Flutter framework][flutter/flutter] repository, to unblock rolls into the repository, and to minimize the latency with which critical fixes arrive in our customers' hands. To that end, we maintain a rotation so that there is a clear owner and point of contact for Flutter repo issues, and so that engineers can plan their work around an assumption of reduced productivity during their rotation.
|
||||
|
||||
The framework gardener's core responsibilities are:
|
||||
* Keep the framework tree green to keep developers, upstream autorollers, and the release process unblocked.
|
||||
* Ensure others are informed of issues which may affect them.
|
||||
* Ensure bugs/investigations are delegated and taken care of by the right person, which may be themself.
|
||||
|
||||
Gardener responsibility does not include:
|
||||
* Work beyond working hours. **Tree redness does not trump work-life balance.** Contributors may escalate issues outside of the gardener's working hours, but the gardener is not responsible for responding until the next work day.
|
||||
* Personally investigate issues or fix bugs, unless the right person to investigate and fix is the gardener themself.
|
||||
|
||||
As such, the gardener should use their badge and hat to:
|
||||
* Aggressively roll back problematic changes.
|
||||
* Delegate investigations/issues to the right engineer(s) on the team, and follow-up.
|
||||
* Detect infrastructure issues that cause test failures and flakiness and report to the infrastructure team.
|
||||
* Notify the engine sheriff when an engine roll causes the [flutter/flutter] tree to close.
|
||||
* Proactively communicate issues/status to others upstream/downstream.
|
||||
|
||||
## Rotation
|
||||
Rotations are managed in the [Rotations tool]. The [Framework Gardener calendar] can be added to your calendar. Both of these links are currently Google internal.
|
||||
|
||||
Team members are not expected to participate in multiple Flutter rotations. For example, those on the engine rotation are exempt and vice versa. New team members should be added to a single rotation, depending on the team to which they belong.
|
||||
|
||||
Before heading out on holiday, or if you get to your shift and find you can't do it, check the upcoming rotations and find a volunteer to swap shifts with while you're out. During some holiday periods when many team members are out and activity is particularly low on the tree, it may not be essential to have a dedicated gardener.
|
||||
|
||||
## Periodic scan
|
||||
Open the [Framework build dashboard].
|
||||
1. If the tree is closed, identify which test shards are failing. If there are yellow boxes with an exclamation point, that means that the failed tests are automatically re-running themselves. The tree is not fully closed until there are solid red boxes or red boxes with exclamation points. You can begin investigation as soon as you notice the tree going red, but it is suggested not to begin escalation until re-runs have completed.
|
||||
1. Identify which test within the shard failed, and try to locate obvious errors or failures in the logs. This procedure will be different if the failure is in [devicelab](#handling-a-devicelab-failure) or [LUCI](#handling-a-luci-failure).
|
||||
1. Update the [tree-status channel] on [Discord] with an announcement that the tree is red, the affected shard(s), and the failure message from the logs.
|
||||
1. Cross reference the failure with the commit in question. If it is obvious the PR in question caused the failure, [revert](#reverting-commits) immediately.
|
||||
1. Search through the [Flutter issues] for any existing issues with the same error. Some flakes are not specific to a specific test suite, but are nonetheless flakes and should not require a revert.
|
||||
1. If the failure is happening on an engine roll, [escalate to the engine sheriff](#handling-an-engine-roll-failure).
|
||||
1. If the test failure is not a known flake or infrastructure issue, [revert it immediately](#reverting-commits).
|
||||
1. Escalate to the [test owner][TESTOWNERS].
|
||||
1. When the tree reopens, announce it in the [tree-status channel] on [Discord].
|
||||
1. If the tree is open, investigate green exclamation point squares, which are tests that have failed, rerun, and then passed. They may be [flaky and warrant an investigation](#handling-a-flaky-test). They also may have hit an intermittent infrastructure issue.
|
||||
1. Check [benchmarks](#handling-a-benchmark-regression) for regressions. File issues and escalate.
|
||||
|
||||
Unmute the [tree-status channel] and [hackers-infra channel] on [Discord]. Contributors are encouraged to escalate tree closures to you. Respond there as quickly as possible.
|
||||
|
||||
### Escalation
|
||||
Escalate to the [test owner][TESTOWNERS]. File GitHub issues if none are already open.
|
||||
1. The title should include the name of the failing test.
|
||||
1. Assign the issue to the test owner with a `P1` priority.
|
||||
1. Add the `team` label.
|
||||
1. Include links to the failing tests. Download any relevant logs and attach them to the issue, even if the link to the failing tests has the same information. This prevents the issues from becoming stale when logs are expunged.
|
||||
1. @ mention the test owner in the [tree-status channel] on [Discord] with a link to the GitHub issue. If they are unavailable, escalate to another team member. Continue escalating until someone acknowledges the issue is being investigated.
|
||||
1. Investigation updates and questions should not be posted in the [tree-status channel]. This channel should remain free of noise to discourage notification muting.
|
||||
|
||||
### Handling a devicelab failure
|
||||
See [Why Flutter Devicelab Tests Break].
|
||||
1. If devicelab square (Android, Apple, or Windows icon) is red or yellow, click the square and click the _Download All Logs_ button. Note these logs may include the output from several test runs, since they will automatically rerun on failure to detect flakes.
|
||||
1. If many different tests are failing on the same agent, this may be an indication of infra failure. File an [infrastructure ticket] if needed.
|
||||
1. Note that phones occasionally require manual reboot. If this occurs, escalate on the [hackers-infra channel] on [Discord] file an [infrastructure ticket].
|
||||
|
||||
### Handling a Firebase Test Lab failure
|
||||
The devices in the Firebase test lab are not managed by the Flutter infra team.
|
||||
|
||||
1. The LUCI logs will typically list the device that the test failed for. Check the logs for a Firebase link that will contain logs from the failing device. [Example log](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8772117221814493585/+/u/test_execution/gcloud_firebase__2_/stdout).
|
||||
1. If the failure described in the logs does not appear to be related to a recent commit, contact the [omnilab-ftl-flutter](https://groups.google.com/a/google.com/g/omnilab-ftl-flutter/about) group.
|
||||
1. Alternatively, check the LUCI log for instructions on how to notify Firebase via Slack.
|
||||
|
||||
### Handling a LUCI failure
|
||||
1. If Chrome icon (LUCI) square is red, click the red square and _Open Log for Build #1234_ to see the failing test in LUCI.
|
||||
1. File an [infrastructure ticket] if needed.
|
||||
|
||||
### Reverting commits
|
||||
If the test failure is not a known flake or infrastructure issue, revert the commit immediately.
|
||||
|
||||
If the commit landed within the last 24 hours:
|
||||
1. Locate the patch PR and add the `Revert` label. Our infrastructure will automatically create a revert PR and land it.
|
||||
|
||||
If the commit could not be automatically reverted:
|
||||
1. Create a revert pull request from the bad merged pull request via the "Revert" button at the bottom.
|
||||
1. Add the `revert` label to the PR to allow the bot to land it without approval.
|
||||
1. Add the original author to the as a reviewer so they are notified. If they are not a member of [flutter-hackers], also include the original pull request reviewers.
|
||||
1. In "Related Issues" add a link to any GitHub issues that describe the failure.
|
||||
1. @ mention the author in the [tree-status channel] with a link to the revert pull request. If they are unavailable, send an email. If they are not a [Flutter committer][flutter-hackers] and are not on Discord, escalate to the reviewers of the original pull request.
|
||||
1. As soon as the `analyze-linux` test passes, merge it. You do not need to wait for all presubmit tests to pass, or for an LGTM.
|
||||
1. Reopen any issues that were automatically closed by the original commit. Add a comment: "This has been reverted with pull request #1234."
|
||||
|
||||
### Handling a flaky test
|
||||
Flakes are particularly productivity-killing since they silently trigger all of the key problems the gardener is meant to prevent: red tree status. As such flakes should be treated in the same way a reproducible breakage is treated -- as though it were always failing.
|
||||
|
||||
If you see a test failure that appears to be a flake:
|
||||
1. Re-trigger the test.
|
||||
1. If the build fails to fail (i.e. "passes"), it's a flake and should be treated as a failing test.
|
||||
1. Follow the instructions in this guide to find or create a new GitHub issue.
|
||||
1. If the test has neither been recently introduced, nor recently changed, disable the test. The test owner will turn it back on or delete the test as part of their investigation.
|
||||
|
||||
### Handling an engine roll failure
|
||||
If the failure is happening on an engine roll, contact the [Engine Sheriff chat] so the engine sheriff can locate and revert the engine or upstream commit(s) causing the issue.
|
||||
|
||||
Coordinate with the engine sheriff on pausing and unpausing the [Engine to Framework autoroller] during this process.
|
||||
|
||||
### Handling a benchmark regression
|
||||
Check [framework benchmarks] for regressions. File issues and escalate.
|
||||
|
||||
Review [engine benchmarks] for any regressions. Choose the _Triage_ item on the left, and walk through new issues. For each commit that caused a regression you'll see marks in columns corresponding to the regression --- those marks indicate whether the results at that commit are low or high.
|
||||
|
||||
Click a mark, and you'll be taken to a popup with the plot of recent data around the commit in question. From here you can:
|
||||
1. Choose _View Dashboard_ to see long term trends around the commit. (When in the dashboard you can use the WASD keys to zoom in and out).
|
||||
1. Click the commit to get a sub-popup with a link that can take you to the commit in question.
|
||||
|
||||
If there is a new regression not deemed to be noise in a benchmark:
|
||||
1. [Add a new issue to Github][new issue]
|
||||
1. Label the issue with `team: benchmark`, and `severe:regression` labels. Label it with the `severe:performance` label if the benchmark is a performance one.
|
||||
1. Paste a link to the performance plot from skia-perf into the bug. This is a "permalink", and will help others see what you're seeing.
|
||||
1. Determine the CL at which the regression started and label with which part of the codebase might be causing the problem and whoever submitted the CL if possible.
|
||||
1. Attempt to determine the team who should receive the issue. Usually the suspect roll is a clue.
|
||||
1. Assign an initial priority.
|
||||
1. Reserve `P0` for regressions significantly (1.5x or more) above the noted baselines, or with regular spikes that suggests a possible issue with the device lab.
|
||||
1. Reserve `P2` for issues where slow creep appears to be happening.
|
||||
1. Note the bug ID in the comment where you address the regression in skia-perf and reject the benchmark (click the _X_).
|
||||
1. Notify the target teams where you've identified regressions on [Discord], and include links. When you do so, make sure you @ someone (ideally the TL for that team) so that it's noticed.
|
||||
1. Notify the Flutter engine sheriff and Flutter Hackers Discord chats with any issues you file.
|
||||
If it's noise, accept the benchmark by clicking the checkbox in the triage details popup.
|
||||
|
||||
## Filing an infra ticket
|
||||
1. Open a [new infra issue].
|
||||
1. Add a descriptive title. A message like "Add a LUCI builder for linux web engine" or "Debug gallery startup" is much more helpful than "quick request" or "test doesn't work?".
|
||||
1. Clearly describe the issue or request in the description field. For example, if a ticket is requesting running several commands on the bots, the ticket should explain why, what commands are needed, on which bots and how to verify the results.
|
||||
1. Add the `team: infra` label and a priority label:
|
||||
* `P0` (immediate): Such as a build break or regression.
|
||||
* Fix as soon as possible, before any other work.
|
||||
* Should be very rare, and only used when critical work is blocked without a workaround.
|
||||
* Ideally is downgraded to P1 as soon as a workaround is found.
|
||||
* `P1` (high): Users are suffering but not blocked; or, an immediate-level incident will happen if this is not addressed (e.g., almost out of quota).
|
||||
* Fix today (8 business hours).
|
||||
* Degraded service (Build bots work but are slow to start).
|
||||
* Time-sensitive requests.
|
||||
* Should be relatively rare.
|
||||
* Anything below `P1` is not suitable for the infra ticket queue and will be treated as a normal infra bug.
|
||||
1. Add the project "Infra Ticket Queue".
|
||||
1. Click the create button. No need to set an assignee; infra oncall will handle all new tickets.
|
||||
|
||||
## Communication channels (public)
|
||||
The bulk of communication happens on [Discord].
|
||||
* Tree closure escalation and announcements: [tree-status channel].
|
||||
* Infra issues: [hackers-infra channel]
|
||||
* Infrastructure tickets: File an [infrastructure ticket].
|
||||
|
||||
## Communication channels (Google-internal)
|
||||
* Engine issues: [🐣 Flutter Engine Sheriff ($USERNAME) ⛑️][Engine Sheriff chat]
|
||||
* LUCI help chat: [LUCI Users][LUCI Users chat]
|
||||
|
||||
## References
|
||||
* [Flutter Engine Sheriff Playbook] (Google internal)
|
||||
* [On-call scheduling for Flutter]
|
||||
|
||||
[infrastructure ticket]: #filing-an-infra-ticket
|
||||
|
||||
[flutter/flutter]: https://github.com/flutter/flutter
|
||||
[Flutter issues]: https://github.com/flutter/flutter/issues
|
||||
[TESTOWNERS]: https://github.com/flutter/flutter/blob/master/TESTOWNERS
|
||||
[flutter-hackers]: https://github.com/orgs/flutter/teams/flutter-hackers
|
||||
[new issue]: https://github.com/flutter/flutter/issues/new
|
||||
[new infra issue]: https://github.com/flutter/flutter/issues/new
|
||||
|
||||
[Framework build dashboard]: https://flutter-dashboard.appspot.com/#/build
|
||||
[framework benchmarks]: https://flutter-flutter-perf.skia.org/e/
|
||||
[engine benchmarks]: https://flutter-engine-perf.skia.org/e/
|
||||
|
||||
[Discord]: https://discord.gg/BS8KZyg
|
||||
[tree-status channel]: https://discord.com/channels/608014603317936148/613398423093116959
|
||||
[hackers-infra channel]: https://discord.com/channels/608014603317936148/608021351567065092
|
||||
[Engine Sheriff chat]: http://go/engine-sheriff
|
||||
[LUCI Users chat]: https://mail.google.com/chat/u/0/#chat/space/AAAAXGgrwSo
|
||||
|
||||
[Rotations tool]: https://rotations.corp.google.com/rotation/5721991649689600
|
||||
[Framework Gardener calendar]: https://calendar.google.com/calendar/render?cid=c_him0pti4q5k4h9999u2dv9oouk@group.calendar.google.com
|
||||
|
||||
[Flutter Engine Sheriff Playbook]: https://goto.google.com/engine-sheriff
|
||||
[On-call scheduling for Flutter]: https://docs.google.com/document/d/1i-11by4J3zvxWG3qLMm4MKfJ8DrjIJna6DPA9tBmJWc/edit#heading=h.w8bl5vic6x95
|
||||
|
||||
[Engine to Framework autoroller]: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll?tab=status
|
||||
49
docs/unsorted_wiki/Flutter-GPU.md
Normal file
49
docs/unsorted_wiki/Flutter-GPU.md
Normal file
@@ -0,0 +1,49 @@
|
||||
**Flutter GPU** (previously referred to as "Dart GPU" or "Impeller Dart") is an effort to expose a low level graphics API in the Flutter Framework.
|
||||
|
||||
Design doc: https://flutter.dev/go/impeller-dart
|
||||
|
||||
Flutter GPU's runtime is a thin wrapper over [Impeller](https://github.com/flutter/flutter/wiki/Impeller)'s HAL, from which custom renderers may be entirely built using Dart. Just like with Impeller, Flutter GPU shader bundles are compiled ahead of time using [impellerc](https://github.com/flutter/engine/tree/main/impeller/compiler). As such, Flutter GPU is only available on platforms that support Impeller.
|
||||
|
||||
## Dart FFI
|
||||
|
||||
Under the hood, the API communicates with Flutter Engine via Dart FFI, calling symbols publicly exported by libflutter and/or embedders. These symbols are prefixed with `InternalFlutterGpu`, and are considered unstable. Direct usage of the exported symbols is not supported and will break without notice; the only supported way to use Flutter GPU is by importing `package:flutter_gpu`.
|
||||
|
||||
## Try out Flutter GPU
|
||||
|
||||
Once released, Flutter GPU will be shipped as part of the Flutter SDK in the form of a Dart package called `flutter_gpu`. An early implementation of the `flutter_gpu` package is being developed under the [`lib/gpu` directory](https://github.com/flutter/engine/tree/main/lib/gpu) of the Flutter Engine repository.
|
||||
|
||||
> [!CAUTION]
|
||||
> _All_ aspects of Flutter GPU are subject to breakage or removal at any time without prior deprecation notice or viable feature replacement. DO NOT rely on Flutter GPU for production projects at this time, but DO have fun playing with it and sharing your experiments with the community.
|
||||
|
||||
Flutter GPU is currently unfinished, extremely experimental, and not well documented. [bdero](https://github.com/bdero) is actively developing and testing Flutter GPU against the MacOS desktop embedder; shader compilation and import likely don't function correctly on other platforms yet. However, if you wish to experiment with Flutter GPU, it is possible to do so without a custom Engine build:
|
||||
|
||||
1. Update your Flutter checkout to the latest version in the [master channel](https://docs.flutter.dev/release/upgrade#other-channels).
|
||||
1. Clone [Flutter Engine](https://github.com/flutter/engine) and checkout the Engine commit that the Flutter master channel is currently pinned to. This can be found in the [`bin/internal/engine.version` file](https://github.com/flutter/flutter/blob/master/bin/internal/engine.version) of the main Flutter repository.
|
||||
```sh
|
||||
git clone https://github.com/flutter/engine.git
|
||||
cd engine
|
||||
git reset --hard [PINNED_ENGINE_COMMIT]
|
||||
```
|
||||
1. Create a new Flutter project using the Flutter tool and add `flutter_gpu` as a dependency in `pubspec.yaml` with a local path pointing to the `lib/gpu` directory within the Flutter Engine repository cloned in step 2. For example:
|
||||
```yaml
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
flutter_gpu:
|
||||
path: ../engine/src/flutter/lib/gpu
|
||||
```
|
||||
1. From here, you can import the API and begin using it.
|
||||
```dart
|
||||
import 'package:flutter_gpu/gpu.dart' as gpu;
|
||||
```
|
||||
Check out this [examples repository](https://github.com/bdero/flutter-gpu-examples), which includes an example of [drawing a triangle](https://github.com/bdero/flutter-gpu-examples/blob/master/lib/triangle.dart), among other things.
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
If you run into issues while using Flutter GPU, please file a bug using the standard [bug report template](https://github.com/flutter/flutter/issues/new?assignees=&labels=&projects=&template=2_bug.yml). Additionally, mention "Flutter GPU" in the title, label the bug with the `e: impeller` label, and tag [bdero](https://github.com/bdero) in the issue description.
|
||||
|
||||
## Questions or feedback?
|
||||
|
||||
If you have non-bug report questions surrounding Flutter GPU, there are several ways you can reach out to the developer:
|
||||
* Create a thread in the #help channel of the [Discord server](https://github.com/flutter/flutter/wiki/Chat). Place "Flutter GPU" in the title of the thread and tag @bdero in the message.
|
||||
* Send a Twitter DM to [@algebrandon](https://twitter.com/algebrandon).
|
||||
616
docs/unsorted_wiki/Flutter-Infrastructure-Foundation.md
Normal file
616
docs/unsorted_wiki/Flutter-Infrastructure-Foundation.md
Normal file
@@ -0,0 +1,616 @@
|
||||
# Flutter Infrastructure Foundation
|
||||
|
||||
The Flutter Infrastructure Foundation Team is responsible for setting up, maintaining and improving the low level infrastructure used to build, test and release Flutter.
|
||||
|
||||
|
||||
## DeviceLab Hardware
|
||||
|
||||
Flutter keeps a lab of test beds that include hosts and phones for all the supported platforms. These test beds are used to collect performance benchmarks and detect regressions.
|
||||
|
||||
As of May 2023 the Flutter DeviceLab contains 99 test beds with the following hardware and software:
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>Host</strong>
|
||||
</td>
|
||||
<td><strong>Architecture</strong>
|
||||
</td>
|
||||
<td><strong>Phone</strong>
|
||||
</td>
|
||||
<td><strong>Count</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linux
|
||||
</td>
|
||||
<td>X64
|
||||
</td>
|
||||
<td>Android
|
||||
</td>
|
||||
<td>36
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows
|
||||
</td>
|
||||
<td>X64
|
||||
</td>
|
||||
<td>Android
|
||||
</td>
|
||||
<td>6
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows
|
||||
</td>
|
||||
<td>Arm64
|
||||
</td>
|
||||
<td>Android
|
||||
</td>
|
||||
<td>1
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows
|
||||
</td>
|
||||
<td>Arm64
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>9
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mac
|
||||
</td>
|
||||
<td>X64
|
||||
</td>
|
||||
<td>iOS
|
||||
</td>
|
||||
<td>18
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mac
|
||||
</td>
|
||||
<td>X64
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>2
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mac
|
||||
</td>
|
||||
<td>Arm64
|
||||
</td>
|
||||
<td>iOS
|
||||
</td>
|
||||
<td>12
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mac
|
||||
</td>
|
||||
<td>Arm64
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>1
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mac
|
||||
</td>
|
||||
<td>X64
|
||||
</td>
|
||||
<td>Android
|
||||
</td>
|
||||
<td>9
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mac
|
||||
</td>
|
||||
<td>Arm64
|
||||
</td>
|
||||
<td>Android
|
||||
</td>
|
||||
<td>5
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
## VMs
|
||||
|
||||
Flutter uses Linux and Windows virtual machines to build and test Flutter. These VMs are auto-provisioned and distributed to 4 different pools. The following is the configuration distribution:
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td style="background-color: null"><strong>LUCI pool</strong>
|
||||
</td>
|
||||
<td style="background-color: null"><strong>config</strong>
|
||||
</td>
|
||||
<td style="background-color: null"><strong>os</strong>
|
||||
</td>
|
||||
<td style="background-color: null"><strong>cpus</strong>
|
||||
</td>
|
||||
<td style="background-color: null"><strong>count</strong>
|
||||
</td>
|
||||
<td style="background-color: null"><strong>total cpus</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.prod
|
||||
</td>
|
||||
<td style="background-color: null">e2-standard-32
|
||||
</td>
|
||||
<td style="background-color: null">Linux
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
32</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
15</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
480</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.prod
|
||||
</td>
|
||||
<td style="background-color: null">n1-standard-8
|
||||
</td>
|
||||
<td style="background-color: null">Linux
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
8</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
135</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
1080</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.try
|
||||
</td>
|
||||
<td style="background-color: null">e2-standard-32
|
||||
</td>
|
||||
<td style="background-color: null">Linux
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
32</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
30</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
960</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.try
|
||||
</td>
|
||||
<td style="background-color: null">n1-standard-8
|
||||
</td>
|
||||
<td style="background-color: null">Linux
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
8</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
137</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
1096</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.staging
|
||||
</td>
|
||||
<td style="background-color: null">e2-standard-32
|
||||
</td>
|
||||
<td style="background-color: null">Linux
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
32</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
4</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
128</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.staging
|
||||
</td>
|
||||
<td style="background-color: null">n1-standard-8
|
||||
</td>
|
||||
<td style="background-color: null">Linux
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
8</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
30</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
240</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.dart-internal.flutter
|
||||
</td>
|
||||
<td style="background-color: null">e2-standard-32
|
||||
</td>
|
||||
<td style="background-color: null">Linux
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
32</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
20</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
640</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.prod
|
||||
</td>
|
||||
<td style="background-color: null">e2-highmem-8
|
||||
</td>
|
||||
<td style="background-color: null">Windows
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
8</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
59</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
472</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.try
|
||||
</td>
|
||||
<td style="background-color: null">e2-highmem-8
|
||||
</td>
|
||||
<td style="background-color: null">Windows
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
8</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
130</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
1040</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.staging
|
||||
</td>
|
||||
<td style="background-color: null">e2-highmem-8
|
||||
</td>
|
||||
<td style="background-color: null">Windows
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
8</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
12</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
96</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.dart-internal.flutter
|
||||
</td>
|
||||
<td style="background-color: null">e2-highmem-8
|
||||
</td>
|
||||
<td style="background-color: null">Windows
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
8</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
20</p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
160</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null"><strong>Totals</strong>
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
<strong>592</strong></p>
|
||||
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
<strong>6392</strong></p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
## Mac hostonly machines
|
||||
|
||||
Mac machines are organized in a different category because they are provisioned in chrome labs and have no phones attached. The machine configurations are the following:
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td style="background-color: null"><strong>LUCI pool</strong>
|
||||
</td>
|
||||
<td style="background-color: null"><strong>model</strong>
|
||||
</td>
|
||||
<td style="background-color: null"><strong>os</strong>
|
||||
</td>
|
||||
<td style="background-color: null"><strong>count</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.prod
|
||||
</td>
|
||||
<td style="background-color: null">Macmini8,1
|
||||
</td>
|
||||
<td style="background-color: null">Mac-12.6-21G115
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
28</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.prod
|
||||
</td>
|
||||
<td style="background-color: null">Macmini9,1
|
||||
</td>
|
||||
<td style="background-color: null">Mac-12.6-21G115
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
31</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.try
|
||||
</td>
|
||||
<td style="background-color: null">Macmini8,1
|
||||
</td>
|
||||
<td style="background-color: null">Mac-12.6-21G115
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
74</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.try
|
||||
</td>
|
||||
<td style="background-color: null">Macmini9,1
|
||||
</td>
|
||||
<td style="background-color: null">Mac-12.6-21G115
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
71</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.staging
|
||||
</td>
|
||||
<td style="background-color: null">Macmini8,1
|
||||
</td>
|
||||
<td style="background-color: null">Mac-12.6-21G115
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
5</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.flutter.staging
|
||||
</td>
|
||||
<td style="background-color: null">Macmini9,1
|
||||
</td>
|
||||
<td style="background-color: null">Mac-12.6-21G115
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
7</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.dart-internal.flutter
|
||||
</td>
|
||||
<td style="background-color: null">Macmini8,1
|
||||
</td>
|
||||
<td style="background-color: null">Mac-12.6-21G116
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
15</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">luci.dart-internal.flutter
|
||||
</td>
|
||||
<td style="background-color: null">Macmini9,1
|
||||
</td>
|
||||
<td style="background-color: null">Mac-12.6-21G117
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
2</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: null"><strong>Totals</strong>
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null">
|
||||
</td>
|
||||
<td style="background-color: null"><p style="text-align: right">
|
||||
<strong>233</strong></p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
## Services
|
||||
|
||||
Flutter Infrastructure Foundation owns the DeviceLab provisioning services, maintains Flutter LUCI service configurations, and provides lab maintenance services.
|
||||
|
||||
This is the list of services with their descriptions:
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>Service</strong>
|
||||
</td>
|
||||
<td><strong>Type</strong>
|
||||
</td>
|
||||
<td><strong>Description</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SALT
|
||||
</td>
|
||||
<td>Owned
|
||||
</td>
|
||||
<td>Configuration provisioning service used to push configurations as code for host and devices for all the supported platforms.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Machine Provider
|
||||
</td>
|
||||
<td>Configuration management
|
||||
</td>
|
||||
<td>Configuration service to provision, spin up and tear down virtual machines.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LUCI swarming bot
|
||||
</td>
|
||||
<td>Owned
|
||||
</td>
|
||||
<td>Scripts used to set up and tear down LUCI services on the supported platforms.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Capacity planning and delivery
|
||||
</td>
|
||||
<td>Owned
|
||||
</td>
|
||||
<td>Budgeting for lab expansions, delivery of new capacity, and decommissioning of end of life hardware.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lab maintenance
|
||||
</td>
|
||||
<td>Owned
|
||||
</td>
|
||||
<td>Faulty hardware replacement, hardware recovery and reprovisioning.
|
||||
<p>
|
||||
Lab migrations planning and execution.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Onboarding of new platforms
|
||||
</td>
|
||||
<td>Owned
|
||||
</td>
|
||||
<td>Creating provisioning SALT scripts and onboarding on LUCI services.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Device doctor
|
||||
</td>
|
||||
<td>Owned
|
||||
</td>
|
||||
<td>Phone configuration validation and device recovery.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
25
docs/unsorted_wiki/Flutter-Installation-Bundles.md
Normal file
25
docs/unsorted_wiki/Flutter-Installation-Bundles.md
Normal file
@@ -0,0 +1,25 @@
|
||||
Flutter has installation bundles which you can download and install for the [`beta` channel](https://github.com/flutter/flutter/wiki/Flutter-build-release-channels). (They were previously also available for the `dev` channel, but [the dev channel has been retired](https://medium.com/flutter/whats-new-in-flutter-2-8-d085b763d181#34c4).)
|
||||
|
||||
The installation bundles were designed to allow you to have a completely populated environment without having to first download the Git repository, then compile the flutter tool, etc.
|
||||
|
||||
Creating an installation bundle consists of running the following steps. These steps will pre-cache all of the necessary components for working offline. One could follow these steps e.g. to create an installation bundle for the `master` branch.
|
||||
|
||||
1) _OPTIONAL_: Set and export the `PUB_CACHE` environment variable to point to the location where you would like your pub cache to be stored. If you don't set this, it will be stored in pub's default location in your home directory (varies based on your OS). Alternatively, if you create the `flutter/.pub-cache` directory before any commands that invoke `pub` (e.g. the `flutter packages` command), then the flutter tool will automatically use it, and you won't have to set PUB_CACHE in your environment.
|
||||
1) _WINDOWS ONLY_: Download and install a command line version of Git. Windows doesn't come with git pre-installed, so you'll have to download it from one of the many sources on the Internet.
|
||||
1) `git clone -b master https://github.com/flutter/flutter.git` to clone the Flutter Git repo into the directory "flutter" in the current directory.
|
||||
1) Change directories into the newly created "flutter" directory.
|
||||
1) Add the Flutter `bin` directory to your path:
|
||||
- Windows: `set PATH="%PATH%;%CD%\bin\flutter"`
|
||||
- Other platforms: `export PATH="$PATH:$PWD/flutter"`
|
||||
1) `flutter doctor` to check your installation and build the initial snapshot of the `flutter` tool. Install any missing software it tells you about, such as the Android SDK, or XCode tools.
|
||||
1) `flutter update-packages` will download all of the pub package dependencies needed to build any of the packages in the Flutter main distribution.
|
||||
1) `flutter precache` will make sure that the `flutter` tool's cache of binary artifacts is up-to-date.
|
||||
1) _OPTIONAL_: `flutter ide-config --overwrite` will generate and update IDE configuration files for the Flutter repo. You only need to do this if you are using an IDE like IntelliJ or VS Code.
|
||||
1) In a temporary directory, run `flutter create --template=app app_sample`, `flutter create --template=package package_sample`, and `flutter create --template=plugin plugin_sample`. You may then remove the app_sample, package_sample, and plugin_sample directories. This will populate the pub cache with any additional packages needed for creating new flutter projects using each of those templates.
|
||||
|
||||
Another alternative to the above steps is to run the prepare_package.dart script directly (which is what we use to create the installation bundles in the first place). You would invoke that script like this:
|
||||
|
||||
1) Go as far as the `flutter doctor` step in the above steps (or if you have a working flutter repo already, you can skip that: it can be from another channel, but use a fairly current one for best results).
|
||||
1) Invoke `./bin/cache/dart-sdk/bin/dart ./dev/bots/prepare_package.dart --temp_dir $TMPDIR --revision $REVISION --branch master --output $PWD`, from the `flutter` root, where `TMPDIR` is set to a directory where there are several gigabytes of free space, and `REVISION` is set to the 40-character git hash of the revision you wish to be working on.
|
||||
|
||||
This will build an archive bundle in the current directory that has done all of the above steps, and contains the `master` branch.
|
||||
318
docs/unsorted_wiki/Flutter-Self-Service-Index.md
Normal file
318
docs/unsorted_wiki/Flutter-Self-Service-Index.md
Normal file
@@ -0,0 +1,318 @@
|
||||
## Flutter Self Service Index
|
||||
|
||||
Flutter provides multiple functionality through self-service services. Most of these services are available to any member of the Flutter GitHub organization.
|
||||
|
||||
|
||||
### Audiences
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>Name</strong>
|
||||
</td>
|
||||
<td><strong>Description</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flutter contributors
|
||||
</td>
|
||||
<td>Anyone contributing to the flutter organization independently of membership to the organization.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flutter organization members
|
||||
</td>
|
||||
<td><a href="https://github.com/flutter/flutter/wiki/Contributor-access">Anyone with write access to the flutter organization resources</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Googlers
|
||||
</td>
|
||||
<td>Members of the Flutter Organization that are also Googlers.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flutter organization administrators
|
||||
</td>
|
||||
<td>Members of the Flutter organization that have write access to the organization's settings.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
### Infrastructure
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>Service</strong>
|
||||
</td>
|
||||
<td><strong>Description</strong>
|
||||
</td>
|
||||
<td><strong>Audience</strong>
|
||||
</td>
|
||||
<td><strong>Documentation</strong>
|
||||
</td>
|
||||
<td><strong>Location</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>.ci.yaml
|
||||
</td>
|
||||
<td>Configuration file to instruct the Flutter Infrastructure which tasks to use to validate commits in a given repository. ".ci.yaml" is read from the top level folder of every supported repository.
|
||||
</td>
|
||||
<td>Flutter contributors
|
||||
</td>
|
||||
<td><a href="https://github.com/flutter/cocoon/blob/main/CI_YAML.md">Link</a>
|
||||
</td>
|
||||
<td>Top level folder of the GitHub repositories. E.g. <a href="https://github.com/flutter/flutter/blob/master/.ci.yaml">flutter/flutter</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Engine build configurations
|
||||
</td>
|
||||
<td>Configuration files to describe Flutter Engine builds and tests.
|
||||
</td>
|
||||
<td>Flutter contributors
|
||||
</td>
|
||||
<td><a href="https://github.com/flutter/engine/blob/main/ci/builders/README.md">Link</a>
|
||||
</td>
|
||||
<td><a href="https://github.com/flutter/engine/tree/main/ci/builders">engine/ci/builders</a> in the <a href="https://github.com/flutter/engine/tree/main">flutter/engine</a> repository contains all the current configuration files.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Autosubmit
|
||||
</td>
|
||||
<td>GitHub application that auto-submits pull requests that meet the approval criteria.
|
||||
</td>
|
||||
<td>Flutter organization administrators
|
||||
</td>
|
||||
<td><a href="go/enabling_autosubmit">Link</a>
|
||||
</td>
|
||||
<td>The application code is available in the <a href="https://github.com/flutter/cocoon/tree/main/auto_submit">flutter/cocoon</a> repository.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>FirebaseLab tests
|
||||
</td>
|
||||
<td>Special type of tests configured through .ci.yaml that use resources from FirebaseLab
|
||||
</td>
|
||||
<td>Flutter contributors
|
||||
</td>
|
||||
<td><a href="https://github.com/flutter/flutter/wiki/flutter-firebaselab-tests">Link</a>
|
||||
</td>
|
||||
<td>These configurations go directly in the .ci.yaml file of <a href="https://github.com/flutter/flutter">flutter/flutter</a> repository.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Codesigning
|
||||
</td>
|
||||
<td>Add metadata to engine artifacts for code signing infrastructure to sign them.
|
||||
</td>
|
||||
<td>Flutter contributors
|
||||
</td>
|
||||
<td><a href="https://github.com/flutter/flutter/wiki/code-signing-metadata">Link</a>
|
||||
</td>
|
||||
<td>GN files and global generator scripts in the <a href="https://github.com/flutter/engine">flutter/engine</a> repository.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Emulators support
|
||||
</td>
|
||||
<td>Using android emulators from tests.
|
||||
</td>
|
||||
<td>Flutter contributors
|
||||
</td>
|
||||
<td><a href="https://github.com/flutter/flutter/wiki/Testing-Android-Changes-in-the-Devicelab-on-an-Emulator">Link</a>
|
||||
</td>
|
||||
<td>Flutter Github Wiki page under the “Android Development” Section.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rerun GitHub presubmit test using command line
|
||||
</td>
|
||||
<td>Run presubmit tasks using `reset-try-task` end point and gcloud CLI.
|
||||
</td>
|
||||
<td> Googlers
|
||||
</td>
|
||||
<td><a href="https://g3doc.corp.google.com/company/teams/flutter/infrastructure/playbook.md?cl=head#manually-trigger-try-pre-submit-builds">Link</a>
|
||||
</td>
|
||||
<td>Source code is available <a href="https://github.com/flutter/cocoon/blob/main/app_dart/lib/src/request_handlers/reset_try_task.dart">here</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rerun postsubmit test from Flutter build dashboard
|
||||
</td>
|
||||
<td>Re-run postsubmit tasks from the go/flutter-dashboard.
|
||||
</td>
|
||||
<td> Googlers
|
||||
</td>
|
||||
<td><a href="https://screenshot.googleplex.com/3CgvqjbPEuoLzXs">Link</a>
|
||||
</td>
|
||||
<td>Source code is available <a href="https://g3doc.corp.google.com/company/teams/flutter/go/flutter-dashboard">go/flutter-dashboard</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Run a test multiple times in parallel via LED
|
||||
</td>
|
||||
<td>Run a shard test against a pull request to validate changes/fixes in parallel.
|
||||
</td>
|
||||
<td> Googlers
|
||||
</td>
|
||||
<td><a href="https://g3doc.corp.google.com/company/teams/flutter/infrastructure/playbook.md?cl=head#run-a-shard-multiple-times-in-parallel-via-led">Link</a>
|
||||
</td>
|
||||
<td>N/A
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Create a CIPD package
|
||||
</td>
|
||||
<td>Create and add the package build scripts to cocoon to enable auto building and uploading to flutter CIPD namespaces.
|
||||
</td>
|
||||
<td> Flutter contributors
|
||||
</td>
|
||||
<td><a href="https://github.com/flutter/cocoon/tree/main/cipd_packages">Link</a>
|
||||
</td>
|
||||
<td>Flutter public CIPD namespace: <a href="https://chrome-infra-packages.appspot.com/p/flutter">flutter</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>View Infra SLO metrics
|
||||
</td>
|
||||
<td>DataSite with links to a collection of Engineering Productivity dashboards including infrastructure, release and rolls.
|
||||
</td>
|
||||
<td> Googlers
|
||||
</td>
|
||||
<td><a href="https://data.corp.google.com/sites/dash_infra_metrics_datasite/infra_slo_metrics/">Link</a>
|
||||
</td>
|
||||
<td>N/A
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
### Release
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>Service</strong>
|
||||
</td>
|
||||
<td><strong>Description</strong>
|
||||
</td>
|
||||
<td><strong>Audience</strong>
|
||||
</td>
|
||||
<td><strong>Documentation</strong>
|
||||
</td>
|
||||
<td><strong>Location</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Create non flutter release candidate branches
|
||||
</td>
|
||||
<td>Self service to create release candidate branches used by products different than flutter
|
||||
</td>
|
||||
<td> Googlers
|
||||
</td>
|
||||
<td><a href="https://g3doc.corp.google.com/company/teams/flutter/go/flutter-self-service-branches">Link</a>
|
||||
</td>
|
||||
<td>N/A
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Request 1P cherry picks
|
||||
</td>
|
||||
<td>Request approvals for cherry picks to release candidate branches
|
||||
</td>
|
||||
<td> Googlers
|
||||
</td>
|
||||
<td><a href="https://g3doc.corp.google.com/company/teams/flutter/go/flutter-cp">Link</a>
|
||||
</td>
|
||||
<td><a href="https://g3doc.corp.google.com/company/teams/flutter/github.com/flutter/flutter">flutter/flutter</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>G3 Fixes
|
||||
</td>
|
||||
<td>Apply G3 fixes that are automatically applied during the roll process.
|
||||
</td>
|
||||
<td> Googlers
|
||||
</td>
|
||||
<td><a href="https://g3doc.corp.google.com/company/teams/flutter/go/flutter-life-of-a-pr#g3fix">Link</a>
|
||||
</td>
|
||||
<td>N/A
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Single command releases
|
||||
</td>
|
||||
<td>Creating a third party flutter release with multi party approvals.
|
||||
</td>
|
||||
<td> Release Engineering
|
||||
</td>
|
||||
<td><a href="https://g3doc.corp.google.com/company/teams/flutter/go/flutter-release-workflow#push">Link</a>
|
||||
</td>
|
||||
<td>N/A
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
### Security
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>Service</strong>
|
||||
</td>
|
||||
<td><strong>Description</strong>
|
||||
</td>
|
||||
<td><strong>Audience</strong>
|
||||
</td>
|
||||
<td><strong>Documentation</strong>
|
||||
</td>
|
||||
<td><strong>Location</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vulnerability scanning and fixes validation
|
||||
</td>
|
||||
<td>Automatic scanning of c, c++ third party dependencies and vulnerability. fix validation.
|
||||
</td>
|
||||
<td>Flutter organization members
|
||||
</td>
|
||||
<td><a href="https://github.com/flutter/engine/security/code-scanning">Link</a>
|
||||
</td>
|
||||
<td><a href="https://github.com/flutter/engine/security">Engine github security tab</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Request write access to non-prod GCP projects
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td> Googlers
|
||||
</td>
|
||||
<td><a href="https://g3doc.corp.google.com/company/teams/flutter/security/gcp_security/aod_roles_for_dash_projects.md?cl=head#available-groups">Link</a>
|
||||
</td>
|
||||
<td>N/A
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rolling non-auto-updating 3p mirrored deps
|
||||
</td>
|
||||
<td>Dependencies on mirrors that do not automatically roll changes from their upstream might need to be manually rolled
|
||||
</td>
|
||||
<td> Googlers
|
||||
</td>
|
||||
<td><a href="https://g3doc.corp.google.com/company/teams/flutter/security/third_party_deps/index.md?cl=head#rolling-mirrored-dependencies">Link</a>
|
||||
</td>
|
||||
<td>N/A
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
Googlers can access the internal version using [go/flutter-self-service](http://go/flutter-self-service)
|
||||
77
docs/unsorted_wiki/Flutter-Test-Fonts.md
Normal file
77
docs/unsorted_wiki/Flutter-Test-Fonts.md
Normal file
@@ -0,0 +1,77 @@
|
||||
Flutter tests run via the `flutter test` command have access to several readily available test fonts, including [FlutterTest](#the-fluttertest-test-font) and [Ahem](https://www.w3.org/Style/CSS/Test/Fonts/Ahem/).
|
||||
|
||||
In tests, if [`fontFamily`](https://master-api.flutter.dev/flutter/painting/TextStyle/fontFamily.html) isn't specified or the specified font families are not available, the default test font `FlutterTest` will be used.
|
||||
If you wish to use a custom font in tests, check out the [`FontLoader`](https://master-api.flutter.dev/flutter/services/FontLoader-class.html) class, and [this example](https://github.com/flutter/flutter/blob/6ec444506375cfa94535a45c2320e01094c295e0/packages/flutter/test/material/icons_test.dart#L149-L172).
|
||||
|
||||
## The `FlutterTest` test font
|
||||
|
||||
### Font Metrics (in design units)
|
||||
|
||||
| | Ascent | Descent | Line Gap (Leading) | Units Per EM | Underline Position |
|
||||
| :-- | :---: | :---: | :---: | :---: | :---: |
|
||||
| `FlutterTest` | 768 (0.75 em) above the baseline | 256 (0.25 em) below the baseline | 0 | 1024 | 146 under the baseline |
|
||||
| `Ahem` | 800 (0.8 em) above the baseline | 200 (0.2 em) below the baseline | 0 | 1000 | 142 under the baseline |
|
||||
|
||||
The `FlutterTest` font's `1024 units-per-em` is a power of 2, making it less likely to introduce precision loss in metrics calculations, when used as a divisor.
|
||||
Thanks to that, the `FlutterTest` font generally provides more precise and font-engine-agnostic font/glyph metrics than `Ahem`.
|
||||
|
||||
**Example**
|
||||
|
||||
You can expect this test to pass on all platforms (currently with the exception of the web HTML renderer):
|
||||
```dart
|
||||
final painter = TextPainter(
|
||||
text: const TextSpan(
|
||||
text: 'text',
|
||||
style: TextStyle(fontSize: 14.0, /* "fontFamily: 'FlutterTest'" is implied */),
|
||||
),
|
||||
textDirection: TextDirection.ltr,
|
||||
textScaleFactor: 1.0,
|
||||
);
|
||||
final lineMetrics = textPainer.computeLineMetrics().first;
|
||||
|
||||
expect(lineMetrics.height, 14.0);
|
||||
expect(lineMetrics.ascent, 10.5); // 0.75em * 14.0pt
|
||||
expect(lineMetrics.descent, 3.5); // 0.25em * 14.0pt
|
||||
// 'text' is 4 glyphs. Most glyphs are as wide as they are tall.
|
||||
expect(lineMetrics.width, 14.0 * 4);
|
||||
```
|
||||
While with the `Ahem` font you would get [slightly different metrics on different platforms](https://github.com/flutter/flutter/issues/62819), since they use different font engines to scale the font.
|
||||
|
||||
### Glyphs
|
||||
|
||||
(images to be added)
|
||||
|
||||
The font covers most types of glyphs defined in the `Ahem` font.
|
||||
|
||||
| Square | Ascent Flushed | Descent Flushed | .notdef |
|
||||
| :---: | :----: | :----: | :----: |
|
||||
| a box that fills the em square | the **Square** glyph but without the part above the baseline | the **Square** glyph but without the part below the baseline | a hollow box |
|
||||
|
||||
The remaining glyphs (for example, **Full Advance**, **1/2 Advance**) are defined with no outlines in the glyph, with different x-advances.
|
||||
|
||||
|
||||
### Glyph Mapping
|
||||
|
||||
Unmapped codepoints will be mapped to the **.notdef** glyph in the test environment.
|
||||
|
||||
| \ Script <br />Glyph | DFLT | grek | hani | latn |
|
||||
| :--- | :----: | :----: | :----: | :----: |
|
||||
| Square | **codepoint(s):** 0x21-0x26, 0x28-0x40, 0x5b-0x60, 0x7b-0x7e, 0xa1-0xa9, 0xab-0xb9, 0xbb-0xbf, 0xd7, 0xf7, 0x2c6-0x2c7, 0x2c9, 0x2d8-0x2dd, 0x2013-0x2014, 0x2018-0x201a, 0x201c-0x201e, 0x2020-0x2022, 0x2026, 0x2030, 0x2039-0x203a, 0x2044, 0x2122, 0x2202, 0x2206, 0x220f, 0x2211-0x2212, 0x2219-0x221a, 0x221e, 0x222b, 0x2248, 0x2260, 0x2264-0x2265, 0x22f2, 0x25ca, 0xf000-0xf002<br />**character(s):** `!` `"` `#` `$` `%` `&` `(` `)` `*` `+` `,` `-` `.` `/` `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` `:` `;` `<` `=` `>` `?` `@` `[` `\` `]` `^` `_` `` ` `` `{` `\|` `}` `~` `¡` `¢` `£` `¤` `¥` `¦` `§` `¨` `©` `«` `¬` `<SOFT HYPHEN>` `®` `¯` `°` `±` `²` `³` `´` `µ` `¶` `·` `¸` `¹` `»` `¼` `½` `¾` `¿` `×` `÷` `ˆ` `ˇ` `ˉ` `˘` `˙` `˚` `˛` `˜` `˝` `–` `—` `‘` `’` `‚` `“` `”` `„` `†` `‡` `•` `…` `‰` `‹` `›` `⁄` `™` `∂` `∆` `∏` `∑` `−` `∙` `√` `∞` `∫` `≈` `≠` `≤` `≥` `⋲` `◊` `<0xf000>` `<0xf001>` `<0xf002>` | **codepoint(s):** 0x394, 0x3a5, 0x3a7, 0x3a9, 0x3bc, 0x3c0, 0x2126<br />**character(s):** `Δ` `Υ` `Χ` `Ω` `μ` `π` `Ω` | **codepoint(s):** 0x3007, 0x4e00, 0x4e03, 0x4e09, 0x4e2d, 0x4e5d, 0x4e8c, 0x4e94, 0x516b, 0x516d, 0x5341, 0x5426, 0x56d7, 0x56db, 0x571f, 0x6587, 0x6587, 0x662f, 0x6728, 0x672c, 0x6b63, 0x6c34, 0x6d4b, 0x706b, 0x786e, 0x8bd5, 0x91d1<br />**character(s):** `〇` `一` `七` `三` `中` `九` `二` `五` `八` `六` `十` `否` `囗` `四` `土` `文` `文` `是` `木` `本` `正` `水` `测` `火` `确` `试` `金` | **codepoint(s):** 0x41-0x5a, 0x61-0x7a, 0xaa, 0xba, 0xc0-0xc8, 0xca-0xd6, 0xd8-0xf6, 0xf8-0xff, 0x131, 0x152-0x153, 0x178, 0x192<br />**character(s):** `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` `ª` `º` `À` `Á` `Â` `Ã` `Ä` `Å` `Æ` `Ç` `È` `Ê` `Ë` `Ì` `Í` `Î` `Ï` `Ð` `Ñ` `Ò` `Ó` `Ô` `Õ` `Ö` `Ø` `Ù` `Ú` `Û` `Ü` `Ý` `Þ` `ß` `à` `á` `â` `ã` `ä` `å` `æ` `ç` `è` `é` `ê` `ë` `ì` `í` `î` `ï` `ð` `ñ` `ò` `ó` `ô` `õ` `ö` `ø` `ù` `ú` `û` `ü` `ý` `þ` `ÿ` `ı` `Œ` `œ` `Ÿ` `ƒ` |
|
||||
| Ascent Flushed | | | | **codepoint(s):** 0x70<br />**character(s):** `p` |
|
||||
| Descent Flushed | | | | **codepoint(s):** 0xc9<br />**character(s):** `É` |
|
||||
| Full Advance | **codepoint(s):** 0x20<br />**character(s):** `<SPACE>` | | | |
|
||||
| 1/2 Advance | **codepoint(s):** 0x2002<br />**character(s):** `<EN SPACE>` | | | |
|
||||
| 1/3 Advance | **codepoint(s):** 0x2004<br />**character(s):** `<THREE-PER-EM SPACE>` | | | |
|
||||
| 1/4 Advance | **codepoint(s):** 0x2005<br />**character(s):** `<FOUR-PER-EM SPACE>` | | | |
|
||||
| 1/6 Advance | **codepoint(s):** 0x2006<br />**character(s):** `<SIX-PER-EM SPACE>` | | | |
|
||||
| 1/5 Advance | **codepoint(s):** 0x2009<br />**character(s):** `<THIN SPACE>` | | | |
|
||||
| 1/10 Advance | **codepoint(s):** 0x200a<br />**character(s):** `<HAIR SPACE>` | | | |
|
||||
| Zero Advance | **codepoint(s):** 0xfeff<br />**character(s):** `<ZERO WIDTH NO-BREAK SPACE>` | | | |
|
||||
|
||||
### Caveats
|
||||
|
||||
To disable FreeType auto-hinter, the family name defined within the font is not `FlutterTest` but `MingLiU`. This typically doesn't affect framework tests as the font is registered under the name `FlutterTest`.
|
||||
|
||||
### Adding more Codepoints/Glyphs to the `FlutterTest` Font
|
||||
|
||||
The `FlutterTest` font is generated by [this script](https://github.com/flutter/engine/blob/170cbea/tools/gen_test_font.py).
|
||||
16
docs/unsorted_wiki/Flutter-Web-Triage.md
Normal file
16
docs/unsorted_wiki/Flutter-Web-Triage.md
Normal file
@@ -0,0 +1,16 @@
|
||||
When triaging web issues follow the following process:
|
||||
|
||||
- Make sure there are no [unassigned P0 and P1 issues](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-web+label%3AP1%2CP0+no%3Aassignee).
|
||||
- Make sure there are no [P1 issues outside the backlog](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-web+label%3AP1%2CP0+-project%3Aflutter%2F132+).
|
||||
- Make sure there are no [P3 issues in the backlog](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+project%3Aflutter%2F132+label%3AP3).
|
||||
- Make sure there are no assigned P2 and P3 issues:
|
||||
- [ditman](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-web+label%3AP2%2CP3+assignee%3Aditman)
|
||||
- [eyebrowsoffire](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-web+label%3AP2%2CP3+assignee%3Aeyebrowsoffire)
|
||||
- [harryterkelsen](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-web+label%3AP2%2CP3+assignee%3Aharryterkelsen)
|
||||
- [htoor3](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-web+label%3AP2%2CP3+assignee%3Ahtoor3)
|
||||
- [kevmoo](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-web+label%3AP2%2CP3+assignee%3Akevmoo)
|
||||
- [mdebbar](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-web+label%3AP2%2CP3+assignee%3Amdebbar)
|
||||
- [yjbanov](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-web+label%3AP2%2CP3+assignee%3Ayjbanov)
|
||||
- The list of [P0 and P1 issues](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3Ateam-web+label%3AP1%2CP0) should be manageable (<30 issues)
|
||||
- The [list of open PRs](https://github.com/pulls?q=is%3Aopen+is%3Apr+archived%3Afalse+user%3Aflutter+sort%3Aupdated-asc+label%3Aplatform-web) should be manageable (<15).
|
||||
- Triage [untriaged issues](https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Ateam-web%2Cfyi-web+-label%3Atriaged-web+no%3Aassignee+-label%3A%22will+need+additional+triage%22+sort%3Aupdated-asc+-label%3A%22waiting+for+customer+response%22+)
|
||||
63
docs/unsorted_wiki/Flutter-build-release-channels.md
Normal file
63
docs/unsorted_wiki/Flutter-build-release-channels.md
Normal file
@@ -0,0 +1,63 @@
|
||||
## Flutter's channels
|
||||
|
||||
Flutter has the following channels, in increasing order of stability.
|
||||
|
||||
### `master` (aka `main`)
|
||||
|
||||
The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things. We do not run the entirety of our testing before allowing patches to land on this branch. We do not
|
||||
recommend using this branch unless [you are contributing to Flutter](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md).
|
||||
|
||||
The API documentation for the most recent commit on `master` is staged at: <https://master-api.flutter.dev>
|
||||
|
||||
The Flutter team's plugins and packages are regularly tested against the `master` branch.
|
||||
|
||||
_We are planning to rename this channel to `main` soon; this work is tracked in [flutter#121564](https://github.com/flutter/flutter/issues/121564)._
|
||||
|
||||
### `beta`
|
||||
|
||||
The latest stable release. If you want to be using the latest and greatest, the `beta` branch is the right choice. That's the most recent version of Flutter that we have heavily tested. The beta branch has passed all our public testing, has been verified against test suites for Google products that use Flutter, and has been vetted against [contributed private test suites](https://github.com/flutter/tests).
|
||||
|
||||
We branch from `master` for a new beta release at the beginning of the month, usually the first Wednesday. This includes a branch for Dart, the engine and the framework. These branches are then "stabilized" for the next couple of weeks, meaning we accept [cherrypick](https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process) requests for high impact issues. Once a quarter, the beta branch lives on to become the next stable branch, as detailed below.
|
||||
|
||||
On average it takes about two weeks for a fix to end up in the beta branch after it lands in our repository (in the `master` channel).
|
||||
|
||||
We do not host the API documentation for the current `beta` branch. The documentation for the `stable` branch at <https://api.flutter.dev> is usually correct, but may be missing new features. The documentation for the `master` branch at <https://master-api.flutter.dev> is likely to be more up to date but may mention features that are not yet on the `beta` branch.
|
||||
|
||||
### `stable`
|
||||
|
||||
Roughly speaking, every third `beta` is promoted to `stable`. This is essentially the same as the `beta` branch but with less frequent updates.
|
||||
|
||||
We recommend using this channel for new users and for production app releases.
|
||||
|
||||
In case of high severity, high impact or security issues, we may do a hotfix release for the `stable` channel just like we do for `beta`. This will follow the same [cherrypick](https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process) process.
|
||||
|
||||
The `stable` version of Flutter is the one documented by our API documentation at: <https://api.flutter.dev>
|
||||
|
||||
The Flutter team's plugins and packages are continually tested against the latest `stable` branch.
|
||||
|
||||
|
||||
## How to change channels
|
||||
|
||||
You can see which channel you're on with the following command:
|
||||
|
||||
```
|
||||
$ flutter channel
|
||||
Flutter channels:
|
||||
* stable
|
||||
beta
|
||||
master
|
||||
```
|
||||
|
||||
To switch channels, run `flutter channel [<channel-name>]`, and then run `flutter upgrade` to ensure you're on the latest.
|
||||
|
||||
## Will a particular bug fix be provided in a hotfix release?
|
||||
|
||||
Depending on the severity of the issue, it is possible. Refer to the [cherrypick process](https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process) for details.
|
||||
|
||||
If you really need a particular patch and it's a fix to the flutter/flutter repository, you should feel free to create a Flutter branch yourself on your development machine and cherry-pick the fix you want onto that branch. Flutter is distributed as a `git` repository and all of `git`'s tools are available to you. If you need a particular patch that's from the flutter/engine repository or one of our dependencies (e.g. Dart or Skia), you could build your own engine but it's probably easier to just wait until the next release. On average, the next `beta` release is about two weeks away.
|
||||
|
||||
## See also
|
||||
|
||||
* [[Release process]], which describes the details for how we push builds from channel to channel.
|
||||
* [Cherrypick process](https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process), where we cover how to request an issue for cherrypicking.
|
||||
* [Release notes](https://flutter.dev/docs/development/tools/sdk/release-notes), where we document changes to each version of the stable channel.
|
||||
75
docs/unsorted_wiki/Flutter-engine-operation-in-AOT-Mode.md
Normal file
75
docs/unsorted_wiki/Flutter-engine-operation-in-AOT-Mode.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Overview
|
||||
|
||||
The Flutter Engine in AOT mode requires four artifacts to run any given isolate. These are:
|
||||
|
||||
* **Dart VM Snapshot**
|
||||
* Represents the initial state of the Dart heap shared between isolates.
|
||||
* Helps launch Dart isolates faster.
|
||||
* Does not contain any isolate specific information.
|
||||
* Mostly predefined Dart strings used by the VM
|
||||
* Should live in the data segment.
|
||||
* From the VM's perspective, this just needs to be loaded in memory with READ permissions and does not need WRITE or EXECUTE permissions. Practically this means it should end up in rodata when putting the snapshot in a shared library.
|
||||
* **Dart VM Instructions**
|
||||
* Contains AOT instructions for common routines shared between all Dart isolates in the VM.
|
||||
* This snapshot is typically extremely small and mostly contains stubs.
|
||||
* Must live in the text segment.
|
||||
* **Isolate Snapshot**
|
||||
* Represents the initial state of the Dart heap and includes isolate specific information.
|
||||
* Along with the VM snapshot, helps in faster launches of the specific isolate.
|
||||
* Should live in the data segment.
|
||||
* **Isolate Instructions**
|
||||
* Contains the AOT code that is executed by the Dart isolate.
|
||||
* Must live in the text segment.
|
||||
|
||||
The VM snapshot and instructions can be shared between all isolates. These must be available during the initialization of the Dart VM. The Dart VM is initialized when the first Flutter view initializes an instance of the Flutter shell. The Flutter shell manages thread safe initialization of the Dart VM. Once the Dart VM is initialized, multiple instances of the Flutter view reference the same VM to run their isolates. There can only be one VM running in the process at any given time.
|
||||
|
||||
Given this configuration, launching each root isolate (for a Flutter application) requires two artifacts along with two other artifacts that are shared between all the other isolates.
|
||||
|
||||
Isolates launched by Dart code (e.g., Isolate.spawn) inherit the snapshots of their parents.
|
||||
|
||||
# Snapshot Generation
|
||||
|
||||
These artifacts on all platforms are generated by the same binary on the host. This binary is shipped with Flutter tools and is called `gen_snapshot`. The way these artifacts are packed and referenced on the device differs however.
|
||||
|
||||
## iOS Configuration
|
||||
|
||||
`gen_snapshot` is invoked on the host by Xcode to generate the four binary blobs for each artifact.
|
||||
|
||||
Using the native toolchain in Xcode, these artifacts are compiled into a framework bundle that is packaged into the application. This framework is typically called `App.framework` and is present in the `Frameworks/` folder of the application bundle. The name of the framework is configurable and if the embedder wishes to name it anything other than `App.framework`, the embedder can choose a custom name and specify the same in the `FLTLibraryPath` `Info.plist` key for the main application bundle.
|
||||
|
||||
The Flutter engine, itself in a Framework called `Flutter.framework` will dynamically open the resolved application framework and look for four specific symbols in that library. These symbols are called `kDartVmSnapshotData`, `kDartVmSnapshotInstructions`, `kDartIsolateSnapshotData` and `kDartIsolateSnapshotInstructions`. These refer to the four snapshots mentioned above.
|
||||
|
||||
Once snapshot resolution is finalized, the Flutter engine initializes the VM and launched the isolates.
|
||||
|
||||
This configuration was chosen because the Flutter engine is not able to mark pages as executable at runtime. Packaging the instruction in a binary makes sure all instructions are present in a separate dynamic library. This arrangement helps in isolate of code for a specific Flutter view’s root isolate.
|
||||
|
||||
## Android Configuration
|
||||
|
||||
`gen_snapshot` is invoked by Gradle to generate the four binary blobs for each artifact.
|
||||
|
||||
Gradle actually invokes `flutter build aot` under the hood to generate these artifacts. These binary artifacts are packaged into the APK directly. These artifacts are named `vm_snapshot_data`, `vm_snapshot_instr`, `isolate_snapshot_data` and `isolate_snapshot_instr`. They refer to the four snapshots mentioned above.
|
||||
|
||||
The embedder may choose to put these artifacts in custom locations. In such cases, the embedder must place these artifacts in a directory and specify the location using the following 5 flags:
|
||||
* `aot-snapshot-path`: Path to the directory in the APK assets containing the snapshot.
|
||||
* `vm-snapshot-data`: Path to the VM snapshot in that directory.
|
||||
* `vm-snapshot-instr`: Path to the VM instructions in that directory.
|
||||
* `isolate-snapshot-data`: Path to the isolate snapshot in that directory.
|
||||
* `isolate-snapshot-instr`: Path to the isolate instructions in that directory.
|
||||
|
||||
Once the Flutter engine, itself packaged as a separate dynamic library called `libflutter.so`, resolves the locations of the required artifacts, it maps them in and makes sure the instructions are executable before launching the VM and isolate.
|
||||
|
||||
The tooling on Android does not require the presence of the Android NDK because the engine can mark pages as executable at runtime. If the embedder wishes to package the snapshots into a single dynamic library (and make the configuration look like the one used on iOS), it can do so and specify the library to the engine via the flag `aot-shared-library-path`. A native toolchain is necessary on the host to achieve this.
|
||||
|
||||
# Notes
|
||||
|
||||
`gen_snapshot` can only generate AOT instructions for a specific architecture. For example, generating AOT instructions for `armv7`, `aarch64`, `i386` and `x86-64` requires four different `gen_snapshot` variants.
|
||||
|
||||
The VM and isolate snapshot data is specific to the `gen_snapshot` variant used and must also be generated along with the AOT instructions. Embedders may not mix and match the AOT instructions and data snapshots from different `gen_snapshot` variants. All four artifacts must typically be generated at the same time.
|
||||
|
||||
Using the current Flutter tools, only an `i386` `gen_snapshot` on the host can generate `armv7` AOT instructions and an `x86-64` `gen_snapshot` on the host can generate `aarch64` instructions. The mac builds take advantage of this quirk and `lipo` the two `gen_snapshot` variants and select the executable architecture correctly when generating AOT instructions for the target architecture. This can be inspected with the `lipo` tool on the host while analyzing the `gen_snapshot` binary. In reality, the word sizes of `gen_snapshot` on host and the engine running on the target must match. Theoretically, an `armv7` `gen_snapshot` running on a Raspberry Pi host could generate an AOT snapshot for `armv7` target. The tools don’t ship this configuration however.
|
||||
|
||||
Packaging multiple Flutter AOT application in the same application bundle will currently result in redundant copies of the VM data and instructions. However, these buffers are extremely small.
|
||||
|
||||
Flags to the Flutter engine are typically specified when the platform launches the underlying Flutter shell (platform agnostic way of interacting with the innards of the Flutter engine). This happens in `FlutterViewController` on iOS and `FlutterNativeView` in Java on Android.
|
||||
|
||||
To list all the flags currently supported by the Flutter engine, embedders may locate the `flutter_tester` binary in the tools distribution and pass the `--help` flag to the same. All currently supported flags along with a short help blob will be dumped to the console.
|
||||
63
docs/unsorted_wiki/Flutter-migrate.md
Normal file
63
docs/unsorted_wiki/Flutter-migrate.md
Normal file
@@ -0,0 +1,63 @@
|
||||
_This refers to a [project](https://github.com/flutter/packages/tree/main/packages/flutter_migrate) that is incomplete and is not currently maintained._
|
||||
|
||||
# Flutter migrate tool
|
||||
|
||||
Flutter projects that were created with old versions of flutter tend to slowly become outdated and sometimes do not have access to new flutter features.
|
||||
|
||||
The `flutter_migrate` tool is a set of commands that helps you migrate legacy flutter projects to modern flutter project templates. This process will typically update your dependencies, add access to new flutter features, and improve resilience and robustness against future updates.
|
||||
|
||||
Flutter migrate works best for small to medium sized projects that are primarily implemented in flutter/dart.
|
||||
|
||||
The flutter migrate tool will generate a staging directory where you will be able to preview changes and resolve any conflicts before committing the changes to your project.
|
||||
|
||||
## Prepare your project for migration
|
||||
|
||||
Before running the migrate tool, your project must be set up as a git repository and have no uncommitted changes. This is to ensure that the migration will always be able to be rolled back if needed. The migrate tool itself also requires git to function.
|
||||
|
||||
## Start the migration
|
||||
|
||||
To start the migration process, enter the root directory of your flutter project and run:
|
||||
|
||||
$ flutter migrate start
|
||||
|
||||
It is normal for this command to take a while to run. A staging directory called `migrate_staging_directory` will be created in your flutter project where the suggested changes are located. The staged files are the migrated and merged versions. For some projects, there may be merge conflicts between flutter-generated code changes and your own changes.
|
||||
|
||||
To view the status of your current started migration, run:
|
||||
|
||||
$ flutter migrate status
|
||||
|
||||
This will display an overview of the diffs, files changed, added, and deleted, as well as any files with merge conflicts.
|
||||
|
||||
## Resolve conflicts
|
||||
|
||||
Any merge conflicts must be resolved before applying the migration. The status command will list the discovered conflicts in the staging directory. These conflicts should either be fixed manually in the staging directory by directly modifying the staged files or optionally resolved using the resolve-conflicts wizard if one of the versions should be accepted without changes.
|
||||
|
||||
The resolve-conflicts wizard helps process routine merge conflicts quickly. Many projects will find that user changes to files like AndroidManifest.xml will be caught as a conflict. In most cases, it is desired to just keep your manual changes instead of reverting to the default template manifest. The wizard can help quickly resolve these types of conflict. Run the resolve-conflicts wizard with:
|
||||
|
||||
$ flutter migrate resolve-conflicts
|
||||
|
||||
The wizard will display each conflict and present the option to accept the new template version, keep the existing version, or skip the conflict and resolve it manually later. After each file, the wizard will ask to commit the changes or not.
|
||||
|
||||
## Apply the migration
|
||||
|
||||
When all conflicts are resolved and the changes are to your liking, the migration should be applied to the project. The contents of the staging directory will be moved into the project itself, overwriting the existing files. To apply, run:
|
||||
|
||||
|
||||
$ flutter migrate apply
|
||||
|
||||
After applying the migration, all changes can be handled via git commands. It is recommended to now build your app for all your target platforms to ensure the migration was successful. Although the migration tool typically produces working apps, it is possible in complex projects for errors to occur when merging or resolving conflicts. If the project is left in a broken state, it is easy to undo the migration by running:
|
||||
|
||||
$ git reset --hard HEAD
|
||||
|
||||
Newly added files can be removed with:
|
||||
|
||||
$ git clean -n (preview untracked files to be cleaned)
|
||||
$ git clean -f (delete untracked files)
|
||||
|
||||
## Aborting a staged migration
|
||||
|
||||
If the staged migration is no longer desired, you can abort the migration by running:
|
||||
|
||||
$ flutter migrate abort
|
||||
|
||||
This will delete the staging directory and your project will be left untouched.
|
||||
37
docs/unsorted_wiki/Game-development-with-Flutter.md
Normal file
37
docs/unsorted_wiki/Game-development-with-Flutter.md
Normal file
@@ -0,0 +1,37 @@
|
||||
A loose catalog of resources for casual game development with Flutter.
|
||||
|
||||
## Game engines and tools
|
||||
|
||||
- [Flame Engine (2D game engine)](https://flame-engine.org/)
|
||||
- [Bonfire (RPG games)](https://pub.dev/packages/bonfire)
|
||||
- [SpriteWidget](https://github.com/spritewidget/spritewidget)
|
||||
- [Flutter Processing](https://github.com/matthew-carroll/flutter_processing)
|
||||
- [Rive (animation designer)](https://rive.app/)
|
||||
- [StageXl (Dart+Web, but not Flutter)](http://www.stagexl.org/)
|
||||
|
||||
## Games built with Flutter / developer experiences
|
||||
- [4 Pics 1 Word](https://play.google.com/store/apps/details?id=de.lotum.whatsinthefoto.us)
|
||||
- [Tomb Toad](http://www.missionctrlgames.com/) | [tweet](https://twitter.com/missionctrlgame/status/1329149448971280385)
|
||||
- [Flame Game Jam entries](https://itch.io/jam/1st-flame-game-jam/entries)
|
||||
- [A list of Flutter games built on top of Flame](https://flame-engine-store.web.app/#/)
|
||||
- [Porting an iOS game to Flutter](https://twitter.com/drcoderz/status/1458449373424062474)
|
||||
- [Space Empire](https://github.com/SatyamX64/space_empires)
|
||||
- [Sunnyplace](https://play.google.com/store/apps/details?id=br.com.sunnyplace)
|
||||
- [Tap Hero](https://github.com/mkiisoft/taphero)
|
||||
- [Pop, Pop, Win!](https://dart-lang.github.io/sample-pop_pop_win/) (Mine Sweeper w/ balloons and darts) – OG Dart+Web game w/ StageXL (not Flutter)
|
||||
- [Flutter Slide Puzzle](https://flutter.github.io/samples/web/slide_puzzle/) - Created for original Flutter web launch
|
||||
- [Community-submitted games](https://flutterawesome.com/tag/games/)
|
||||
- [Flutter Backgammon](https://github.com/csells/fibscli)
|
||||
|
||||
## Tutorials
|
||||
- [Building a snake game with Flutter](https://www.raywenderlich.com/19430602-how-to-create-a-2d-snake-game-in-flutter)
|
||||
- [Flappy Bird with Flutter Processing](https://www.youtube.com/watch?v=l2LO_pBEP5Y)
|
||||
- [Create a game with Flame Engine](https://blog.devowl.de/flutter-flame-step-1-create-your-game-b3b6ee387d77)
|
||||
- [Flutter games from scratch](https://www.youtube.com/playlist?list=PLlvRDpXh1Se6kipeBLiF1xByAEmxYie6J)
|
||||
|
||||
## Communities
|
||||
- [FlameCon](https://www.meetup.com/FlameCon/)
|
||||
|
||||
## Other useful resources
|
||||
- [Monetization](https://flutter.dev/ads)
|
||||
- [Firebase (auth, storage, hosting, testing, analytics, cloud functions)](https://firebase.flutter.dev/docs/overview)
|
||||
59
docs/unsorted_wiki/GitHub-Action-Workflows.md
Normal file
59
docs/unsorted_wiki/GitHub-Action-Workflows.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# GitHub actions at Flutter
|
||||
|
||||
Action workflows can be enabled by writing a yaml file inside .github/workflows
|
||||
folder of a given repository. These workflows run arbitrary code from GitHub
|
||||
repositories and with read/write permissions in the repository assets. This can
|
||||
be dangerous as anyone with write permissions to the repository can enable
|
||||
workflows using malicious code. To mitigate this only workflows with pinned
|
||||
commits within an allowed list can be executed.
|
||||
|
||||
Flutter repositories have workflows enabled with readonly ACLs by default. The
|
||||
ACLs can be overwritten providing specific permissions in the configuration
|
||||
file.
|
||||
|
||||
Determining whether a given workflow is secure or not goes well beyond flutter's
|
||||
capacity and it is the responsibility of the person enabling the workflow to
|
||||
diligently check the workflow for any potential security issues.
|
||||
|
||||
## Adding a new GitHub Actions workflow
|
||||
|
||||
To add a new workflow please open a new bug using the [ticket queue process](https://github.com/flutter/flutter/wiki/Infra-Ticket-Queue). The following data points are required:
|
||||
|
||||
* Description/reason to enable this workflow
|
||||
* workflow repository
|
||||
* pinned commit
|
||||
|
||||
## Updating a GitHub Actions workflow
|
||||
|
||||
To update an existing workflow please open a new bug using the [ticket queue process](https://github.com/flutter/flutter/wiki/Infra-Ticket-Queue). The following data points are required:
|
||||
|
||||
* Description/reason to update the pinned version
|
||||
* workflow/old_pinned_version
|
||||
* workflow/new_pinned_version
|
||||
|
||||
## flutter/engine and flutter/flutter
|
||||
|
||||
***flutter/engine*** please do not add any action workflows to this repository.
|
||||
The preferred way of building and testing is to use LUCI. This allows to plan
|
||||
for scalability, security and maintainability.
|
||||
|
||||
***flutter/flutter*** the main use of workflows in this repo is to process bugs,
|
||||
projects, etc. Please do not use action workflows to build, run tests or release
|
||||
artifacts.
|
||||
|
||||
## Checklist
|
||||
|
||||
New workflow:
|
||||
|
||||
* Does it have an associated bug?
|
||||
* Was the workflow/commit added to the allow list? Is the workflow pinned to a
|
||||
given commit?
|
||||
* If the workflow require write access, is it overriding the ACLs explicitly?
|
||||
* If the target repository has branch protection, is the configuration using
|
||||
***secrets.FLUTTERGITHUBBOT_TOKEN*** instead of the default one?
|
||||
* Is the workflow configured to not run on forks?
|
||||
|
||||
Update workflow:
|
||||
|
||||
* Does it have an associated bug?
|
||||
* Was the workflow with old and new commits added to the allowed list?
|
||||
39
docs/unsorted_wiki/Glossary.md
Normal file
39
docs/unsorted_wiki/Glossary.md
Normal file
@@ -0,0 +1,39 @@
|
||||
Here are some terms that we use in the Flutter project and what they mean:
|
||||
|
||||
<!-- Please keep this alphabetical. -->
|
||||
|
||||
- **Cold restart**. Quitting and restarting an application and its associated runtime. This contrasts with hot restart, where the process and/or runtime would not be terminated.
|
||||
|
||||
- **Dynamic extension loading**. The ability to download some Dart code that wasn't written when the app was first published, which adds a new feature to the app. This could be done on the fly. It may require the core app to be larger since we can't know ahead of time what is needed by each future extension, and therefore can't do tree shaking (whole program optimization).
|
||||
|
||||
- **Dynamic patching**. The ability to update the Dart code of an app in the field by downloading a patch (of sorts) and providing it to the Dart VM, probably requiring a restart of the application.
|
||||
|
||||
- **Embedder**. The core of the Flutter engine is platform agnostic. But platforms that run Flutter applications need platform specific logic to wire up rendering to the native window toolkit, handle input events, etc.. This platform specific logic is referred to as the Flutter embedder. Embedders interact with the engine using a [very low level C/C++ API](https://github.com/flutter/engine/blob/043d92c48abdebdad926569bc204a59c5cf20a11/shell/platform/embedder/embedder.h). While this API exposed by the engine to its embedders is platform agnostic, it is usually not suitable for developers used to the tools, frameworks and libraries on that specific platform (UIKit using Objective-C/Swift on iOS, or, Android APIs using Java on Android). To make interacting with the engine more ergonomic to developers on a specific platform, there are platform specific embedding APIs ([iOS](https://docs.flutter.io/objcdoc/) and [Android](https://docs.flutter.io/javadoc/)). These APIs provide higher level abstractions but are optional.
|
||||
|
||||
- **Embedding**. Flutter provides "embedders" to port Flutter behavior to specific platforms, as defined elsewhere in this glossary. However, embedders use a [very low level C/C++ API](https://github.com/flutter/engine/blob/043d92c48abdebdad926569bc204a59c5cf20a11/shell/platform/embedder/embedder.h) which would feel unnatural to typical developers of a platform, e.g., Android or iOS. A Flutter "embedding" is a counterpart to an "embedder", which introduces common platform tools for interacting with Flutter. The Android embedding offers a `FlutterActivity`, `FlutterFragment`, `FlutterView`, etc: [Android embedding](https://docs.flutter.io/javadoc/). The iOS embedding offers a `FlutterViewController`, etc: [iOS embedding](https://docs.flutter.io/objcdoc/). An embedding + an embedder signifies the entire story of how Flutter ports to a specific platform.
|
||||
|
||||
- **Engine**. The C++ (and Java and ObjectiveC and...) side of Flutter. Defined in the `engine` repository. Includes Skia, Dart, and other low-level components. Exposed as `dart:ui` and other Dart libraries to author code.
|
||||
|
||||
- **Flakiness**. The tendency of a test to occasionally claim that it has passed even though it is really a failing test. Usually caused by race conditions. Please treat flaky tests as failures; attempt to find the cause and fix it.
|
||||
|
||||
- **Framework**. The `flutter` library (`packages/flutter` in the main repository) that includes the bulk of the Dart classes exposed by Flutter, such as all the built-in widgets.
|
||||
|
||||
- **Hot reload**. During development, causing a running application to update with new logic, without losing any of its state. This contrasts with hot restart because state is maintained despite the code being updated. We consider hot reload to be "hot" if it's subsecond in the normal case, significantly so in favourable conditions (e.g. fast devices, changing a small part of an application's UI).
|
||||
|
||||
- **Hot restart**. During development, causing a running application to rerun from the beginning, using new logic, and with all state reset to initial conditions. This contrasts with a cold restart because it does not require the application to shut down, and contrasts with a hot reload because state is lost in the process. We consider hot restart to be "hot" if it's under four seconds in the normal case.
|
||||
|
||||
- **Landing**. The act of merging a PR into a branch (typically the main trunk, sometimes called "master") of a repository.
|
||||
|
||||
- **Modular application delivery**. The ability to package a single app into multiple separate archives when compiling it, and download them independently as needed.
|
||||
|
||||
- **NTE**. "Needs-Tests Exemption". Indicates that a PR does not need tests, typically because the PR is refactoring code without changing the semantics of the code, or because it actually does have tests but the automated systems didn't recognize them. A test exemption consists of a comment on the PR that has a line that starts with the string `test-exempt: ` followed by an explanation of why, from someone who is allowed to give test exemptions. A bot will add a comment to a PR if a test exemption is required. See [[Tree Hygiene]] for instructions on getting test exemptions.
|
||||
|
||||
- **Out-of-band (OOB) failure**. A test failure in our CI that is caused by some change external to the repository, not the failing commit (or flake). For instance, an infrastructure change or a change to an external server used by tests could cause an out-of-band failure. In general, CI should minimize the possibility of out-of-band failures by being as hermetic as possible.
|
||||
|
||||
- **PR**. A _Pull Request_, a code or documentation contribution on GitHub. PRs are _landed_ once they have been reviewed.
|
||||
|
||||
- **Roll**. The act of updating a dependency ("rolling skia", "rolling the engine"), typically by updating a commit hash in a configuration file. A roll is typically created as a PR that is then landed. Automatically rolling dependencies is preferred over manual rolling.
|
||||
|
||||
- **Skia**. The graphics library used by Flutter.
|
||||
|
||||
- **Tool**. The `flutter` program (started from `bin/flutter` on Unix systems, `bin/flutter.bat` on Windows) that developers use to drive their work when using Flutter.
|
||||
39
docs/unsorted_wiki/Home.md
Normal file
39
docs/unsorted_wiki/Home.md
Normal file
@@ -0,0 +1,39 @@
|
||||
This wiki is primarily aimed at engineers building or making contributions to Flutter.
|
||||
|
||||
If you are new to Flutter, then you will find more general information on the Flutter project, including tutorials and samples, on our Web site at [flutter.dev](https://flutter.dev). For specific information about Flutter's APIs, consider our API reference which can be found at the [api.flutter.dev](https://api.flutter.dev/).
|
||||
|
||||
If you want to know what we're likely to do in the future, our [[roadmap]] may be of interest.
|
||||
|
||||
If you intend to contribute to Flutter, welcome! You are encouraged to start with [our contributor guide](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md), which helps onboard new team members. It points to the most relevant pages on this wiki. You are also invited to join our [Discord](https://github.com/flutter/flutter/wiki/Chat) server.
|
||||
|
||||
## Search
|
||||
|
||||
[Search this wiki on Google](https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fgithub.com%2Fflutter%2Fflutter%2Fwiki%2F).
|
||||
|
||||
## Index of notable sections
|
||||
|
||||
* [Actionable bugs](https://github.com/flutter/flutter/wiki/Triage#what-makes-an-issue-actionable), and the closing of unactionable bugs
|
||||
* [Breaking changes](https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes)
|
||||
* [Cherrypick process](https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process)
|
||||
* [Closing issues](https://github.com/flutter/flutter/wiki/Issue-hygiene#closing-issues)
|
||||
* [[Dashboards]]
|
||||
* [Debugging a broken engine autoroll](https://github.com/flutter/flutter/wiki/Debugging-the-engine#bisecting-a-roll-failure)
|
||||
* [Deprecations](https://github.com/flutter/flutter/wiki/Tree-hygiene#deprecations)
|
||||
* [[Design documents]]
|
||||
* [Discord](https://github.com/flutter/flutter/wiki/Chat)
|
||||
* [Engineering Philosophy](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#philosophy)
|
||||
* [Flaky tests](https://github.com/flutter/flutter/wiki/Issue-hygiene#flaky-tests)
|
||||
* [[flutter.dev is down|In case of emergency]]
|
||||
* [Issue prioritization](https://github.com/flutter/flutter/wiki/Issue-hygiene#priorities)
|
||||
* [Labels](https://github.com/flutter/flutter/wiki/Issue-hygiene#labels)
|
||||
* [Milestones](https://github.com/flutter/flutter/wiki/Issue-hygiene#milestones)
|
||||
* [Plugin compatibility policy](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#plugin-compatibility)
|
||||
* [Reviewing code](https://github.com/flutter/flutter/wiki/Tree-hygiene#how-to-review-code)
|
||||
* [RFC process](https://github.com/flutter/flutter/wiki/Issue-hygiene#how-to-propose-a-specific-change)
|
||||
* [Status of popular issues](https://github.com/flutter/flutter/wiki/Popular-issues)
|
||||
* [Submitting code, process for](https://github.com/flutter/flutter/wiki/Tree-hygiene#overview)
|
||||
* [Support levels, definitions of](https://github.com/flutter/flutter/wiki/Values#support)
|
||||
* [Symbolicating stack traces](https://github.com/flutter/flutter/wiki/Crashes)
|
||||
* [Threading in the Engine](https://github.com/flutter/flutter/wiki/The-Engine-architecture#threading)
|
||||
* [When will my bug be fixed?](https://github.com/flutter/flutter/wiki/Issue-hygiene#when-will-my-bug-be-fixed)
|
||||
* [Security best practices](https://github.com/flutter/flutter/wiki/security#Best-practices)
|
||||
39
docs/unsorted_wiki/Hotfix-Documentation-Best-Practices.md
Normal file
39
docs/unsorted_wiki/Hotfix-Documentation-Best-Practices.md
Normal file
@@ -0,0 +1,39 @@
|
||||
Production customers care a lot about hotfixes, since they may address issues that fix crashes on specific devices or platforms. We want customers to adopt hotfix releases quickly, and it’s therefore important that they understand what’s in them and what risks they may accept by adopting them.
|
||||
|
||||
As a result, it’s important that Flutter customers can quickly scan through our hotfixes and identify whether they’re relevant to them. We can do that by making sure that each hotfix is described carefully.
|
||||
|
||||
Our goal is that each hotfix summary:
|
||||
|
||||
1. Should be clear to a non-contributor who is developing with Flutter
|
||||
2. Should be succinct (one line) for ease of scanning
|
||||
3. Within above, should identify as best as possible:
|
||||
- What the scenario is (describe the problem)
|
||||
- What platforms it affects
|
||||
- In what context it may occur
|
||||
- How likely it is to occur
|
||||
|
||||
The goal is not to exhaustively document the issue, but to provide enough information that an educated user can quickly scan and determine whether they need to read through the bug itself to understand its applicability to their scenario.
|
||||
|
||||
A good approach for hotfix messages is to describe the problem in terms of the current state prior to the fix. For example:
|
||||
|
||||
> **“When $scenario [on $platform], $problem_description”**
|
||||
|
||||
Some good existing examples of hotfix messages that adopt this kind of formula:
|
||||
|
||||
- [flutter/90783](https://github.com/flutter/flutter/issues/90783): In rare circumstances, engine may crash during app termination on iOS and macOS
|
||||
- [flutter/77251](https://github.com/flutter/flutter/issues/77251): Flutter may show multiple snackbars when Scaffold is nested
|
||||
- [flutter/98155](https://github.com/flutter/flutter/issues/98155): App crashes after upgrading to 2.10.x using webview + video_player plugin
|
||||
|
||||
Some harmless examples that are harder for customers to consume:
|
||||
|
||||
- [flutter/97679](https://github.com/flutter/flutter/issues/97679): Don't remove overlay views when the rasterizer is being torn down.
|
||||
<br> _Problem_: It's unclear how this affects customer apps and in which contexts
|
||||
<br> _Perhaps better_: “App may crash when navigating away from embedded native platform content”
|
||||
|
||||
- [flutter/95711](https://github.com/flutter/flutter/issues/95711): Linux builds default to building GLFW.
|
||||
<br> _Problem_: Unclear why this is a problem or how this impacts customers
|
||||
<br> _Perhaps better_: “On Linux, dependency on X11 breaks Wayland and embedded builds”
|
||||
|
||||
- [flutter/97086](https://github.com/flutter/flutter/issues/97086): Windows: Fail to launch app in debug mode
|
||||
<br> _Problem_: While this explains the platform and scenario, it doesn’t mention the specific regression
|
||||
<br> _Perhaps better_: “Flutter apps fail to launch in debug mode when compiled with Visual Studio 17.1.0”
|
||||
689
docs/unsorted_wiki/Hotfixes-to-the-Stable-Channel.md
Normal file
689
docs/unsorted_wiki/Hotfixes-to-the-Stable-Channel.md
Normal file
@@ -0,0 +1,689 @@
|
||||
In general, our philosophy is to update the `stable` channel on a quarterly basis with feature updates. In the intervening period, occasionally we may decide a bug or regression warrants a hotfix. We tend to be extremely conservative with these hotfixes, since there's always a risk that fixing one bug introduces a new one, and we want the `stable` channel to always represent our most tested builds.
|
||||
|
||||
We intend to announce hotfixes to the [flutter-announce](https://groups.google.com/forum/#!forum/flutter-announce) group, and we recommend that you subscribe to that list if you publish an application using Flutter.
|
||||
|
||||
Note that we only hotfix the latest version -- if you see bugs on older versions of the `stable` channel, please consider moving to the latest `stable` channel version.
|
||||
|
||||
To ensure that you have the latest stable version with the hotfixes listed below, use the flutter tool at the command line as follows:
|
||||
|
||||
```
|
||||
$ flutter channel stable
|
||||
$ flutter upgrade
|
||||
```
|
||||
|
||||
<!--
|
||||
INTERNAL NOTE: PLEASE DON'T JUST PASTE ISSUE TITLES!
|
||||
|
||||
Make sure that the text here helps customers understand
|
||||
whether they are likely to be affected by the issue,
|
||||
without them needing to read each issue individually.
|
||||
Our goal is to make the list easy for them to scan.
|
||||
|
||||
More information and tips:
|
||||
https://github.com/flutter/flutter/wiki/Hotfix-Documentation-Best-Practices
|
||||
|
||||
INTERNAL NOTE
|
||||
-->
|
||||
## Flutter 3.22 Changes
|
||||
|
||||
### [3.22.0](https://github.com/flutter/flutter/releases/tag/3.22.0) (May 14, 2024)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 3.19 Changes
|
||||
|
||||
### [3.19.6](https://github.com/flutter/flutter/releases/tag/3.19.6) (April 17, 2024)
|
||||
* [dart/55430](https://github.com/dart-lang/sdk/issues/55430) - Fixes an issue with JS interop in dart2wasm where JS interop methods that used the enclosing library‘s @JS annotation were actually using the invocation’s enclosing library's @JS annotation.
|
||||
* [flutter/145563](https://github.com/flutter/flutter/issues/145563) - Fixes severe performance regression on Firefox in v. 3.19.
|
||||
* [flutter/144439](https://github.com/flutter/flutter/issues/144439) - Removes the --enable-impeller run flag and FLTEnableImpeller plist key on iOS.
|
||||
|
||||
### [3.19.5](https://github.com/flutter/flutter/releases/tag/3.19.5) (March 28, 2024)
|
||||
* [dart/55211](https://github.com/dart-lang/sdk/issues/55211) - Fixes an issue where dart vm crashed when running on pre-SSE41 older CPUs on Windows.
|
||||
|
||||
### [3.19.4](https://github.com/flutter/flutter/releases/tag/3.19.4) (March 21, 2024)
|
||||
* [flutter/144211](https://github.com/flutter/flutter/issues/144211) - Reverts a clipping optimization that is broken when multiple clips are applied with a backdrop filter.
|
||||
* [flutter/144213](https://github.com/flutter/flutter/issues/144213) - Fix flickering of gaussian blurs in scrolling containers.
|
||||
* [dart/55158](https://github.com/dart-lang/sdk/issues/55158) - Fixes an exception when executing hot reload after making compilation-successful changes.
|
||||
* [dart/55194](https://github.com/dart-lang/sdk/issues/55194) - Fix crashes on web platforms that contains an extension type declaration where the extension type constructor invokes a redirecting factory in its initializer.
|
||||
* [dart/55184](https://github.com/dart-lang/sdk/issues/55184) - Fix issues where it is unable to run commit queue and post-submit testing on beta and stable when Goma is shut down.
|
||||
* [dart/55240](https://github.com/dart-lang/sdk/issues/55240) - Fix DateTime.timeZoneName on Windows.
|
||||
|
||||
### [3.19.3](https://github.com/flutter/flutter/releases/tag/3.16.3) (March 07, 2024)
|
||||
* [flutter/144565](https://github.com/flutter/flutter/issues/144565) - Fixes a tool crash when attempting to render a frame with raster stats on an application with the Impeller backend.
|
||||
* [dart/55057](https://github.com/dart-lang/sdk/issues/55057) - Fixes an issue in dart2js where object literal constructors in interop extension types would fail to compile without an `@JS` annotation on the library.
|
||||
* [dart/55095](https://github.com/dart-lang/sdk/issues/55095) - Disallows certain types involving extension types from being used as the operand of an `await` expression, unless the extension type itself implements`Future`.
|
||||
|
||||
### [3.19.2](https://github.com/flutter/flutter/releases/tag/3.19.2) (February 28, 2024)
|
||||
* [flutter/143886](https://github.com/flutter/flutter/issues/143886) - Fixes a parsing issue that caused the Flutter tool to crash in some circumstances.
|
||||
|
||||
### [3.19.1](https://github.com/flutter/flutter/releases/tag/3.19.1) (February 21, 2024)
|
||||
* [flutter/143574](https://github.com/flutter/flutter/issues/143574) - Fixes an issue in Flutter web builds that disallowed the use of`--flavor` while launching.
|
||||
|
||||
## Flutter 3.16 Changes
|
||||
|
||||
### [3.16.9](https://github.com/flutter/flutter/releases/tag/3.16.9) (January 25, 2024)
|
||||
* [dart/54699](https://github.com/dart-lang/sdk/issues/54699) - Fix an issue that causes Flutter apps to freeze when breakpoints are added to multiple isolates at the same time and an issue that causes Flutter apps to crash during hot reload.
|
||||
|
||||
### [3.16.8](https://github.com/flutter/flutter/releases/tag/3.16.8) (January 17, 2024)
|
||||
* [dart/54494](https://github.com/dart-lang/sdk/issues/54494) - Fix Dart2js stack overflow in value range analysis.
|
||||
|
||||
### [3.16.7](https://github.com/flutter/flutter/releases/tag/3.16.7) (January 11, 2024)
|
||||
* [dart/54427](https://github.com/dart-lang/sdk/issues/54427) - Upgrades Dart DevTools to version 2.28.5.
|
||||
* [dart/54428](https://github.com/dart-lang/sdk/issues/54428) - Fixes an issue with serving static DevTools assets.
|
||||
|
||||
### [3.16.6](https://github.com/flutter/flutter/releases/tag/3.16.6) (January 10, 2024)
|
||||
* [flutter/141017](https://github.com/flutter/flutter/issues/141017) - Migrates event sent with every command for analytics.
|
||||
* [flutter/136060](https://github.com/flutter/flutter/issues/136060) - Fixes Xcode 15 crashes EXC_BAD_ACCESS when using the Networking framework.
|
||||
* [flutter/140416](https://github.com/flutter/flutter/issues/140416) - Fixes PathNotFoundException deleting temp dir in IOSCoreDeviceControl._listCoreDevices.
|
||||
* [dartlang/webdev/2297](https://github.com/dart-lang/webdev/issues/2297) - Fixes DWDS error when debugging on web.
|
||||
|
||||
### [3.16.5](https://github.com/flutter/flutter/releases/tag/3.16.5) (December 20, 2023)
|
||||
* [flutter/138711](https://github.com/flutter/flutter/issues/138711) - Fixes AvailabilityVersionCheck failure on iOS
|
||||
* [flutter/139571](https://github.com/flutter/flutter/issues/139571) - Fixes AnimatedOpacity affecting blended color overlay render
|
||||
* [flutter/139294](https://github.com/flutter/flutter/issues/139294) - Fixes ImageFiltered flickers when widget is rendered on top
|
||||
* [flutter/138193](https://github.com/flutter/flutter/issues/138193) - Fixes testMultiplePlatformViewsWithOverlays test on MacOS
|
||||
|
||||
### [3.16.4](https://github.com/flutter/flutter/releases/tag/3.16.4) (December 13, 2023)
|
||||
* [flutter/139180](https://github.com/flutter/flutter/issues/139180) - Fix tool crash on flutter create when unable to run Java.
|
||||
* [flutter/138434](https://github.com/flutter/flutter/issues/138434) - Fix tool crash on deleting directories that do not exist
|
||||
* [flutter/135277](https://github.com/flutter/flutter/issues/135277) - Eliminates an excessive amount of Xcode error/warning output to the console when building or running macOS Flutter apps.
|
||||
|
||||
### [3.16.3](https://github.com/flutter/flutter/releases/tag/3.16.3) (December 5, 2023)
|
||||
* [CVE-2023-6345](https://nvd.nist.gov/vuln/detail/CVE-2023-6345) - Skia fix for possible integer overflow on Canvas calls with user generated data
|
||||
* [flutter/138550](https://github.com/flutter/flutter/issues/138550) - Fixes crash on iPad when selection "Share..." from selection controls.
|
||||
* [flutter/138842](https://github.com/flutter/flutter/issues/138842) - Fix rendering bug with elevation 0 material components.
|
||||
* [flutter/138850](https://github.com/flutter/flutter/issues/138850) - Add ability to customize NavigationBar indicator overlay and fixes a bug with the indicator shape.
|
||||
* [dart/53086](https://github.com/dart-lang/sdk/issues/53086) - DDS fix to ensure threadID integers are serialized correctly by Debug Adapter Protocol (DAP) clients.
|
||||
* [dart/53999](https://github.com/dart-lang/sdk/issues/53999) - Adjusts the nullablity computations in the implementation of the upper bound algorithm in the CFE
|
||||
* [dart/54112](https://github.com/dart-lang/sdk/issues/54112) - Fixes missing closure code completion entries for function parameters for LSP-based editors like VS Code.
|
||||
|
||||
### [3.16.2](https://github.com/flutter/flutter/releases/tag/3.16.2) (November 30, 2023)
|
||||
* [flutter/138535](https://github.com/flutter/flutter/issues/138535) - Fixes android execution failed for task ':app:mergeDebugNativeLibs'.
|
||||
* [flutter/138598](https://github.com/flutter/flutter/issues/138598) - Fixes SVG rendering issue on IOS.
|
||||
|
||||
### [3.16.1](https://github.com/flutter/flutter/releases/tag/3.16.1) (November 27, 2023)
|
||||
* [flutter/138030](https://github.com/flutter/flutter/issues/138030) - Fixes file deletion crash which can occur during iOS archive.
|
||||
* [flutter/134716](https://github.com/flutter/flutter/issues/134716) - Fix iOS 17 keyboard freeze when switching languages
|
||||
* [flutter/138180](https://github.com/flutter/flutter/issues/138180) - Prevents a crash in flutter doctor for macOS users who have an IntelliJ or Android Studio installation with a missing CFBundleIdentifier in its plist.
|
||||
* [flutter/138040](https://github.com/flutter/flutter/issues/138040) - Ignore exceptions in Flutter tool when trying to set the echo mode of the terminal when the STDIN pipe has been broken.
|
||||
* [flutter/124145](https://github.com/flutter/flutter/issues/124145) - Fixes a JSON array parsing bug that causes seg fault when --coverage is used
|
||||
|
||||
### [3.16.0](https://github.com/flutter/flutter/releases/tag/3.16.0) (Nov 15, 2023)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 3.13 Changes
|
||||
|
||||
### [3.13.9](https://github.com/flutter/flutter/releases/tag/3.13.9) (October 25, 2023)
|
||||
* [dart/53784](https://github.com/dart-lang/sdk/issues/53784) - [dart2js] Fixes compatibility with Node.js 21
|
||||
|
||||
### [3.13.8](https://github.com/flutter/flutter/releases/tag/3.13.8) (October 18, 2023)
|
||||
* [dart/53747](https://github.com/dart-lang/sdk/issues/53747) - Fixes a visual issue in the Dart VM preventing users from seeing variable values when debugging.
|
||||
* [flutter/136552](https://github.com/flutter/flutter/issues/136552) - [iOS] Fixes issues with voice over when visiting a PlatformView in iOS applications.
|
||||
* [flutter/136654](https://github.com/flutter/flutter/issues/136654) - [Android] Fixes rendering issues when using PlatformViews in Android applications on high refresh rate phones.
|
||||
|
||||
### [3.13.7](https://github.com/flutter/flutter/releases/tag/3.13.7) (October 11, 2023)
|
||||
* [flutter/135442](https://github.com/flutter/flutter/issues/135442) - Fix Xcode 15 launch failure with iOS 17
|
||||
|
||||
### [3.13.6](https://github.com/flutter/flutter/releases/tag/3.13.6) (September 27, 2023)
|
||||
* [flutter/133013](https://github.com/flutter/flutter/issues/133013) - [Impeller] Fix issues with PNG decompression
|
||||
* [flutter/132838](https://github.com/flutter/flutter/issues/132838) - Fix clip Imagefilter.blur on iOS
|
||||
* [dart/53579](https://github.com/dart-lang/sdk/issues/53579) - Fixes a compiler crash when using @staticInterop or @anonymous factory constructors with type parameters.
|
||||
* [dart/53503](https://github.com/dart-lang/sdk/issues/53503) - Fixes segmentation faults that terminate processes when encountering handled exceptions in the FFI library.
|
||||
* [dart/53541](https://github.com/dart-lang/sdk/issues/53541) - Fixes slow variable access while debugging Flutter applications.
|
||||
|
||||
### [3.13.5](https://github.com/flutter/flutter/releases/tag/3.13.5) (September 20, 2023)
|
||||
* [flutter/134825](https://github.com/flutter/flutter/issues/134825) - Fixes an issue where apps built in profile mode would not install or run on physical iOS 17 devices.
|
||||
* [flutter/45598](https://github.com/flutter/engine/pull/45598) - Fix permissions on macos artifacts making mac framework readable and executable by all
|
||||
|
||||
### [3.13.4](https://github.com/flutter/flutter/releases/tag/3.13.4) (September 13, 2023)
|
||||
* [dart/53449](https://github.com/dart-lang/sdk/issues/53449) - Fixes a dart2js issue causing a compiler crash when using a typed record pattern outside of the scope of a function body.
|
||||
* [dart/53450](https://github.com/dart-lang/sdk/issues/53450) - Fixes a pause in the debugger when reaching an unhandled exception.
|
||||
* [flutter/133658](https://github.com/flutter/flutter/issues/133658) - Fixes crash when using the --analyze-size argument.
|
||||
* [flutter/133890](https://github.com/flutter/flutter/issues/133890) - Fixes incorrect autocorrect highlights in text fields in iOS 17.
|
||||
* [flutter/134468](https://github.com/flutter/flutter/issues/134468) - Fixes an issue where users are not able to input text for IME language in iOS 17.
|
||||
* [flutter/45742](https://github.com/flutter/engine/pull/45742) - Fixes CVE-2023-4863 - Security vulnerability in WebP.
|
||||
|
||||
### [3.13.3](https://github.com/flutter/flutter/releases/tag/3.13.3) (September 7, 2023)
|
||||
|
||||
* [flutter/133147](https://github.com/flutter/flutter/issues/133147) - fixes image-picker crashes on iOS
|
||||
* [flutter/133069](https://github.com/flutter/flutter/issues/133069) - fixes issue where console prints dart:ui_web warnings in new flutter project
|
||||
* [flutter/133441](https://github.com/flutter/flutter/issues/133441) - fixes issue where `flutter upgrade` crashes and reports "unknown flutter tag".
|
||||
* [flutter/133055](https://github.com/flutter/flutter/issues/133055) - fixes issue where running `flutter doctor` crashes on FileSystemException
|
||||
* [flutter/132788](https://github.com/flutter/flutter/issues/132788) - fixes a visual overflow caused by SliverMainAxisGroup where clip behavior isn’t applied
|
||||
|
||||
### [3.13.2](https://github.com/flutter/flutter/releases/tag/3.13.2) (August 30, 2023)
|
||||
|
||||
* [flutter/132764](https://github.com/flutter/flutter/pull/132764) - Fixes lower bound of children from TwoDimensionalChildBuilderDelegate.
|
||||
|
||||
### [3.13.1](https://github.com/flutter/flutter/releases/tag/3.13.1) (August 23, 2023)
|
||||
|
||||
* [flutter/132883](https://github.com/flutter/flutter/issues/132883) - Fixes an issue where Flutter apps would not compile when using custom icon fonts that contain spaces.
|
||||
* [flutter/132959](https://github.com/flutter/flutter/issues/132959) - Fixes an issue where macOS applications using plugins with Xcode 15 would not compile.
|
||||
* [flutter/132763](https://github.com/flutter/flutter/issues/132763) - Fixes auto-correction position in iOS 17.
|
||||
* [flutter/132982](https://github.com/flutter/flutter/issues/132982) - [Impeller] Fixes an issue where applications would freeze if the app was minimized while an animation was occurring.
|
||||
|
||||
## Flutter 3.10 Changes
|
||||
|
||||
### [3.10.6](https://github.com/flutter/flutter/releases/tag/3.10.6) (July 12, 2023)
|
||||
|
||||
* [flutter/129161](https://github.com/flutter/flutter/issues/129161) - Fix regression in the GestureRecognizers used by the TextField where it would not fire the onTapDown or onTapUp callbacks which made selection not work
|
||||
* [flutter/130084](https://github.com/flutter/flutter/issues/130084) - Using canvas.drawPicture where the nested picture fails to restore clips established in the child picture and makes content disappear.
|
||||
* [dart/52767](https://github.com/dart-lang/sdk/issues/52767) - Fixes a flow in flow analysis that causes it to sometimes ignore destructuring assignments.
|
||||
* [dart/52869](https://github.com/dart-lang/sdk/issues/52869) - Fixes an infinite loop in some web development compiles that include `is` or `as` expressions involving record types with named fields.
|
||||
* [dart/52791](https://github.com/dart-lang/sdk/issues/52791) - Fixes a memory leak in Dart analyzer's file-watching.
|
||||
* [dart/52793](https://github.com/dart-lang/sdk/issues/52793) - Fixes a memory leak of file system watcher related data structures.
|
||||
|
||||
### [3.10.5](https://github.com/flutter/flutter/releases/tag/3.10.5) (June 14, 2023)
|
||||
|
||||
* [flutter/127628](https://github.com/flutter/flutter/pull/127628) - Fixes an issue preventing the use of `integration_test` when using AGP 8.0.
|
||||
* [flutter/126043](https://github.com/flutter/flutter/issues/126403) - Fixes an error encountered when attempting to use `add-to-app` on Android when generating Flutter modules.
|
||||
* [flutter/127090](https://github.com/flutter/flutter/issues/127090) - Fixes an issue preventing assets from being displayed properly on low pixel density devices.
|
||||
* [flutter/128320](https://github.com/flutter/flutter/issues/128230) - Fixes an issue where image assets are not displayed when serving with Microsoft IIS.
|
||||
* [dart/52403](https://github.com/dart-lang/sdk/issues/52403) - Fixes a bad cast in the frontend which can manifest as a crash in the dart2js
|
||||
`ListFactorySpecializer` during Flutter web builds.
|
||||
* [dart/1224](https://github.com/dart-lang/dart_style/issues/1224) - Handles formatting nullable record types with no fields.
|
||||
* [dart/52480](https://github.com/dart-lang/sdk/issues/52480) - Fixes error when using records when targeting the web in development mode.
|
||||
|
||||
### [3.10.4](https://github.com/flutter/flutter/releases/tag/3.10.4) (June 07, 2023)
|
||||
|
||||
* [flutter/127836](https://github.com/flutter/flutter/issues/127836) - Fixes SliverAppBar's FlexibleSpaceBar overlaps
|
||||
|
||||
|
||||
### [3.10.3](https://github.com/flutter/flutter/releases/tag/3.10.3) (June 02, 2023)
|
||||
|
||||
* [flutter/126435](https://github.com/flutter/flutter/issues/126435) - Fixes the position of `SearchAnchor` when used in a nested navigator.
|
||||
* [flutter/127486](https://github.com/flutter/flutter/issues/127486) - [Impeller] Fixes an issue causing noise when using combinations of UV mapping and color blending.
|
||||
* [flutter/126878](https://github.com/flutter/flutter/issues/126878) - [Impeller] Fixes an issue where images do not appear on iOS devices.
|
||||
* [flutter/1127587](https://github.com/flutter/flutter/issues/124612) - [Impeller] Fixes a crash when applying backdrop blurs to platform views.
|
||||
* [flutter/127103](https://github.com/flutter/flutter/issues/127103) - [Impeller] Fixes an issue where text is not rendered correctly when a transform is applied.
|
||||
* [flutter/126487](https://github.com/flutter/flutter/issues/126487) - [Impeller] Fixes an issue where blur is not respected at certain value.
|
||||
* [dart/52449](https://github.com/dart-lang/sdk/issues/52449) - Fixes an AOT compiler crash when generating an implicit getter returning an unboxed record.
|
||||
* [dart/52373](https://github.com/dart-lang/sdk/issues/52373) - Fixes a situation in which variables appearing in multiple branches of an or-pattern might be erroneously reported as being mismatched.
|
||||
* [dart/52334](https://github.com/dart-lang/sdk/issues/52334) - Adds missing `interface` modifiers on the purely abstract classes `MultiStreamController`, `StreamConsumer`, `StreamIterator` and `StreamTransformer`.
|
||||
* [dart/52373](https://github.com/dart-lang/sdk/issues/52373) - Fixes an error during debugging when `InternetAddress.tryParse` is used.
|
||||
* [dart/126884](https://github.com/flutter/flutter/issues/126884) - Fixes a VM issue causing crashes on hot reload.
|
||||
* [dart/4195](https://github.com/dart-lang/linter/issues/4195) - Improves linter support.
|
||||
* [dart/52439](https://github.com/dart-lang/sdk/issues/52439) - Fixes an issue in variable patterns preventing users from expressing a pattern match using a variable or wildcard pattern with a nullable record type.
|
||||
* [dart/52386](https://github.com/dart-lang/sdk/issues/52386) - Updates warnings and provide instructions for updating the Dart pub cache on Windows.
|
||||
|
||||
### [3.10.2](https://github.com/flutter/flutter/releases/tag/3.10.2) (May 24, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/126532](https://github.com/flutter/flutter/issues/126532) - [Impeller] Fixes saveLayer ignores opacity of paint with blend mode lighten.
|
||||
* [flutter/126739](https://github.com/flutter/flutter/issues/126739) - [Impeller] Fixes ImageShader alignment is different for different PaintingStyle.
|
||||
* [flutter/126701](https://github.com/flutter/flutter/issues/126701) - [Impeller] Fixes InkSparkle splash not clipping on iOS.
|
||||
* [flutter/126661](https://github.com/flutter/flutter/issues/126661) - Fixes PointerInterceptor reverses transformHitTests in a scaled context.
|
||||
* [flutter/127183](https://github.com/flutter/flutter/issues/127183) - [Impeller] Fixes drawing path with image shader is not correct.
|
||||
* [dart/52438](https://github.com/dart-lang/sdk/issues/52438) - Fixes a dart2js crash when using a switch case expression on a record where the fields don't match the cases.
|
||||
* [dart/3392](https://github.com/dart-lang/dartdoc/issues/3392) - Add chips for class and mixin pages on dartdoc generated pages.
|
||||
* [dart/52352](https://github.com/dart-lang/sdk/issues/52352) - Fixes a situation causing the parser to fail resulting in an infinite loop leading to higher memory usage.
|
||||
* [dart/52078](https://github.com/dart-lang/sdk/issues/52078) - Add clear errors when mixing inheritance in pre and post Dart 3 libraries.
|
||||
|
||||
|
||||
### [3.10.1](https://github.com/flutter/flutter/releases/tag/3.10.1) (May 17, 2023)
|
||||
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/126510](https://github.com/flutter/flutter/issues/125276) - [Impeller] Fixes errors in text transformation when using impeller.
|
||||
* [flutter/126854](https://github.com/flutter/flutter/issues/126854) - [Impeller] Fixes visual glitches and crashes when using wide gamut color support on iOS.
|
||||
* [flutter/124883](https://github.com/flutter/flutter/issues/124883) - Fixes an issue where images do not render on Flutter web apps when the host machine has Internet Download Manager installed.
|
||||
* [flutter/126491](https://github.com/flutter/flutter/issues/126491) - Fixes an issue where `CupertinoPicker` and `ListWheelViewport` crash with certain configurations on development builds.
|
||||
* [flutter/124529](https://github.com/flutter/flutter/issues/124529) - Fixes an issue where iOS and macOS apps will not build when using Xcode 14.3 and adding dependencies with low iOS target versions.
|
||||
* [flutter/122376](https://github.com/flutter/flutter/issues/122376) - Adds a migrator to update the Gradle version when it conflicts with the Android Studio version of Java is detected.
|
||||
* [dart/124369](https://github.com/flutter/flutter/issues/124369) - Fixes a compiler crash involving redirecting factories and FFI.
|
||||
* [dart/51899](https://github.com/dart-lang/sdk/issues/51899) - Fixes a dart2js crash when using a combination of local functions, generics, and records.
|
||||
* [dart/52191](https://github.com/dart-lang/sdk/issues/52191) - Fixes incorrect error using a void in a switch case expression.
|
||||
* [dart/52041](https://github.com/dart-lang/sdk/issues/52041) - Fixes a false error when using in switch case expressions when the switch refers to a private getter.
|
||||
* [dart/52260](https://github.com/dart-lang/sdk/issues/52260) - Prevent the use of when and as as variable names in patterns.
|
||||
* [dart/52241](https://github.com/dart-lang/sdk/issues/52241) - Fixes an inconsistency in type promotion between the analyzer and VM.
|
||||
* [dart/1212](https://github.com/dart-lang/dart_style/issues/1212) - Improve performance on functions with many parameters.
|
||||
|
||||
### [3.10.0](https://github.com/flutter/flutter/releases/tag/3.10.0) (May 10, 2023)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 3.7 Changes
|
||||
|
||||
### [3.7.12](https://github.com/flutter/flutter/releases/tag/3.7.12) (Apr 19, 2023)
|
||||
|
||||
This hotfix release addresses the following issues:
|
||||
|
||||
* [flutter/124838](https://github.com/flutter/flutter/issues/124838) - Support Gradle 8
|
||||
|
||||
### [3.7.11](https://github.com/flutter/flutter/releases/tag/3.7.11) (Apr 12, 2023)
|
||||
|
||||
This hotfix release addresses the following issues:
|
||||
|
||||
* [flutter/124529](https://github.com/flutter/flutter/issues/124529) - Fix Xcode 14.3 will not build when plugin transitive dependencies have a low deployment target
|
||||
* [flutter/124340](https://github.com/flutter/flutter/issues/124340) - Fixes an issue where iOS and MacOS fail to build when targeting low deployment targets when using xCode 14.3.
|
||||
* [flutter/124208](https://github.com/flutter/flutter/issues/124208) - Fix orientation preferences on iOS 16+
|
||||
* [flutter/116711](https://github.com/flutter/flutter/issues/116711) - Fixes an issue where orientation preferences are not respected on iOS 16 and above.
|
||||
* [flutter/124403](https://github.com/flutter/flutter/issues/124403) - Clarify errors around Java/Gradle incompatibility
|
||||
* [flutter/122376](https://github.com/flutter/flutter/issues/122376) - Clarify errors around Java/Gradle incompatibility.
|
||||
|
||||
### [3.7.10](https://github.com/flutter/flutter/releases/tag/3.7.10) (Apr 05, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/123890](https://github.com/flutter/flutter/issues/123890) - Fixes an issue where upgrading to Xcode 14.3 breaks the ability to publish iOS and macOS applications.
|
||||
|
||||
### [3.7.9](https://github.com/flutter/flutter/releases/tag/3.7.9) (Mar 30, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [dart/51798](https://github.com/dart-lang/sdk/issues/51798) - Fixes a false `Out of Memory` exception causing slowdowns.
|
||||
|
||||
### [3.7.8](https://github.com/flutter/flutter/releases/tag/3.7.8) (Mar 22, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/119441](https://github.com/flutter/flutter/issues/119441) - Fixes an issue where the `Toolbar` widget is incorrectly positioned when inside of a textfield in the Appbar.
|
||||
|
||||
### [3.7.7](https://github.com/flutter/flutter/releases/tag/3.7.7) (Mar 08, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/121256](https://github.com/flutter/flutter/issues/121256) - Fixes an issue where Android users can not use add2app because it can not locate build/host/apk/app-debug.apk.
|
||||
* [engine/120455](https://github.com/flutter/flutter/issues/120455)
|
||||
Cached DisplayList opacity inheritance fix.
|
||||
* [dart/121270](https://github.com/flutter/flutter/issues/121270) - Fixes mobile device VM crashes caused by particular use of RegExp on mobile devices.
|
||||
|
||||
### [3.7.6](https://github.com/flutter/flutter/releases/tag/3.7.6) (Mar 01, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [dart/50981](https://github.com/dart-lang/sdk/issues/50981) - Improve performance of Dart Analysis Server by limiting the analysis context to 1.
|
||||
* [dart/51481](https://github.com/dart-lang/sdk/issues/51481) - Update DDC test and builder configuration
|
||||
* [flutter/114031](https://github.com/flutter/flutter/issues/114031) - Fixes a crash when using `flutter doctor --android-licenses` on macOS.
|
||||
* [flutter/106674](https://github.com/flutter/flutter/issues/106674) - Fixes an issue where Flutter is unable to find the current JDK in specific versions of Android Studio.
|
||||
|
||||
### [3.7.5](https://github.com/flutter/flutter/releases/tag/3.7.5) (Feb 22, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/119180](https://github.com/flutter/flutter/issues/119180) - Apple Pencil writes on Flutter apps instead of scrolling when outside of a text field.
|
||||
* [flutter/120220](https://github.com/flutter/flutter/issues/120220) - [Impeller] Flutter apps may crash when some clip operations are used.
|
||||
|
||||
### [3.7.4](https://github.com/flutter/flutter/releases/tag/3.7.4) (Feb 21, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/116360](https://github.com/flutter/flutter/issues/116360) - Flutter web apps will not load if accessed through any other path than `/`.
|
||||
* [flutter/119557](https://github.com/flutter/flutter/issues/119557) - Localization files incorrectly overridden stopping Flutter applications from running.
|
||||
* [flutter/116459](https://github.com/flutter/flutter/issues/116459) - Localization files do not parse when using numbers as select cases.
|
||||
|
||||
### [3.7.3](https://github.com/flutter/flutter/releases/tag/3.7.3) (Feb 9, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/119507](https://github.com/flutter/flutter/issues/119507) - Asset inclusion regression can cause unexpected app bundle size increase
|
||||
* [flutter/119289](https://github.com/flutter/flutter/issues/119289) - [Impeller] ImageFilter.blur Edge sampling issue.
|
||||
* [flutter/119950](https://github.com/flutter/flutter/issues/119950) - [Impeller] Improve blur performance for Android and iPad Pro.
|
||||
* [flutter/119190](https://github.com/flutter/flutter/pull/119190) - Fix lexer issue where select/plural/other/underscores cannot be in identifier names.
|
||||
|
||||
### [3.7.2](https://github.com/flutter/flutter/releases/tag/3.7.2) (Feb 8, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/119881](https://github.com/flutter/flutter/issues/119881) - [Impeller] App performance decreases when using emulated dashed lines.
|
||||
* [flutter/119245](https://github.com/flutter/flutter/issues/119245) - [Impeller] App crashes due to invalid textures when using impeller.
|
||||
* [flutter/119489](https://github.com/flutter/flutter/issues/119489) - [Impeller] Text glyphs render incorrectly on different font weights
|
||||
* [flutter/103847](https://github.com/flutter/flutter/issues/103847) - Fix animation jank on some iPhone models.
|
||||
* [flutter/119593](https://github.com/flutter/flutter/issues/119593) - Localization files fail to generate when `FLUTTER_STORAGE_BASE_URL` is overridden.
|
||||
* [flutter/119084](https://github.com/flutter/flutter/issues/119084) - When requesting to evaluate multiple expressions while debugging Flutter web apps, tooling fails before finishing operations.
|
||||
* [flutter/119261](https://github.com/flutter/flutter/issues/119261) - Flutter tool crashes when attempting to update the artifact cache.
|
||||
* [flutter/117420](https://github.com/flutter/flutter/issues/117420) - Ink ripple is rendered incorrectly inside of the `NavigationBar` widget when using Material 3.
|
||||
* [dart/50622](https://github.com/dart-lang/sdk/issues/50622) - VM crashes when mixing the use of double and float calculations in debug/JIT configuration.
|
||||
* [flutter/119220](https://github.com/flutter/flutter/issues/119220) - Compiler may crash when attempting to inline a method with lots of optional parameters with distinct default values.
|
||||
* [dart/51087](https://github.com/dart-lang/sdk/issues/51087) - `part_of_different_library` error may be encountered when using `PackageBuildWorkspace`.
|
||||
|
||||
### [3.7.1](https://github.com/flutter/flutter/releases/tag/3.7.1) (Feb 1, 2023)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/116782](https://github.com/flutter/flutter/issues/116782) - Material 3 Navigation Drawer does not support scrolling or safe areas
|
||||
* [flutter/119414](https://github.com/flutter/flutter/issues/119414) - ImageFilter in ListView causes wrong offset on Android and iOS
|
||||
* [flutter/119181](https://github.com/flutter/flutter/issues/119181) - CastError when running `flutter pub get`
|
||||
* [flutter/118613](https://github.com/flutter/flutter/issues/118613) - [Impeller] Fonts are blurry when rendering on iOS
|
||||
* [flutter/118945](https://github.com/flutter/flutter/issues/118945) - [Impeller] Objects with large stroke width not drawn correctly on iOS
|
||||
* [flutter/117428](https://github.com/flutter/flutter/issues/117428) - [Impeller] Text is transformed incorrectly on iOS
|
||||
* [flutter/119072](https://github.com/flutter/flutter/issues/119072) - [Impeller] Draw calls could be improperly culled
|
||||
* [flutter/118847](https://github.com/flutter/flutter/issues/118847) - [Impeller] Float samplers can get re-ordered compared to SkSL
|
||||
* [flutter/119014](https://github.com/flutter/flutter/issues/119014) - Replace iPhone 6s with iPhone 11 as flutter test devices
|
||||
|
||||
### [3.7.0](https://github.com/flutter/flutter/releases/tag/3.7.0) (Jan 24, 2023)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 3.3 Changes
|
||||
|
||||
### [3.3.10](https://github.com/flutter/flutter/releases/tag/3.3.10) (Dec 16, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/113314](https://github.com/flutter/flutter/issues/113314) - Glitches appear when scrolling on Android TV devices.
|
||||
* [flutter/80401](https://github.com/flutter/flutter/issues/80401) - Some widgets are not visible when nested inside of `ClipRRect` in CanvasKit mode when using Flutter web on Safari.
|
||||
|
||||
### [3.3.9](https://github.com/flutter/flutter/releases/tag/3.3.9) (Nov 23, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [dart/50199](https://github.com/dart-lang/sdk/issues/50119) - fix error when using private variable setters in mixins on dart web.
|
||||
* [dart/50392](https://github.com/dart-lang/sdk/issues/50392) - Type parameter nullability performs incorrectly in factory constructors.
|
||||
|
||||
### [3.3.8](https://github.com/flutter/flutter/releases/tag/3.3.8) (Nov 09, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/113973](https://github.com/flutter/flutter/issues/113973) - Fix null safety issue in TextFormField when Android devices pass no data
|
||||
* [flutter/109632](https://github.com/flutter/flutter/issues/109632) - Fix type conversion in TextInput that didn’t allow num types
|
||||
|
||||
### [3.3.7](https://github.com/flutter/flutter/releases/tag/3.3.6) (Nov 2, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/113550](https://github.com/flutter/flutter/issues/113550) - Fix unnecessary null safe exceptions in input decorators on Android
|
||||
* [flutter/100522](https://github.com/flutter/flutter/issues/100522) - Speculative fix for iOS screen flickering
|
||||
|
||||
### [3.3.6](https://github.com/flutter/flutter/releases/tag/3.3.6) (Oct 26, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/111255](https://github.com/flutter/flutter/issues/111255) - Using WebView leads to size error in platform_views since Flutter 3.3.0
|
||||
|
||||
### [3.3.5](https://github.com/flutter/flutter/releases/tag/3.3.5) (Oct 19, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/113035](https://github.com/flutter/flutter/pull/113035) - Apps crash when `FadeInImage` switches from cached to uncached images.
|
||||
* [flutter/112228](https://github.com/flutter/flutter/pull/112228) - Move documentation build and deployment to post-submit.
|
||||
* [flutter/36807](https://github.com/flutter/engine/pull/36807) - Apps crash when combining emojis and Korean text.
|
||||
* [flutter/112887](https://github.com/flutter/flutter/pull/112887) - When debugging web apps, erroneous errors are displayed.
|
||||
|
||||
### [3.3.4](https://github.com/flutter/flutter/releases/tag/3.3.4) (Oct 05, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [Flutter/36181](https://github.com/flutter/engine/pull/36181) - On Flutter desktop apps, pixel snapping performs incorrectly when using opacity layers at certain DPRs and screen sizes.
|
||||
* [flutter/36491](https://github.com/flutter/engine/pull/36491) - On android devices with a refresh rate greater than 60hz, frames jump when scrolling.
|
||||
|
||||
### [3.3.3](https://github.com/flutter/flutter/releases/tag/3.3.3) (Sept 28, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/111475](https://github.com/flutter/flutter/issues/111475) - Signing errors on iOS pod bundle resources on Xcode 14 "Signing for "x" requires a development team."
|
||||
* [flutter/110671](https://github.com/flutter/flutter/issues/110671) - App crashes on latest versions when AnimatedContainer / Container height is set to 0 and throws uncaught exception
|
||||
* [flutter/107590](https://github.com/flutter/flutter/issues/107590) - Flutter tools ShaderCompilerException with exit code -1073740791.
|
||||
* [flutter/110640](https://github.com/flutter/flutter/issues/110640) - Fatal crash with java.lang.AssertionError when selecting text in TextField.
|
||||
* [dart/50075](https://github.com/dart-lang/sdk/issues/50075) - Security vulnerability: There is a auth bypass vulnerability in Dart SDK, specifically dart:uri core library, used to parse and validate URLs.
|
||||
* [dart/50052](https://github.com/dart-lang/sdk/issues/50052) - Avoid CFE crash when input contains invalid super parameters usage.
|
||||
|
||||
### [3.3.2](https://github.com/flutter/flutter/releases/tag/3.3.2) (Sept 14, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/111411](https://github.com/flutter/flutter/issues/111411) - Package assets fail to load.
|
||||
* [flutter/111296](https://github.com/flutter/flutter/issues/111296) - Custom embedders fail to build for 32 bit targets.
|
||||
* [flutter/111274](https://github.com/flutter/flutter/issues/111274) - Android plugins crash when using platform view's Virtual Display fallback.
|
||||
* [flutter/111231](https://github.com/flutter/flutter/issues/111231) - Text rendering is handled incorrectly.
|
||||
* [dart/49923](https://github.com/dart-lang/sdk/issues/49923) - Incorrect type propagation when using `late` variables in catch blocks.
|
||||
|
||||
### [3.3.1](https://github.com/flutter/flutter/releases/tag/3.3.1) (Sept 7, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/110820](https://github.com/flutter/flutter/issues/110820) - Windows apps crash when accessibility is enabled on apps that use widgets with custom semantic actions.
|
||||
|
||||
### [3.3.0](https://github.com/flutter/flutter/releases/tag/3.3.0) (Aug 30, 2022)
|
||||
Initial stable release.
|
||||
## Flutter 3.0 Changes
|
||||
### [3.0.5](https://github.com/flutter/flutter/releases/tag/3.0.5) (July 13, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/106601](https://github.com/flutter/flutter/issues/106601) - Flutter tool fails on visual studio on certain locales on Windows.
|
||||
* [flutter/106510](https://github.com/flutter/flutter/issues/106510) - Flutter crashes on launch on ARM devices.
|
||||
* [dart/49054](https://github.com/dart-lang/sdk/issues/49054) - Improves code completion for Flutter.
|
||||
* [dart/49402](https://github.com/dart-lang/sdk/issues/49402) - Compiler crashes when using Finalizable parameters.
|
||||
### [3.0.4](https://github.com/flutter/flutter/releases/tag/3.0.4) (July 1, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/105183](https://github.com/flutter/flutter/issues/105183) - Pointer compression on iOS causes OOM
|
||||
* [flutter/103870](https://github.com/flutter/flutter/issues/103870) - Application crashes on system low memory events
|
||||
* [flutter/105674](https://github.com/flutter/flutter/issues/105674) - Rendering artifacts from ImagedFiltered/ColorFiltered in animated views
|
||||
### [3.0.3](https://github.com/flutter/flutter/releases/tag/3.0.3) (June 22, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [dart/49188](https://github.com/dart-lang/sdk/issues/49188) - Improve analysis of enums and switch.
|
||||
* [dart/49075](https://github.com/dart-lang/sdk/issues/49075) - Fix compiler crash when initializing Finalizable objects.
|
||||
### [3.0.2](https://github.com/flutter/flutter/releases/tag/3.0.2) (June 10, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/104785](https://github.com/flutter/flutter/issues/104785) - Flutter web apps show a black screen on Safari 13.
|
||||
* [flutter/102451](https://github.com/flutter/flutter/issues/102451) - `flutter doctor` crashes for Windows users using Visual Studio 2022.
|
||||
* [flutter/103846](https://github.com/flutter/flutter/issues/103846) - Unexpected line breaks occur when using new text renderer.
|
||||
* [flutter/104569](https://github.com/flutter/flutter/pull/104569) - Ink Sparkle slows down applications using Material 3.
|
||||
* [flutter/103404](https://github.com/flutter/flutter/issues/103404) - SliverReorderableList does not drag on Android devices.
|
||||
* [flutter/103556](https://github.com/flutter/flutter/issues/103566) - Nested horizontal sliders in widgets with horizontal drag gestures do not work in Android applications.
|
||||
* [flutter/100375](https://github.com/flutter/flutter/issues/100375) - Build process fails when building Windows applications.
|
||||
* [dart/49027](https://github.com/dart-lang/sdk/issues/49027) - Code suggestion for initState/dispose/setState no longer work on intellij.
|
||||
* [dart/3424](https://github.com/dart-lang/pub/issues/3424) - `dart pub login` fails when attempting to publish a package.
|
||||
* [dart/49097](https://github.com/dart-lang/sdk/issues/49097) - `dart analyze` throws errors when using enhance Enums feature.
|
||||
### [3.0.1](https://github.com/flutter/flutter/releases/tag/3.0.1) (May 19, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/102947](https://github.com/flutter/flutter/issues/102947) - Radial gradients behave incorrectly when painting text.
|
||||
### [3.0.0](https://github.com/flutter/flutter/releases/tag/3.0.0) (May 11, 2022)
|
||||
Initial stable release.
|
||||
## Flutter 2.10 Changes
|
||||
### [2.10.5](https://github.com/flutter/flutter/releases/tag/2.10.5) (April 18, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/101224](https://github.com/flutter/flutter/issues/101224) - Flutter web debugger fails when using chrome 100 or greater.
|
||||
### [2.10.4](https://github.com/flutter/flutter/releases/tag/2.10.4) (March 28, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/93871](https://github.com/flutter/flutter/issues/93871) - Custom embedders fail to build when using default sysroot (GCC 11).
|
||||
* [dart/48559](https://github.com/dart-lang/sdk/issues/48559) - Flutter web apps crash when using package:freezed.
|
||||
### [2.10.3](https://github.com/flutter/flutter/releases/tag/2.10.3) (March 02, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/98973](https://github.com/flutter/flutter/issues/98973) - Deadlock in application startup in profile/release mode.
|
||||
* [flutter/98739](https://github.com/flutter/flutter/issues/98739) - ios: Visual glitch when scrolling a list in a Scaffold that has a Material and Container as bottomNavigationBar.
|
||||
* [flutter/97086](https://github.com/flutter/flutter/issues/97086) - Windows: Fail to launch app in debug mode.
|
||||
### [2.10.2](https://github.com/flutter/flutter/releases/tag/2.10.2) (February 18, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/95211](https://github.com/flutter/flutter/issues/95211) - Transform animation with BackdropFilter is causing a crash.
|
||||
* [flutter/98155](https://github.com/flutter/flutter/issues/98155) - App crashes after upgrading to 2.10.x using webview + video_player plugin.
|
||||
* [flutter/98361](https://github.com/flutter/flutter/issues/98361) - Error in DL bounds calculations causes incorrect SVG rendering.
|
||||
* [flutter/97767](https://github.com/flutter/flutter/issues/97767) - New material icons are not properly rendered.
|
||||
* [flutter/95711](https://github.com/flutter/flutter/issues/95711) - Linux builds default to building GLFW.
|
||||
### [2.10.1](https://github.com/flutter/flutter/releases/tag/2.10.1) (February 9, 2022)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/94043](https://github.com/flutter/flutter/issues/94043) - Autofill does not work in `TextField`.
|
||||
* [flutter/96411](https://github.com/flutter/flutter/issues/96411) - Safari: Unable to enter text into `TextField`.
|
||||
* [flutter/96661](https://github.com/flutter/flutter/issues/96661) - Platform views throw fatal exception: Methods marked with @UiThread must be executed on the main thread.
|
||||
* [flutter/97103](https://github.com/flutter/flutter/issues/97103) - Images become corrupted when using CanvasKit.
|
||||
* [flutter/97679](https://github.com/flutter/flutter/issues/97679) - Don't remove overlay views when the rasterizer is being torn down.
|
||||
* [dart/48301](https://github.com/dart-lang/sdk/issues/48301) - Avoid speculative conversion in ffi Pointer.asTypedList.
|
||||
### [2.10.0](https://github.com/flutter/flutter/releases/tag/2.10.0) (February 3, 2022)
|
||||
Initial stable release.
|
||||
## Flutter 2.8 Changes
|
||||
### [2.8.1](https://github.com/flutter/flutter/releases/tag/2.8.1) (December 16, 2021)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/94914](https://github.com/flutter/flutter/issues/94914) - Apps using `google_sign_in` or `google_maps` don't build in iOS Simulator on ARM macOS
|
||||
* [flutter/90783](https://github.com/flutter/flutter/issues/90783) - In rare circumstances, engine may crash during app termination on iOS and macOS
|
||||
* [dart/47914](https://github.com/dart-lang/sdk/issues/47914) - AOT compilation fails with error "Invalid argument(s): Missing canonical name for Reference"
|
||||
* [dart/47815](https://github.com/dart-lang/sdk/issues/47815) - Running `dart pub publish` with custom pub package server that has URL containing a path may fail.
|
||||
|
||||
### [2.8.0](https://github.com/flutter/flutter/releases/tag/2.8.0) (December 8, 2021)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 2.5 Changes
|
||||
### [2.5.3](https://github.com/flutter/flutter/releases/tag/2.5.3) (October 15, 2021)
|
||||
This hotfix release addresses the following issues:
|
||||
* [dart/47321](https://github.com/dart-lang/sdk/issues/47321) - Fix a potential out-of-memory condition with analysis server plugins
|
||||
* [dart/47432](https://github.com/dart-lang/sdk/issues/47432) - Fix certificate loading on Windows when there are expired certificates
|
||||
* [flutter/83792](https://github.com/flutter/flutter/issues/83792) - Fix HTTPS issue related to: "HttpClient throws Invalid argument(s): Invalid internet address"
|
||||
|
||||
### [2.5.2]((https://github.com/flutter/flutter/releases/tag/2.5.2)) (September 30, 2021)
|
||||
This hotfix release addresses the following issues:
|
||||
* [dart/47285](https://github.com/dart-lang/sdk/issues/47285) - Fix a regression to the performance of code completions
|
||||
* [dart/47316](https://github.com/dart-lang/sdk/issues/47316) - Dynamic tables in ELF files have invalid relocated addresses
|
||||
* [flutter/89912](https://github.com/flutter/flutter/issues/89912) - Building iOS app generates unnecessary Flutter.build folder
|
||||
|
||||
### [2.5.1]((https://github.com/flutter/flutter/releases/tag/2.5.1)) (September 17, 2021)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/88767](https://github.com/flutter/flutter/issues/88767) - java.lang.SecurityException: Permission denial crash at launch
|
||||
* [flutter/88236](https://github.com/flutter/flutter/issues/88236) - null check exception during keyboard keypress
|
||||
* [flutter/88221](https://github.com/flutter/flutter/issues/88221) - Material routes delayed on push and pop
|
||||
* [flutter/84113](https://github.com/flutter/flutter/issues/84113) - HTTP exceptions talking to VM Service
|
||||
* [flutter/83632](https://github.com/flutter/flutter/issues/83632) - Scroll view velocity too high
|
||||
|
||||
### 2.5.0 (September 8, 2021)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 2.2 Changes
|
||||
### [2.2.3](https://github.com/flutter/flutter/pull/85719) (July 2, 2021)
|
||||
This hotfix release addresses the following issues:
|
||||
* [flutter/84212](https://github.com/flutter/flutter/issues/84212) - Upgrading to 2.2.1 cause main.dart to crash
|
||||
* [flutter/83213](https://github.com/flutter/flutter/issues/83213) - TextFormField not responding to inputs on Android when typing on Microsoft SwiftKey
|
||||
* [flutter/82838](https://github.com/flutter/flutter/issues/82838) - Flutter Web failing to compile with "Undetermined Nullability"
|
||||
* [flutter/82874](https://github.com/flutter/flutter/issues/82874) - PopupMenuButton is broken after upgrade to Flutter 2.2.
|
||||
|
||||
### [2.2.2](https://github.com/flutter/flutter/pull/84364) (June 11, 2021)
|
||||
This hotfix release addresses the following issues:
|
||||
* [dart/46249](https://github.com/dart-lang/sdk/issues/46249) - Ensure start/stop file watching requests are run on the dart thread.
|
||||
* [dart/46210](https://github.com/dart-lang/sdk/issues/46210) - Fix an analyze crash when analyzing against package:meta v1.4.0
|
||||
* [dart/46173](https://github.com/dart-lang/sdk/issues/46173) - Merge a3767f7db86a85fcd6201e9357ad47b884002b66 to stable channel (2.13)
|
||||
* [dart/46300](https://github.com/dart-lang/sdk/issues/46300) - Fix OOM VM test (`transferable_throws_oom_test` crashing after upgrade from Ubuntu 16)
|
||||
* [dart/46298](https://github.com/dart-lang/sdk/issues/46298) - Ensure start/stop file watching requests are run on the Dart thread
|
||||
* [flutter/83799](https://github.com/flutter/flutter/issues/83799) - Tool may crash if pub is missing from the artifact cache
|
||||
* [flutter/83102](https://github.com/flutter/flutter/issues/83102) - Generated l10n file is missing ‘intl’ import with Flutter 2.2.0
|
||||
* [flutter/83094](https://github.com/flutter/flutter/issues/83094) - Flutter AOT precompiler crash
|
||||
* [flutter/82874](https://github.com/flutter/flutter/issues/82874) - PopupMenuButton is broken after upgrade to Flutter 2.2.
|
||||
|
||||
### [2.2.1](https://github.com/flutter/flutter/pull/83372) (May 27, 2021)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/80978](https://github.com/flutter/flutter/issues/80978) - Error "Command PhaseScriptExecution failed with a nonzero exit code" when building on macOS
|
||||
- [dart/45990](https://github.com/dart-lang/sdk/issues/45990) - CastMap performs an invalid cast on 'remove', breaking shared_preferences plugin
|
||||
- [dart/45907](https://github.com/dart-lang/sdk/issues/45907) - DDC missing nullability information from recursive type hierarchies
|
||||
- [flutter/52106](https://github.com/flutter/flutter/issues/52106) - [Web] Accessibility focus border doesn’t follow when navigating through interactive elements with tab key
|
||||
- [flutter/82768](https://github.com/flutter/flutter/issues/82768) - [Web] svgClip memory leak in Canvaskit renderer
|
||||
|
||||
### 2.2.0 (May 18, 2021)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 2.0 Changes
|
||||
### [2.0.6](https://github.com/flutter/flutter/pull/81508) (April 29, 2021)
|
||||
This hotfix release addresses the following issue:
|
||||
- [flutter/81326](https://github.com/flutter/flutter/issues/81326) - macOS binaries not codesigned
|
||||
|
||||
### [2.0.5](https://github.com/flutter/flutter/pull/80570) (April 16, 2021)
|
||||
This hotfix release addresses the following issue:
|
||||
- [dart/45306](https://github.com/dart-lang/sdk/issues/45306) - Segmentation fault on specific code
|
||||
|
||||
### [2.0.4](https://github.com/flutter/flutter/pull/79486) (April 2, 2021)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/78589](https://github.com/flutter/flutter/issues/78589) - Cocoapod transitive dependencies with bitcode fail to link against debug Flutter framework
|
||||
- [flutter/76122](https://github.com/flutter/flutter/issues/76122) - Adding a WidgetSpan widget causes web HTML renderer painting issue
|
||||
- [flutter/75280](https://github.com/flutter/flutter/issues/75280) - Dragging the "draggable" widget causes widget to freeze in the overlay layer on Web
|
||||
|
||||
### [2.0.3](https://github.com/flutter/flutter/pull/78489) (March 19, 2021)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/75261](https://github.com/flutter/flutter/issues/75261) - Unable to deep link into Android app
|
||||
- [flutter/78167](https://github.com/flutter/flutter/issues/78167) - Flutter crash after going to version 2
|
||||
- [flutter/75677](https://github.com/flutter/flutter/issues/75677) - NoSuchMethodError: The method 'cancel' was called on null at AnsiSpinner.finish
|
||||
- [flutter/77419](https://github.com/flutter/flutter/pull/77419) - Fix Autovalidate enum references in fix data
|
||||
|
||||
### [2.0.2](https://github.com/flutter/flutter/pull/77850) (March 12, 2021)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/77251](https://github.com/flutter/flutter/issues/77251) - Flutter may show multiple snackbars when Scaffold is nested
|
||||
- [flutter/75473](https://github.com/flutter/flutter/issues/75473) - CanvasKit throws error when using Path.from
|
||||
- [flutter/76597](https://github.com/flutter/flutter/issues/76597) - When multiple Flutter engines are active, destroying one engine causes crash
|
||||
- [flutter/75061](https://github.com/flutter/flutter/issues/75061) - '_initialButtons == kPrimaryButton': is not true
|
||||
- [flutter/77419](https://github.com/flutter/flutter/pull/77419) - Fix Autovalidate enum references in fix data
|
||||
- [dart/45214](https://github.com/dart-lang/sdk/issues/45214) - Bad state exception can occur when HTTPS connection attempt errors or is aborted
|
||||
- [dart/45140](https://github.com/dart-lang/sdk/issues/45140) - Uint8List reports type exception while using + operator in null safety mode
|
||||
|
||||
### [2.0.1](https://github.com/flutter/flutter/pull/77194) (March 5, 2021)
|
||||
This hotfix release addresses the following issue:
|
||||
- [flutter/77173](https://github.com/flutter/flutter/issues/77173) - Building for macOS target fails when Flutter is installed from website
|
||||
|
||||
### 2.0.0 (March 3, 2021)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 1.22 Changes
|
||||
### [1.22.6](https://github.com/flutter/flutter/pull/74355) (Jan 25, 2021)
|
||||
This hotfix release addresses the following issue:
|
||||
- [flutter/70895](https://github.com/flutter/flutter/issues/70895) - Build error when switching between dev/beta and stable branches.
|
||||
|
||||
### [1.22.5](https://github.com/flutter/flutter/pull/72079) (Dec 10, 2020)
|
||||
This hotfix release addresses the following issue:
|
||||
- [flutter/70577](https://github.com/flutter/flutter/issues/70577) - Reliability regression in the camera plugin on iOS
|
||||
|
||||
### [1.22.4](https://github.com/flutter/flutter/pull/70327) (Nov 13, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/43620](https://github.com/flutter/flutter/issues/43620) - Dart analyzer terminates during development
|
||||
- [flutter/58200](https://github.com/flutter/flutter/issues/58200) - Apple AppStore submission fails with error: “The bundle Runner.app/Frameworks/App.framework does not sue Infpport the minimum OS Version specified in the Info.plist”
|
||||
- [flutter/69722](https://github.com/flutter/flutter/issues/69722) - Setting a custom observatory port for debugging does not take effect
|
||||
- [flutter/66144](https://github.com/flutter/flutter/issues/66144) - Setting autoFillHint to text form field may cause focus issues
|
||||
- [flutter/69449](https://github.com/flutter/flutter/issues/69449) - Potential race condition in FlutterPlatformViewsController
|
||||
- [flutter/65133](https://github.com/flutter/flutter/issues/65133) - Support targeting physical iOS devices on Apple Silicon
|
||||
|
||||
### [1.22.3](https://github.com/flutter/flutter/pull/69234) (October 30, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/67828](https://github.com/flutter/flutter/issues/67828) - Multiple taps required to delete text in some input fields.
|
||||
- [flutter/66108](https://github.com/flutter/flutter/issues/66108) - Reading Android clipboard may throw a security exception if it contains media
|
||||
|
||||
### [1.22.2](https://github.com/flutter/flutter/pull/68135) (October 16, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/67869](https://github.com/flutter/flutter/issues/67869) - Stylus tap gesture is improperly registered.
|
||||
- [flutter/67986](https://github.com/flutter/flutter/issues/67986) - Android Studio 4.1 not properly supported.
|
||||
- [flutter/67213](https://github.com/flutter/flutter/issues/67213) - Webviews in hybrid composition can cause a crash.
|
||||
- [flutter/67345](https://github.com/flutter/flutter/issues/67345) - VoiceOver accessibility issue with some pages.
|
||||
- [flutter/66764](https://github.com/flutter/flutter/issues/66764) - Native webviews may not be properly disposed of in hybrid composition.
|
||||
|
||||
### [1.22.1](https://github.com/flutter/flutter/pull/67552) (October 8, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/66940](https://github.com/flutter/flutter/issues/66940) - autovalidate property inadvertently removed.
|
||||
- [flutter/66962](https://github.com/flutter/flutter/issues/66962) - The new --analyze-size flag crashes when used with --split-debug-info
|
||||
- [flutter/66908](https://github.com/flutter/flutter/issues/66908) - Flutter Activity causing exceptions in some Android versions.
|
||||
- [flutter/66647](https://github.com/flutter/flutter/issues/66647) - Layout modifications performed by background threads causes exceptions on IOS14.
|
||||
|
||||
### 1.22.0 (October 1, 2020)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 1.20 Changes
|
||||
### [1.20.4](https://github.com/flutter/flutter/pull/65787) (September 15, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/64045](https://github.com/flutter/flutter/issues/64045) - Cannot deploy to physical device running iOS 14
|
||||
|
||||
### [1.20.3](https://github.com/flutter/flutter/pull/64984) (September 2, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/63876](https://github.com/flutter/flutter/issues/63876) - Performance regression for Image animation.
|
||||
- [flutter/64228](https://github.com/flutter/flutter/issues/64228) - WebView may freeze in release mode on iOS.
|
||||
- [flutter/64414](https://github.com/flutter/flutter/issues/64414) - Task switching may freeze on some Android versions.
|
||||
- [flutter/63560](https://github.com/flutter/flutter/issues/63560) - Building AARs may cause a stack overflow.
|
||||
- [flutter/57210](https://github.com/flutter/flutter/issues/57210) - Certain assets may cause issues with iOS builds.
|
||||
- [flutter/63590](https://github.com/flutter/flutter/issues/63590) - Passing null values from functions run via Isolates throws an exception.
|
||||
- [flutter/63427](https://github.com/flutter/flutter/issues/63427) - Wrong hour/minute order in timePicker in RTL mode.
|
||||
|
||||
### [1.20.2](https://github.com/flutter/flutter/pull/63591) (August 13, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/63038](https://github.com/flutter/flutter/issues/63038) - Crash due to serialization of generic DartType (UnknownType)
|
||||
- [flutter/46167](https://github.com/flutter/flutter/issues/46167) - iOS platform view cancels gesture while a new clip layer is added during the gesture
|
||||
- [flutter/62198](https://github.com/flutter/flutter/issues/62198) - SliverList throws Exception when first item is SizedBox.shrink()
|
||||
- [flutter/59029](https://github.com/flutter/flutter/issues/59029) - build ios --release can crash with ArgumentError: Invalid argument(s)
|
||||
- [flutter/62775](https://github.com/flutter/flutter/issues/62775) - TimePicker is not correct in RTL (right-to-left) languages
|
||||
- [flutter/55535](https://github.com/flutter/flutter/issues/55535) - New DatePicker widget is not fully localized
|
||||
- [flutter/63373](https://github.com/flutter/flutter/issues/63373) - Double date separators appearing in DatePicker, preventing date selection
|
||||
- [flutter/63176](https://github.com/flutter/flutter/issues/63176) - App.framework path in Podfile incorrect
|
||||
|
||||
### [1.20.1](https://github.com/flutter/flutter/pull/62990) (August 6, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/60215](https://github.com/flutter/flutter/issues/60215) - Creating an Android-only plug-in creates a no-op iOS folder.
|
||||
|
||||
### 1.20.0 (August 5, 2020)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 1.17 Changes
|
||||
### [1.17.5](https://github.com/flutter/flutter/pull/60611) (June 30, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter-intellij/4642]https://github.com/flutter/flutter-intellij/issues/4642 - Intellij/Android Studio plugins fail to show connected Android devices.
|
||||
|
||||
### [1.17.4](https://github.com/flutter/flutter/pull/59695) (June 18, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/56826](https://github.com/flutter/flutter/issues/56826) - xcdevice polling may use all free hard drive space
|
||||
|
||||
### [1.17.3](https://github.com/flutter/flutter/pull/58646) (June 4, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/54420](https://github.com/flutter/flutter/issues/54420) - Exhausted heap space can cause machine to freeze
|
||||
|
||||
### [1.17.2](https://github.com/flutter/flutter/pull/58050) (May 28, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/57326](https://github.com/flutter/flutter/issues/57326) - CupertinoSegmentedControl does not always respond to selections
|
||||
- [flutter/56898](https://github.com/flutter/flutter/issues/56898) - DropdownButtonFormField is not re-rendered after value is changed programmatically
|
||||
- [flutter/56853](https://github.com/flutter/flutter/issues/56853) - Incorrect git error may be presented when flutter upgrade fails
|
||||
- [flutter/55552](https://github.com/flutter/flutter/issues/55552) - Hot reload may fail after a hot restart
|
||||
- [flutter/56507](https://github.com/flutter/flutter/issues/56507) - iOS builds may fail with “The path does not exist” error message
|
||||
|
||||
### [1.17.1](https://github.com/flutter/flutter/pull/57052) (May 13, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/26345](https://github.com/flutter/flutter/issues/26345) - Updating `AndroidView` layer tree causes crash on Xiaomi and Moto devices
|
||||
- [flutter/56567](https://github.com/flutter/flutter/issues/56567) - Xcode legacy build system causes build failures on iOS
|
||||
- [flutter/56473](https://github.com/flutter/flutter/issues/56473) - Build `--tree-shake-icons` build option crashes computer
|
||||
- [flutter/56688](https://github.com/flutter/flutter/issues/56688) - Regression in `Navigator.pushAndRemoveUntil`
|
||||
- [flutter/56479](https://github.com/flutter/flutter/issues/56479) - Crash while getting static type context for signature shaking
|
||||
|
||||
### 1.17.0 (May 5, 2020)
|
||||
Initial stable release.
|
||||
|
||||
## Flutter 1.12 Changes
|
||||
### Hotfix.9 (April 1, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/47819](https://github.com/flutter/flutter/issues/47819) - Crashes on ARMv8 Android devices
|
||||
- [flutter/49185](https://github.com/flutter/flutter/issues/49185) - Issues using Flutter 1.12 with Linux 5.5
|
||||
- [flutter/51712](https://github.com/flutter/flutter/issues/51712) - fixes for licensing from Android sdkmanager tool not being found
|
||||
|
||||
### [Hotfix.8](https://github.com/flutter/flutter/pull/50591) (February 11, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/50066](https://github.com/flutter/flutter/issues/50066) - binaries unsigned in last hotfix
|
||||
- [flutter/49787](https://github.com/flutter/flutter/issues/49787) - in a previous hotfix, we inadvertently broke Xcode 10 support. Reverting this change would have caused other problems (and users would still have to upgrade their Xcode with the next stable release), we decided to increase our minimum supported Xcode version. Please see the linked issue for more context on this decision.
|
||||
- [flutter/45732](https://github.com/flutter/flutter/issues/45732) - Android log reader fix
|
||||
- [flutter/47609](https://github.com/flutter/flutter/issues/47609) - Android log reader fix
|
||||
|
||||
### [Hotfix.7](https://github.com/flutter/flutter/pull/49437) (January 26, 2020)
|
||||
This hotfix release addresses the following issues:
|
||||
- [flutter/47164](https://github.com/flutter/flutter/issues/47164) - blackscreen / crash on certain Huawei devices
|
||||
- [flutter/47804](https://github.com/flutter/flutter/issues/47804) - Flutter engine crashes on some Android devices due to "Failed to setup Skia Gr context"
|
||||
- [flutter/46172](https://github.com/flutter/flutter/issues/46172) - reportFullyDrawn causes crash on Android KitKat
|
||||
|
||||
### Hotfix.5 (December 11, 2019)
|
||||
Initial stable release.
|
||||
@@ -0,0 +1,151 @@
|
||||
Flutter builds APKs through a long set of steps that ultimately defer to Gradle.
|
||||
The logic lives in many places: the Flutter framework, the Flutter app template,
|
||||
and a mix of both Dart and Gradle scripts. This doc is a high level description
|
||||
of the overall flow, which can be hard to follow given how many different
|
||||
places at once it lives and how asynchronous Gradle builds are.
|
||||
|
||||
- The Flutter tool fetches any plugin dependencies of the Flutter app from pub
|
||||
and downloads it to the pub cache. This step follows normal `pub get` behavior
|
||||
and version solving.
|
||||
- The Flutter tool writes project metadata to some local temporary files. This
|
||||
includes things like the location of the local Flutter SDK, and paths to all
|
||||
the newly downloaded plugins from pub on disk.
|
||||
- The Flutter tool invokes Gradle to build the APK.
|
||||
- Gradle reads the app's `build.gradle`, which applies the Flutter framework's
|
||||
`flutter.gradle` plugin.
|
||||
- `flutter.gradle` adds the Flutter engine and all of its support library
|
||||
dependencies as a `jar` dependency to the Flutter app.
|
||||
- `flutter.gradle` adds all of the Flutter plugins of an app as "subproject"
|
||||
Gradle dependencies (usually).
|
||||
- Gradle compiles the Flutter app and all of its subprojects (Flutter plugins)
|
||||
into a root APK.
|
||||
|
||||
Those steps are deliberately listed as bullet points and not a numbered list.
|
||||
Gradle invokes a lot of these steps at seemingly random and parallel times.
|
||||
Time is relative.
|
||||
|
||||
## Plugins are compiled as subprojects (usually)
|
||||
|
||||
Flutter plugins are typically included in Flutter apps as source code and
|
||||
compiled by Gradle, the same as the rest of the code in the Flutter app.
|
||||
|
||||
This is done by using the Gradle concept of
|
||||
["subprojects"](https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:subproject_configuration),
|
||||
a way of structuring build tasks so that they're marked as being dependent on
|
||||
each other. All Flutter apps are built with one subproject for the actual
|
||||
Android code of the app and other subprojects for the Android code of any
|
||||
plugins.
|
||||
|
||||
For example, let's assume that there's a Flutter app that uses two plugins:
|
||||
`foo` and `bar`. Let's also assume `foo` depends on `baz`, so `baz` is included
|
||||
as part of the build at runtime. Running `./gradlew projects` in the app's
|
||||
`android` directory (after first running `flutter build apk` to give the Flutter
|
||||
tool's Dart code an opportunity to set up the build) would reveal the following
|
||||
project structure:
|
||||
|
||||
```console
|
||||
$ ./gradlew projects
|
||||
|
||||
> Task :projects
|
||||
|
||||
------------------------------------------------------------
|
||||
Root project
|
||||
------------------------------------------------------------
|
||||
|
||||
Root project 'android'
|
||||
+--- Project ':app'
|
||||
+--- Project ':bar'
|
||||
+--- Project ':baz''
|
||||
\--- Project ':foo'
|
||||
```
|
||||
|
||||
### The how
|
||||
|
||||
- [The Flutter tool's Dart
|
||||
code](https://github.com/flutter/flutter/blob/82410a5ae7159b9f39e85b713decf532840ac70c/packages/flutter_tools/lib/src/build_system/targets/assets.dart#L115-L119)
|
||||
writes a `.flutter-plugins` file containing a list of all the plugins used by
|
||||
the app and their location on disk.
|
||||
- [`flutter.gradle`](https://github.com/flutter/flutter/blob/508c35940b4989c400e7b5a2851d03e4bd0b2ca2/packages/flutter_tools/gradle/flutter.gradle#L243-L264)
|
||||
reads from this file and actually adds the plugins as Gradle subproject
|
||||
dependencies of the app.
|
||||
- This also depends on the Flutter app having a block of code in its template
|
||||
that actually references and builds these subprojects once they're defined,
|
||||
see ["hello world" as an example of the app's Gradle
|
||||
script](https://github.com/flutter/flutter/blob/508c35940b4989c400e7b5a2851d03e4bd0b2ca2/examples/hello_world/android/settings.gradle#L15-L19).
|
||||
|
||||
### Special Considerations
|
||||
|
||||
Including plugin dependencies as source code and then compiling them is not
|
||||
something Gradle generally expects apps to be doing. In the past we've hit
|
||||
several issues caused by Gradle tooling around dependency management being built
|
||||
for typical Android patterns (including dependencies as `.aars` or `.jars`) and
|
||||
breaking down for the Flutter use case.
|
||||
|
||||
For example:
|
||||
|
||||
- Plugins have their own `build.gradle` scripts that may conflict with the app
|
||||
and other plugins in unexpected ways. How Gradle handles these conflicts is
|
||||
situational and sometimes undefined behavior.
|
||||
- If a plugin has a problem in its Android code, the entire user's app will fail
|
||||
to compile with a stack trace that may or may not really point to the plugin's
|
||||
code on disk.
|
||||
- If the plugin's code conflicts with the app's Android source code (for
|
||||
example, the plugin has a conflicting transitive dependancy), Gradle will
|
||||
generally fail to compile with difficult to translate stack traces.
|
||||
- These subprojects are added in an `afterEvaluate` hook in `flutter.gradle`.
|
||||
Generally adding any logic in `afterEvaluate` blocks is discouraged because it
|
||||
runs after so much of Gradle's standard pipeline.
|
||||
|
||||
## Sometimes plugins are compiled as AARs
|
||||
|
||||
Because of the problems with compiling the plugins as subprojects, the
|
||||
Flutter team explored switching the plugins to instead be compiled first as
|
||||
standalone AARs and then included as binary dependencies as is more typical for
|
||||
Android dependencies and expected by Gradle. This effort ended up being blocked,
|
||||
but is still occasionally automatically used as a fallback attempt when one of the typical
|
||||
problems with building as subprojects is detected as failing a build today.
|
||||
|
||||
The basic AAR flow goes like this:
|
||||
|
||||
- The Flutter tool fetches any plugin dependencies of the Flutter app from pub
|
||||
and downloads it to the pub cache. This step follows normal `pub get` behavior
|
||||
and version solving.
|
||||
- The Flutter tool writes project metadata to some local temporary files. This
|
||||
includes things like the location of the local Flutter SDK, and paths to all
|
||||
the newly downloaded plugins from pub on disk.
|
||||
- The Flutter tool invokes Gradle to build the APK.
|
||||
- Gradle reads the app's `build.gradle`, which applies the Flutter framework's
|
||||
`flutter.gradle` plugin.
|
||||
- `flutter.gradle` adds the Flutter engine and all of its support library
|
||||
dependencies as a `jar` dependency to the Flutter app.
|
||||
- `flutter.gradle` compiles all of the plugins individually into `aars`, and
|
||||
adds all of the Flutter plugins as `aar` dependencies to the Flutter app.
|
||||
- Gradle compiles the Flutter app and all of its binary dependencies into a root
|
||||
APK.
|
||||
|
||||
### Why this isn't the standard
|
||||
|
||||
There were a couple blocking issues that kept us from following this flow in all
|
||||
cases:
|
||||
|
||||
- The implementation of this depends on `TaskInternal.execute()`, a Gradle API
|
||||
that's been removed with no replacement in Gradle 5.
|
||||
- This style of build is extremely slow compared to the previous build flow.
|
||||
- The plugins currently in the Flutter ecosystem were written under the previous
|
||||
build system and in many cases depend on the transitive dependency bleed to
|
||||
work. For example, many plugins built this way will fail to compile
|
||||
individually because they're missing an explicit dependency on
|
||||
`androidx.annotation`. There are also other plugins that deliberately expose
|
||||
their own transitive `jar` dependencies in a way where they're automatically
|
||||
included in the app at build time by the subproject system, but apps including them as
|
||||
AARs will fail with "Class not found errors" unless the transitive plugin dependencies
|
||||
from the plugin are manually added into the apps' Gradle dependencies as well.
|
||||
|
||||
### When this is still used
|
||||
|
||||
We still fall back on this as a silent retry if we detect that the failure is
|
||||
caused by one of the likely error cases from the subproject structure:
|
||||
specifically, if we detect that the build has failed because of a likely
|
||||
AndroidX incompatibility issue. Jetifier is one of the Gradle tools that doesn't
|
||||
function normally with the subproject structure, so building the plugins as AARs
|
||||
can sometimes fix errors in that class.
|
||||
@@ -0,0 +1,95 @@
|
||||
This wiki is for [Framework](https://github.com/flutter/flutter) CI, and is not applicable to other repositories like Engine, Packages. The integration test is referred to an end-to-end target/test presented in [Flutter build dashboard](https://flutter-dashboard.appspot.com/#/build), which is an one-on-one mapping to the entries listed in the [.ci.yaml](https://github.com/flutter/flutter/blob/master/.ci.yaml) file.
|
||||
|
||||
## Overview
|
||||
Types of integration tests (based on how they are being executed):
|
||||
* DeviceLab
|
||||
* Uses test harness: [`test_runner.dart`](https://github.com/flutter/flutter/blob/master/dev/devicelab/bin/test_runner.dart)
|
||||
* Relies on recipe: [`devicelab_drone.py`](https://flutter.googlesource.com/recipes/+/refs/heads/main/recipes/devicelab/devicelab_drone.py)
|
||||
* This consists of two types further
|
||||
* One needs a physical phone (a valid value for either `device_type` or `device_os` in [.ci.yaml](https://github.com/flutter/flutter/blob/master/.ci.yaml))
|
||||
* The other runs on a host only testbed (either `none` or not defined for both `device_type` or `device_os` in [.ci.yaml](https://github.com/flutter/flutter/blob/master/.ci.yaml))
|
||||
* `DeviceLab` here for host only testbed is a legacy name which refers to using the `devicelab_drone.py` recipes and relying on a `task.dart` file defined under `dev/devicelab/bin/tasks`. But this does NOT need a physical device. In the long term, we may want to rename to avoid confusion.
|
||||
* Shard
|
||||
* Uses test harness: [`test.dart`](https://github.com/flutter/flutter/blob/master/dev/bots/test.dart)
|
||||
* Relies on recipe: [`flutter_drone.py`](https://flutter.googlesource.com/recipes/+/refs/heads/main/recipes/flutter/flutter_drone.py)
|
||||
* A `shard` property is defined for these targets
|
||||
* Others
|
||||
* most likely are specific targets used to test specific functionality
|
||||
* examples:
|
||||
* [firebaselab](https://github.com/flutter/flutter/blob/2d3166b7f9d94c8449fd7224c0b36787146434cd/.ci.yaml#L435)
|
||||
* [packaging](https://github.com/flutter/flutter/blob/2d3166b7f9d94c8449fd7224c0b36787146434cd/.ci.yaml#L529)
|
||||
* [docs](https://github.com/flutter/flutter/blob/2d3166b7f9d94c8449fd7224c0b36787146434cd/.ci.yaml#L5980)
|
||||
* [test_ownership](https://github.com/flutter/flutter/blob/2d3166b7f9d94c8449fd7224c0b36787146434cd/.ci.yaml#L944)
|
||||
* [pub_autoroller](https://github.com/flutter/flutter/blob/2d3166b7f9d94c8449fd7224c0b36787146434cd/.ci.yaml#L261)
|
||||
|
||||
The word `DeviceLab` initially was used to represent targets running in Flutter's self-maintained hardware lab where bots are connected with a physical device. Later it has been extended to represent targets that use the test harness `test_runner.dart` which is located under `dev/devicelab/bin`. All these targets need an entry defined under `dev/devicelab/bin/tasks`, and they include ones that do not need a physical device (known as host only tests).
|
||||
|
||||
`Shard` tests are using the test harness `test.dart`, which supports targets that are shardable to run in parallel. Additionally it supports tests with a single shard, which means these tests are not feasible to run in parallel. These tests have only a single shard running a block of scripts.
|
||||
|
||||
There is an overlap happens between `DeviceLab` and `Shard`: a single shard test can also run under the `DeviceLab` test harness.
|
||||
|
||||
## Where to add an integration test
|
||||
Most likely, we can fit a new integration test to existing types, like `DeviceLab`, `Shard` or other case-by-case tests that use their own **`recipes`** in addition to `DeviceLab` and `Shard`, e.g. firebaselab, packaging, docs, etc. If your new test doesn't fit in any of these (very rarely), it may need a new recipe.
|
||||
|
||||
> [!NOTE]
|
||||
> **`Recipes`** are just python scripts detailing steps to setup env. and execute corresponding test harness. Different recipes basically mean different test harness with different environment setup.
|
||||
|
||||
For the two main types (`DeviceLab`/`Shard`):
|
||||
* if a new integration test needs a physical device, it should be under `DeviceLab`
|
||||
* if a new integration test doesn't need a physical device but needs to collect benchmarks, it should be under host only `Devicelab`
|
||||
* if a new integration test need to run in parallel with sharding, it should be under `Shard`
|
||||
* others should be good with either host only `DeviceLab` or `Shard` with a single shard.
|
||||
|
||||
## How to add an integration test as a `DeviceLab` target
|
||||
|
||||
Please refer to how to write a [`DeviceLab` test](https://github.com/flutter/flutter/tree/master/dev/devicelab#writing-tests) and how to add it to [continuous integration](https://github.com/flutter/flutter/tree/master/dev/devicelab#adding-tests-to-continuous-integration).
|
||||
|
||||
Quick steps:
|
||||
* creates a test file under `dev/devicelab/bin/tasks/<test>.dart`
|
||||
* adds a new [.ci.yaml](https://github.com/flutter/flutter/blob/master/.ci.yaml) entry by mirroring an existing target with `recipe: devicelab_drone` (see .ci.yaml [readme](https://github.com/flutter/cocoon/blob/main/CI_YAML.md))
|
||||
* begins with `bringup: true`
|
||||
* specifies `device_type` or `device_os` if needed
|
||||
* removes `bringup: true` after validated in post-submit CI (in staging pool).
|
||||
* adds an ownership entry to [TESTOWNERS](https://github.com/flutter/flutter/blob/master/TESTOWNERS)
|
||||
* adds entries for other platforms if needed
|
||||
|
||||
## How to add an integration test as a `Shard` target
|
||||
|
||||
Please refer to [steps-to-add-a-new-framework-test-shard](https://github.com/flutter/flutter/wiki/Adding-a-new-Test-Shard#steps-to-add-a-new-framework-test-shard).
|
||||
|
||||
## How to add an integration tests with Android emulator support
|
||||
|
||||
In this section we will build a new target for the `Linux` platform that will run in the `DeviceLab` with an Android emulator. Note: it is also supported in `Shard`.
|
||||
|
||||
### Name and platform
|
||||
|
||||
To add a test in the Framework Repository with Android Emulators via the DeviceLab recipe, you will not have to do anything on the recipe side of the code as simply specifying the configuration will allow you to create an Android Emulator on demand. Using other custom tests will possibly require changes in the recipes repository.
|
||||
|
||||
When adding a new target make sure that the target platform is `Linux_android_emu`. This is done through the name of the target. This means that you can define your new target as something like:
|
||||
|
||||
```yaml
|
||||
- name: Linux_android_emu new_test_to_add
|
||||
```
|
||||
|
||||
This tells the CI that you want to use the `Linux` platform and your test is named `new_test_to_add`. See [.ci.yaml] (https://github.com/flutter/cocoon/blob/main/CI_YAML.md) for more details. The platform-level config already defines all necessary dimensions/properties that an emulator test needs.
|
||||
|
||||
The `dimensions` are a way to use the correct machine type with the supported virtualization, the `dependency` on the android_virtual_device tells the recipes framework that an emulator was requested and which api level to use and finally the `device_type` tells it to use a machine without a connected device. This will avoid issues with multiple devices found during testing.
|
||||
|
||||
### Target configs
|
||||
|
||||
Add any additional properties/dependencies your test may need.
|
||||
|
||||
```yaml
|
||||
name: Linux_android_emu new_test_to_add
|
||||
recipe: devicelab/devicelab_drone
|
||||
bringup: true
|
||||
properties:
|
||||
tags: >
|
||||
["framework","hostonly","linux"]
|
||||
task_name: android_views
|
||||
timeout: 60
|
||||
```
|
||||
|
||||
You will notice that `task_name` is new and the `tags` are new. The `task_name` is the name of your test script (minus the .dart suffix) and the tags allow infra to perform statistical analysis based on these in order to monitor SLO for task times, execution time as well as many other metrics.
|
||||
|
||||
The above target can be added and run assuming there exists a ·new_test_to_add.dart· file in the Flutter repo.
|
||||
@@ -0,0 +1,13 @@
|
||||
1. Find the benchmark that you're interested in on the [dashboard](https://flutter-dashboard.appspot.com/#/build) by clicking on the gear in the upper-right corner, and searching for it by "Task Name".
|
||||
|
||||
<img width="459" alt="Screenshot 2023-06-21 at 6 56 08 PM" src="https://github.com/flutter/flutter/assets/6343103/3e911534-7d2f-4668-8b63-2a23e8fe82ab">
|
||||
|
||||
2. Click on the column header icon.
|
||||
|
||||
<img width="600" alt="Screenshot 2023-06-21 at 6 59 36 PM" src="https://github.com/flutter/flutter/assets/6343103/a0371897-46e7-49ad-a732-66f0007044aa">
|
||||
|
||||
|
||||
3. Click on the build link corresponding to the commit that you're interested in.
|
||||
4. In the build page, expand the "log links" step.
|
||||
5. Download the "timeline.json" file.
|
||||
<img width="600" alt="Screenshot 2023-06-21 at 4 29 17 PM" src="https://github.com/flutter/flutter/assets/6343103/96265b6c-c6e5-413c-909d-580dbf208c29">
|
||||
121
docs/unsorted_wiki/How-to-write-a-memory-test-for-Flutter.md
Normal file
121
docs/unsorted_wiki/How-to-write-a-memory-test-for-Flutter.md
Normal file
@@ -0,0 +1,121 @@
|
||||
There are many ways to write a memory test for Flutter. In this article, we give 3 classes of example tests that are currently used by Flutter device lab. Memory performance is a high priority for Flutter so there are many new memory tools and test utilities in progress. We’ll add them in this doc in the future.
|
||||
|
||||
## [MemoryTest][class MemoryTest] that interacts with adb directly
|
||||
|
||||
These memory tests use the [MemoryTest class defined in the device lab perf_tests.dart][class MemoryTest] to poll adb directly before and after an overridable `useMemory` function. By default, `useMemory` will just run an app in release and wait for a “done” message to be printed in logcat.
|
||||
|
||||
Examples include
|
||||
- [`complex_layout_scroll_perf__memory`][complex layout memory manifest]
|
||||
- [device lab task file][complex layout memory task]
|
||||
- [main file][complex layout memory main]
|
||||
- [`fast_scroll_large_images_memory`][fast scroll memory manifest]
|
||||
- [device lab task file][fast scroll memory task]
|
||||
- [main file][fast scroll memory main]
|
||||
|
||||
To write a new MemoryTest case `some_memory_perf` and add it to Flutter’s device lab so Flutter’s CI system can measure it for each Flutter commit, follow examples above to
|
||||
|
||||
1. Create a `main` function for the test app in a file named like `test_memory/some_memory_perf.dart`.
|
||||
2. Add a `some_memory_perf` entry to [manifest.yaml][manifest]
|
||||
3. Add a `some_memory_perf.dart` file to [dev/devicelab/bin/tasks][tasks] folder.
|
||||
|
||||
|
||||
### Pros
|
||||
- Low overhead.
|
||||
- Works in all runtime modes, including release.
|
||||
- The test has complete control on when to start and stop the memory measurement.
|
||||
|
||||
### Cons
|
||||
- Only have 2 memory readings, begin and end, during the app run.
|
||||
- Polling ADB may trigger collections of the Java heap.
|
||||
- Only works on Android targets.
|
||||
- Requires a test environment with access to ADB.
|
||||
- Requires a host machine with Flutter SDK installed.
|
||||
|
||||
## DevTools Memory Test
|
||||
|
||||
The memory tests use DevTools to poll adb and Dart VM during a normal Flutter driver test run, which typically measures speed performance instead of memory performance. [DevToolsMemoryTest][class DevToolsMemoryTest] handles most of the process so a new test only needs to specify the driver test location.
|
||||
|
||||
Examples include
|
||||
- [`complex_layout_scroll_perf__devtools_memory`][complex layout devtools memory manifest]
|
||||
- [device lab task file][complex layout devtools memory task]
|
||||
- [`large_image_changer_perf_android`][large image changer manifest]
|
||||
- [device lab task file][large image changer task]
|
||||
|
||||
To write a new DevTools memory test case `some_memory_perf` and add it to Flutter’s device lab so Flutter’s CI system can measure it for each Flutter commit, follow examples above to
|
||||
|
||||
1. Write (or reuse) a normal Flutter driver test for the app in files named like `test_driver/some_memory_perf.dart` and `test_driver/some_memory_perf_test.dart`.
|
||||
2. Add a `some_memory_perf` entry to [manifest.yaml][manifest]
|
||||
3. Add a `some_memory_perf.dart` file to [dev/devicelab/bin/tasks][tasks] folder.
|
||||
|
||||
### Pros
|
||||
- Have finer grained measurements (~1 reading per second).
|
||||
- Also have Dart VM memory info.
|
||||
- Can easily turn a speed-focused driver test into a memory test.
|
||||
|
||||
### Cons
|
||||
- Don’t have much control on when to start and stop the measurement.
|
||||
- Polling ADB may trigger collections on the Java heap.
|
||||
- Requires a test environment with access to ADB.
|
||||
- Only works on Android targets.
|
||||
- Not available for release mode, so may incur extra memory overhead in profile or debug mode.
|
||||
- Requires a host machine with Flutter SDK installed.
|
||||
|
||||
## iOS Memory Test
|
||||
|
||||
The iOS embedding of Flutter supports sampling memory usage during runtime, which then writes metrics to the [Dart timeline][Dart timeline]. After recording a timeline for the relevant portion of an application’s execution, the timeline can be analyzed to obtain memory related information from the profile.
|
||||
|
||||
Examples include
|
||||
- [`large_image_changer_perf_ios`][large image changer manifest ios]
|
||||
- [device lab task file][large image changer task ios]
|
||||
|
||||
To write a new iOS memory test case `some_memory_perf` and add it to Flutter’s device lab so Flutter’s CI system can measure it for each Flutter commit, follow examples above to
|
||||
|
||||
1. Write (or reuse) a normal Flutter driver test for the app in files named like `test_driver/some_memory_perf.dart` and `test_driver/some_memory_perf_test.dart`.
|
||||
2. Add a `some_memory_perf` entry to [manifest.yaml][manifest]
|
||||
3. Add a `some_memory_perf.dart` file to [dev/devicelab/bin/tasks][tasks] folder that specifies `measureMemory: true`.
|
||||
|
||||
### Pros
|
||||
- Can be run on a machine that does not have the Flutter SDK installed.
|
||||
- Can adjust the sampling frequency so one can have as many or as few measurements as needed.
|
||||
- Each sampling has much less overhead compared to calling adb
|
||||
- Flutter driver tests on iOS get memory measurements for free.
|
||||
|
||||
### Cons
|
||||
- Only works on iOS targets.
|
||||
- Not available for release mode, so may incur extra memory overhead in profile or debug mode.
|
||||
- Memory polling mechanism may incur additional memory overhead.
|
||||
|
||||
|
||||
[manifest]: https://github.com/flutter/flutter/blob/master/dev/devicelab/manifest.yaml
|
||||
|
||||
[tasks]: https://github.com/flutter/flutter/tree/master/dev/devicelab/bin/tasks
|
||||
|
||||
[class MemoryTest]: https://github.com/flutter/flutter/blob/51bb11f7cece47840a9ee6d6d43db97ab16b31df/dev/devicelab/lib/tasks/perf_tests.dart#L941
|
||||
|
||||
[complex layout memory manifest]: https://github.com/flutter/flutter/blob/7e41425d4af21dec7a7ff072a3ec1387859e32c8/dev/devicelab/manifest.yaml#L329
|
||||
|
||||
[complex layout memory task]: https://github.com/flutter/flutter/blob/master/dev/devicelab/bin/tasks/complex_layout_scroll_perf__memory.dart
|
||||
|
||||
[complex layout memory main]: https://github.com/flutter/flutter/blob/master/dev/benchmarks/complex_layout/test_memory/scroll_perf.dart
|
||||
|
||||
[fast scroll memory manifest]: https://github.com/flutter/flutter/blob/7e41425d4af21dec7a7ff072a3ec1387859e32c8/dev/devicelab/manifest.yaml#L837
|
||||
|
||||
[fast scroll memory task]: https://github.com/flutter/flutter/blob/master/dev/devicelab/bin/tasks/fast_scroll_large_images__memory.dart
|
||||
|
||||
[fast scroll memory main]: https://github.com/flutter/flutter/blob/master/dev/benchmarks/macrobenchmarks/test_memory/large_images.dart
|
||||
|
||||
[class DevToolsMemoryTest]: https://github.com/flutter/flutter/blob/7e41425d4af21dec7a7ff072a3ec1387859e32c8/dev/devicelab/lib/tasks/perf_tests.dart#L1138
|
||||
|
||||
[complex layout devtools memory manifest]: https://github.com/flutter/flutter/blob/7e41425d4af21dec7a7ff072a3ec1387859e32c8/dev/devicelab/manifest.yaml#L359
|
||||
|
||||
[complex layout devtools memory task]: https://github.com/flutter/flutter/blob/master/dev/devicelab/bin/tasks/complex_layout_scroll_perf__devtools_memory.dart
|
||||
|
||||
[large image changer manifest]: https://github.com/flutter/flutter/blob/7e41425d4af21dec7a7ff072a3ec1387859e32c8/dev/devicelab/manifest.yaml#L874
|
||||
|
||||
[large image changer task]: https://github.com/flutter/flutter/blob/master/dev/devicelab/bin/tasks/large_image_changer_perf_android.dart
|
||||
|
||||
[Dart timeline]:https://flutter.dev/docs/development/tools/devtools/timeline
|
||||
|
||||
[large image changer manifest ios]: https://github.com/flutter/flutter/blob/7e41425d4af21dec7a7ff072a3ec1387859e32c8/dev/devicelab/manifest.yaml#L880
|
||||
|
||||
[large image changer task ios]: https://github.com/flutter/flutter/blob/master/dev/devicelab/bin/tasks/large_image_changer_perf_ios.dart
|
||||
@@ -0,0 +1,258 @@
|
||||
There are many ways to write a render speed test for Flutter. In this article, we give one example that uses [e2e][] (or [Flutter driver][flutter_driver]), the [dev/benchmarks/macrobenchmarks][macrobenchmarks] app, and the [dev/devicelab][devicelab] to automatically collect metrics for every future Flutter commit and send them to [flutter/cocoon][cocoon].
|
||||
|
||||
The instructions below are for contributors who want to expose a Flutter SDK (framework or engine) performance issue, or write pull requests to fix such issues. If one only needs to test the performance of a particular Flutter app, please reference
|
||||
- https://flutter.dev/docs/cookbook/testing/integration/introduction.
|
||||
- [https://flutter.dev/docs/perf/rendering](https://flutter.dev/docs/perf/rendering)
|
||||
|
||||
Since Flutter Web and Flutter Desktop are still in their early stages, the content here is only well tested and supported on mobile platforms (Android/iOS). We'll come up with docs on how to write performance tests for Web/Desktop later.
|
||||
|
||||
Throughout this doc, we assume that the render speed test is for some `super_important_case`.
|
||||
|
||||
## 1. Add a page to macrobenchmarks
|
||||
|
||||
The [macrobenchmarks][] is a Flutter app that includes many pages each of which corresponds to a specific performance test scenario. It provides some boilerplate code and auto-generated files so when a new scenario needs to be tested, one only needs to add a single page and a handful of files to the [Flutter repo][flutter_repo] instead of adding a new Flutter app with dozens of auto-generated files. (The "macro" means that it's benchmarking a big system, including the whole Flutter framework and engine, instead of just a micro Dart or C++ function.)
|
||||
|
||||
To add a new test scenario `super_important_case`, do the following:
|
||||
|
||||
1. Create a `super_important_case.dart` inside [macrobenchmarks/lib/src][] to define a `SuperImportantCasePage extends StatelessWidget {...}`. If there's a minimal Flutter app with a single `main.dart` file that reproduces the performance issue in the `super_important_case`, we'd often copy the content of that `main.dart` to `super_important_case.dart`.
|
||||
2. Add a `const String kSuperImportantCaseRouteName = '/super_important_case'` to [macrobenchmarks/lib/common.dart][] for later use.
|
||||
3. Open [macrobenchmarks/lib/main.dart][] and add the `kSuperImportantCaseRouteName: (BuildContext conttext) => SuperImportantCasePage(),` to the routes of [`MacrobenchmarksApp`][].
|
||||
4. Scroll down to [`HomePage`'s `ListView`][] and add the following `RaisedButton` so manual testers and the Flutter driver can tap it to navigate to the `super_important_case`.
|
||||
|
||||
```Dart
|
||||
RaisedButton(
|
||||
key: const Key(kSuperImportantCaseRouteName),
|
||||
child: const Text('Super Important Case'),
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(context, kSuperImportantCaseRouteName);
|
||||
},
|
||||
),
|
||||
```
|
||||
|
||||
## 2. Add an e2e test
|
||||
|
||||
When the `super_important_case` page above is finished and manually tested, one can then add an automated integration test to get some performance metrics as follows.
|
||||
|
||||
1. We use [macrobenchmarks/test_driver/e2e_test.dart][] as the host side script. All other tests depends on this file, so discuss with other Flutter members first if you want to change it.
|
||||
|
||||
2. Add `super_important_case_e2e.dart` to [macrobenchmarks/test][] with the following content. The `macroPerfTestE2E` function will navigate the macrobenchmarks app to the `super_important_case` page, and starts collecting performance metrics. The optional arguments are:
|
||||
- The `pageDelay` is the time delay for loading the page. By default it doesn't wait.
|
||||
- The `duration` is the performance metric sampling time.
|
||||
- The `timeout` specifies the backstop timeout implemented by the test package, See [testWidgets](https://api.flutter.dev/flutter/flutter_test/testWidgets.html).
|
||||
- The `body` provides custom ways of driving that page during the benchmark such as scrolling through lists. When this is used together with `duration`, the test will perform for which ever last longer.
|
||||
- The `setup` provides the operation needed to setup before benchmark starts.
|
||||
|
||||
|
||||
```Dart
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:macrobenchmarks/common.dart';
|
||||
|
||||
import 'util.dart';
|
||||
|
||||
void main() {
|
||||
macroPerfTestE2E(
|
||||
'super_important_case',
|
||||
kSuperImportantCaseRouteName,
|
||||
/* optional */ pageDelay: const Duration(seconds: 1),
|
||||
/* optional */ duration: const Duration(seconds: 3),
|
||||
/* optional */ timeout: const Duration(seconds: 30),
|
||||
/* optional */ body: (WidgetController controller) async {
|
||||
...
|
||||
},
|
||||
/* optional */ setup: (WidgetController controller) async {
|
||||
...
|
||||
},
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
Once all steps above are done, one should be able to run `flutter drive -t test/super_important_case_perf.dart --driver test_driver/e2e_test.dart` inside the [macrobenchmarks][] directory. After the driver test finished, the metrics should be written into a json file named `e2e_perf_summary.json` inside a temporary `build` directory under the current [macrobenchmarks][] directory.
|
||||
|
||||
|
||||
<!--- TODO explain what these metrics mean in the future -->
|
||||
Some useful metrics in that json file include
|
||||
- `average_frame_build_time_millis`
|
||||
- `average_frame_rasterization_time_millis`
|
||||
- `worst_frame_build_time_millis`
|
||||
- `worst_frame_rasterization_time_millis`
|
||||
|
||||
## 2a. Add a driver test (deprecated)
|
||||
|
||||
(Skip this if step 2 is sufficient for you.)
|
||||
|
||||
When the `super_important_case` page above is finished and manually tested, one can then add an automatic driver test to get some performance metrics as follows.
|
||||
|
||||
1. We use [macrobenchmarks/test_driver/run_app.dart] as the device side app. All other tests depends on this file, so discuss with other Flutter members first if you want to change it.
|
||||
|
||||
2. Add `super_important_case_perf_test.dart` to [macrobenchmarks/test_driver][] with the following content. The `macroPerfTest` function will navigate the macrobenchmarks app to the `super_important_case` page, and starts collecting performance metrics. The `driverOps` provides custom ways of driving that page during the benchmark such as scrolling through lists. The `setupOps` provides the operation needed to setup before benchmark starts.
|
||||
|
||||
```Dart
|
||||
import 'package:flutter_driver/flutter_driver.dart';
|
||||
import 'package:macrobenchmarks/common.dart';
|
||||
|
||||
import 'util.dart';
|
||||
|
||||
void main() {
|
||||
macroPerfTest(
|
||||
'super_important_case',
|
||||
kSuperImportantCaseRouteName,
|
||||
pageDelay: const Duration(seconds: 1),
|
||||
/* optional */ driverOps: (FlutterDriver driver) async {
|
||||
...
|
||||
},
|
||||
/* optional */ setupOps: (FlutterDriver driver) async {
|
||||
...
|
||||
},
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
Once all steps above are done, one should be able to run `flutter drive -t test_driver/run_app.dart --driver test_driver/super_important_case_perf.dart` inside the [macrobenchmarks][] directory. After the driver test finished, the metrics should be written into a json file named `super_important_case_perf__timeline_summary.json` inside a temporary `build` directory under the current [macrobenchmarks][] directory.
|
||||
|
||||
|
||||
<!--- TODO explain what these metrics mean in the future -->
|
||||
Some useful metrics in that json file include
|
||||
- `average_frame_build_time_millis`
|
||||
- `average_frame_rasterization_time_millis`
|
||||
- `worst_frame_build_time_millis`
|
||||
- `worst_frame_rasterization_time_millis`
|
||||
|
||||
## 3. Update README
|
||||
|
||||
Add the new test to the list in [macrobenchmarks/README.md].
|
||||
|
||||
## 4. Add a task to devicelab
|
||||
|
||||
To keep Flutter performant, running a test locally once in a while and check the metrics manually is insufficient. The following steps let the [devicelab][] run the test automatically for every Flutter commit so performance regressions or speedups for the `super_important_case` can be detected quickly.
|
||||
|
||||
1. Add `super_important_case_perf__e2e_summary` to [dev/devicelab/manifest.yaml][] under `tasks`. Follow other tasks to properly set descriptions and choose agent such as `linux/android` (Moto G4) or `mac/ios` (iPhone 6s). Mark it `flaky: true` so that while we observe the test case behavior on devicelab, we don't block the build tree.
|
||||
|
||||
2. Add `super_important_case_perf__e2e_summary.dart` to [dev/devicelab/bin/tasks][] with a content like
|
||||
|
||||
```Dart
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android; // or ios
|
||||
await task(createSuperImportantCasePerfE2ETest());
|
||||
}
|
||||
```
|
||||
|
||||
3. Add the following `createSuperImportantCasePerfTest` function to [dev/devicelab/lib/tasks/perf_tests.dart][]
|
||||
|
||||
```Dart
|
||||
TaskFunction createSuperImportantCasePerfE2ETest() {
|
||||
return PerfTest.e2e(
|
||||
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
|
||||
'test/super_important_case_e2e.dart',
|
||||
).run;
|
||||
}
|
||||
```
|
||||
|
||||
4. Locally test the devicelab task by running `../../bin/cache/dart-sdk/bin/dart bin/run.dart -t super_important_case_perf__e2e_summary` inside the [dev/devicelab][devicelab] directory with an Android or iOS device connected. You should see a success and a summary of metrics being printed out.
|
||||
|
||||
5. Submit a pull request of everything above.
|
||||
|
||||
6. Finally, remove `flaky: true` once the test is proven to be reliable for a few days. Since this may take a while, creating a reminder calendar event could be a good idea.
|
||||
|
||||
## 4a. Add a task to devicelab for driver tests (deprecated)
|
||||
|
||||
(Skip this if you didn't do step 2a.)
|
||||
|
||||
To keep Flutter performant, running a test locally once in a while and check the metrics manually is insufficient. The following steps let the [devicelab][] run the test automatically for every Flutter commit so performance regressions or speedups for the `super_important_case` can be detected quickly.
|
||||
|
||||
1. Add `super_important_case_perf__timeline_summary` to [dev/devicelab/manifest.yaml][] under `tasks`. Follow other tasks to properly set descriptions and choose agent such as `linux/android` (Moto G4) or `mac/ios` (iPhone 6s).
|
||||
|
||||
2. Add `super_important_case_perf__timeline_summary.dart` to [dev/devicelab/bin/tasks][] with a content like
|
||||
|
||||
```Dart
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android; // or ios
|
||||
await task(createSuperImportantCasePerfTest());
|
||||
}
|
||||
```
|
||||
|
||||
3. Add the following `createSuperImportantCasePerfTest` function to [dev/devicelab/lib/tasks/perf_tests.dart][]
|
||||
|
||||
```Dart
|
||||
TaskFunction createSuperImportantCasePerfTest() {
|
||||
return PerfTest(
|
||||
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
|
||||
'test_driver/run_app.dart',
|
||||
'super_important_case_perf',
|
||||
testDriver: 'test_driver/super_important_case_perf_test.dart',
|
||||
).run;
|
||||
}
|
||||
```
|
||||
|
||||
4. Locally test the devicelab task by running `../../bin/cache/dart-sdk/bin/dart bin/run.dart -t super_important_case_perf__timeline_summary` inside the [dev/devicelab][devicelab] directory with an Android or iOS device connected. You should see a success and a summary of metrics being printed out.
|
||||
|
||||
5. Submit a pull request of everything above.
|
||||
|
||||
6. Finally, remove `flaky: true` once the test is proven to be reliable for a few days. Since this may take a while, creating a reminder calendar event could be a good idea.
|
||||
|
||||
## 5. Set benchmark baseline
|
||||
|
||||
Tasks will be run automatically in the [devicelab], and the result is shown in [flutter-dashboard]. Set the baseline in [flutter-dashboard] once the new test gets enough data. Also for metrics like "vsync_transitions_missed", change the unit from default ms to frames or other suitable units.
|
||||
|
||||
## Acknowledgement
|
||||
|
||||
Big congratulations if you've successfully finished all steps above! You just made a big contribution to Flutter's performance. Please also feel encouraged to improve this doc to help future contributors (which probably include a future yourself that would forget something above in a few months)!
|
||||
|
||||
<!-- Reference links below -->
|
||||
[flutter_driver]: https://github.com/flutter/flutter/tree/master/packages/flutter_driver
|
||||
|
||||
[macrobenchmarks]: https://github.com/flutter/flutter/tree/master/dev/benchmarks/macrobenchmarks
|
||||
|
||||
[cocoon]: https://github.com/flutter/cocoon
|
||||
|
||||
[devicelab]: https://github.com/flutter/flutter/tree/master/dev/devicelab
|
||||
|
||||
[dev/devicelab/manifest.yaml]: https://github.com/flutter/flutter/tree/master/dev/devicelab/manifest.yaml
|
||||
|
||||
[flutter_repo]: https://github.com/flutter/flutter
|
||||
|
||||
[macrobenchmarks/lib/src]: https://github.com/flutter/flutter/tree/master/dev/benchmarks/macrobenchmarks/lib/src
|
||||
|
||||
[macrobenchmarks/lib/common.dart]: https://github.com/flutter/flutter/tree/master/dev/benchmarks/macrobenchmarks/lib/common.dart
|
||||
|
||||
[macrobenchmarks/lib/main.dart]: https://github.com/flutter/flutter/tree/master/dev/benchmarks/macrobenchmarks/lib/main.dart
|
||||
|
||||
[`MacrobenchmarksApp`]: https://github.com/flutter/flutter/blob/94b7ff241e6e5445b7f30215a777eb4971311797/dev/benchmarks/macrobenchmarks/lib/main.dart#L24
|
||||
|
||||
[`HomePage`'s `ListView`]: https://github.com/flutter/flutter/blob/94b7ff241e6e5445b7f30215a777eb4971311797/dev/benchmarks/macrobenchmarks/lib/main.dart#L58
|
||||
|
||||
[macrobenchmarks/test_driver]: https://github.com/flutter/flutter/tree/master/dev/benchmarks/macrobenchmarks/test_driver
|
||||
|
||||
[macrobenchmarks/test_driver/run_app.dart]: https://github.com/flutter/flutter/tree/master/dev/benchmarks/macrobenchmarks/test_driver/run_app.dart
|
||||
|
||||
[macrobenchmarks/README.md]: https://github.com/flutter/flutter/blob/master/dev/benchmarks/macrobenchmarks/README.md
|
||||
|
||||
[dev/devicelab/bin/tasks]: https://github.com/flutter/flutter/tree/master/dev/devicelab/bin/tasks
|
||||
|
||||
[dev/devicelab/lib/tasks/perf_tests.dart]: https://github.com/flutter/flutter/tree/master/dev/devicelab/lib/tasks/perf_tests.dart
|
||||
|
||||
[flutter-dashboard]: https://flutter-dashboard.appspot.com/benchmarks.html
|
||||
|
||||
[e2e]: https://pub.dev/packages/e2e
|
||||
|
||||
[macrobenchmarks/test_driver/e2e_test.dart]: https://github.com/flutter/flutter/blob/master/dev/benchmarks/macrobenchmarks/test_driver/e2e_test.dart
|
||||
|
||||
[macrobenchmarks/test]: https://github.com/flutter/flutter/blob/master/dev/benchmarks/macrobenchmarks/test
|
||||
396
docs/unsorted_wiki/Hybrid-Composition.md
Normal file
396
docs/unsorted_wiki/Hybrid-Composition.md
Normal file
@@ -0,0 +1,396 @@
|
||||
Hybrid composition refers to the ability of composing native views alongside Flutter widgets. For example, displaying the native Webview inside a Flutter app.
|
||||
|
||||
## Android
|
||||
*Requires API level 19*
|
||||
|
||||
_See also: [[Texture Layer Hybrid Composition]]_
|
||||
|
||||
Starting from Flutter 1.20.0, hybrid composition can be used on Android. This new feature fixes most of the [issues with the preview platform view approach](https://github.com/flutter/flutter/wiki/Virtual-Display#associated-problems-and-workarounds) (Virtual Display); in particular, accessibility and keyboard related issues. See also [[Android Platform Views]] for an overview of modes.
|
||||
|
||||
To see all known issues specific to this mode, search for the [`hc-only` label](https://github.com/flutter/flutter/labels/hc-only).
|
||||
|
||||
### Dart side
|
||||
|
||||
To start using this feature, you would need to create a `Widget`, and add the following `build` implementation:
|
||||
|
||||
`native_view_example.dart`
|
||||
|
||||
1. Add imports:
|
||||
```dart
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
```
|
||||
|
||||
2. Implement `build` method:
|
||||
```dart
|
||||
Widget build(BuildContext context) {
|
||||
// This is used in the platform side to register the view.
|
||||
final String viewType = 'hybrid-view-type';
|
||||
// Pass parameters to the platform side.
|
||||
final Map<String, dynamic> creationParams = <String, dynamic>{};
|
||||
|
||||
return PlatformViewLink(
|
||||
viewType: viewType,
|
||||
surfaceFactory:
|
||||
(BuildContext context, PlatformViewController controller) {
|
||||
return AndroidViewSurface(
|
||||
controller: controller,
|
||||
gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},
|
||||
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
|
||||
);
|
||||
},
|
||||
onCreatePlatformView: (PlatformViewCreationParams params) {
|
||||
return PlatformViewsService.initSurfaceAndroidView(
|
||||
id: params.id,
|
||||
viewType: viewType,
|
||||
layoutDirection: TextDirection.ltr,
|
||||
creationParams: creationParams,
|
||||
creationParamsCodec: StandardMessageCodec(),
|
||||
)
|
||||
..addOnPlatformViewCreatedListener(params.onPlatformViewCreated)
|
||||
..create();
|
||||
},
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
For more documentation see: [PlatformViewLink](https://api.flutter.dev/flutter/widgets/PlatformViewLink-class.html), [AndroidViewSurface](https://api.flutter.dev/flutter/widgets/AndroidViewSurface-class.html), [PlatformViewsService](https://api.flutter.dev/flutter/services/PlatformViewsService-class.html).
|
||||
|
||||
### Platform side
|
||||
|
||||
Finally, on the platform side, you use the standard `io.flutter.plugin.platform` package in Java or Kotlin:
|
||||
|
||||
`NativeView.java`
|
||||
|
||||
```java
|
||||
package dev.flutter.example;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import io.flutter.plugin.platform.PlatformView;
|
||||
|
||||
class NativeView implements PlatformView {
|
||||
@NonNull private final TextView textView;
|
||||
|
||||
NativeView(@NonNull Context context, int id, @Nullable Map<String, Object> creationParams) {
|
||||
textView = new TextView(context);
|
||||
textView.setTextSize(72);
|
||||
textView.setBackgroundColor(Color.rgb(255, 255, 255));
|
||||
textView.setText("Rendered on a native Android view (id: " + id + ")");
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View getView() {
|
||||
return textView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {}
|
||||
}
|
||||
```
|
||||
|
||||
`NativeViewFactory.java`
|
||||
|
||||
```java
|
||||
package dev.flutter.example;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.NonNull;
|
||||
import io.flutter.plugin.common.BinaryMessenger;
|
||||
import io.flutter.plugin.common.StandardMessageCodec;
|
||||
import io.flutter.plugin.platform.PlatformView;
|
||||
import io.flutter.plugin.platform.PlatformViewFactory;
|
||||
import java.util.Map;
|
||||
|
||||
class NativeViewFactory extends PlatformViewFactory {
|
||||
@NonNull private final BinaryMessenger messenger;
|
||||
@NonNull private final View containerView;
|
||||
|
||||
NativeViewFactory(@NonNull BinaryMessenger messenger, @NonNull View containerView) {
|
||||
super(StandardMessageCodec.INSTANCE);
|
||||
this.messenger = messenger;
|
||||
this.containerView = containerView;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public PlatformView create(@NonNull Context context, int id, @Nullable Object args) {
|
||||
final Map<String, Object> creationParams = (Map<String, Object>) args;
|
||||
return new NativeView(context, id, creationParams);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Register the platform view. This can be done in an app or a plugin.
|
||||
|
||||
For app registration, modify the main activity (e.g. `MainActivity.java`):
|
||||
|
||||
```java
|
||||
package dev.flutter.example;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import io.flutter.embedding.android.FlutterActivity;
|
||||
import io.flutter.embedding.engine.FlutterEngine;
|
||||
|
||||
public class MainActivity extends FlutterActivity {
|
||||
@Override
|
||||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
|
||||
flutterEngine
|
||||
.getPlatformViewsController()
|
||||
.getRegistry()
|
||||
.registerViewFactory("<platform-view-type>", new NativeViewFactory());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For plugin registration, modify the main plugin file (e.g. `PlatformViewPlugin.java`):
|
||||
|
||||
```java
|
||||
package dev.flutter.plugin.example;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin;
|
||||
import io.flutter.plugin.common.BinaryMessenger;
|
||||
|
||||
public class PlatformViewPlugin implements FlutterPlugin {
|
||||
@Override
|
||||
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
|
||||
binding
|
||||
.getFlutterEngine()
|
||||
.getPlatformViewsController()
|
||||
.getRegistry()
|
||||
.registerViewFactory("<platform-view-type>", new NativeViewFactory());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For more documentation, see [PlatformViewRegistry](https://api.flutter.dev/javadoc/io/flutter/plugin/platform/PlatformViewRegistry.html), [PlatformViewFactory](https://api.flutter.dev/javadoc/io/flutter/plugin/platform/PlatformViewFactory.html), and [PlatformView](https://api.flutter.dev/javadoc/io/flutter/plugin/platform/PlatformView.html).
|
||||
|
||||
Finally, indicate the minimum API Level required for the application to run in `build.gradle`.
|
||||
|
||||
```groovy
|
||||
android {
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
}
|
||||
}
|
||||
```
|
||||
## iOS
|
||||
|
||||
_See also: [[Hybrid Composition iOS]]_
|
||||
|
||||
In Flutter 1.22, platform views are enabled by default. This means
|
||||
that it's no longer required to add the
|
||||
`io.flutter.embedded_views_preview` flag to `Info.plist`.
|
||||
|
||||
To create a platform view on iOS, follow these steps:
|
||||
|
||||
### On the Dart side
|
||||
|
||||
On the Dart side, create a `Widget`
|
||||
and add the following build implementation,
|
||||
as shown in the following steps.
|
||||
|
||||
In your Dart file, for example `native_view_example.dart`,
|
||||
do the following:
|
||||
|
||||
1. Add the following imports:
|
||||
|
||||
<!-- skip -->
|
||||
```dart
|
||||
import 'package:flutter/widget.dart';
|
||||
```
|
||||
|
||||
|
||||
2. Implement a `build()` method:
|
||||
|
||||
<!-- skip -->
|
||||
```dart
|
||||
Widget build(BuildContext context) {
|
||||
// This is used in the platform side to register the view.
|
||||
final String viewType = '<platform-view-type>';
|
||||
// Pass parameters to the platform side.
|
||||
final Map<String, dynamic> creationParams = <String, dynamic>{};
|
||||
|
||||
return UiKitView(
|
||||
viewType: viewType,
|
||||
layoutDirection: TextDirection.ltr,
|
||||
creationParams: creationParams,
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
For more information, see the API docs for:
|
||||
[`UIKitView`](https://api.flutter.dev/flutter/widgets/UiKitView-class.html).
|
||||
|
||||
### On the platform side
|
||||
|
||||
In your native code, implement the following:
|
||||
|
||||
`FLNativeView.h`
|
||||
|
||||
```objc
|
||||
#import <Flutter/Flutter.h>
|
||||
|
||||
@interface FLNativeViewFactory : NSObject <FlutterPlatformViewFactory>
|
||||
- (instancetype)initWithMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
|
||||
@end
|
||||
|
||||
@interface FLNativeView : NSObject <FlutterPlatformView>
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
viewIdentifier:(int64_t)viewId
|
||||
arguments:(id _Nullable)args
|
||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
|
||||
|
||||
- (UIView*)view;
|
||||
@end
|
||||
```
|
||||
|
||||
Implement the factory and the platform view in `FLNativeView.m`
|
||||
|
||||
```objc
|
||||
#import "FLNativeView.h"
|
||||
|
||||
@implementation FLNativeViewFactory {
|
||||
NSObject<FlutterBinaryMessenger>* _messenger;
|
||||
}
|
||||
|
||||
- (instancetype)initWithMessenger:(NSObject<FlutterBinaryMessenger>*)messenger {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_messenger = messenger;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSObject<FlutterPlatformView>*)createWithFrame:(CGRect)frame
|
||||
viewIdentifier:(int64_t)viewId
|
||||
arguments:(id _Nullable)args {
|
||||
return [[FLNativeView alloc] initWithFrame:frame
|
||||
viewIdentifier:viewId
|
||||
arguments:args
|
||||
binaryMessenger:_messenger];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation FLNativeView {
|
||||
UIView *_view;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
viewIdentifier:(int64_t)viewId
|
||||
arguments:(id _Nullable)args
|
||||
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger {
|
||||
if (self = [super init]) {
|
||||
_view = [[UIView alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (UIView*)view {
|
||||
return _view;
|
||||
}
|
||||
|
||||
@end
|
||||
```
|
||||
|
||||
Finally, register the platform view. This can be done in an app or a plugin.
|
||||
|
||||
|
||||
For app registration, modify the App's `AppDelegate.m`:
|
||||
|
||||
```objc
|
||||
#import "AppDelegate.h"
|
||||
#import "FLNativeView.h"
|
||||
#import "GeneratedPluginRegistrant.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application
|
||||
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
[GeneratedPluginRegistrant registerWithRegistry:self];
|
||||
|
||||
NSObject<FlutterPluginRegistrar>* registrar =
|
||||
[self registrarForPlugin:@"plugin-name"];
|
||||
|
||||
FLNativeViewFactory* factory =
|
||||
[[FLNativeViewFactory alloc] initWithMessenger:registrar.messenger];
|
||||
[[self registrarForPlugin:@"<plugin-name>"] registerViewFactory:factory
|
||||
withId:@"<platform-view-type>"];
|
||||
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
||||
}
|
||||
|
||||
@end
|
||||
```
|
||||
|
||||
For plugin registration, modify the main plugin file (e.g. `FLPlugin.m`):
|
||||
|
||||
```objc
|
||||
#import "FLPlugin.h"
|
||||
#import "FLNativeView.h"
|
||||
|
||||
@implementation FLPlugin
|
||||
|
||||
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
|
||||
FLNativeViewFactory* factory =
|
||||
[[FLNativeViewFactory alloc] initWithMessenger:registrar.messenger];
|
||||
[registrar registerViewFactory:factory withId:@"<platform-view-type>"];
|
||||
}
|
||||
|
||||
@end
|
||||
```
|
||||
|
||||
For more information, see the API docs for:
|
||||
|
||||
* [`FlutterPlatformViewFactory`](https://api.flutter.dev/objcdoc/Protocols/FlutterPlatformViewFactory.html)
|
||||
* [`FlutterPlatformView`](https://api.flutter.dev/objcdoc/Protocols/FlutterPlatformView.html)
|
||||
* [`PlatformView`](https://api.flutter.dev/javadoc/io/flutter/plugin/platform/PlatformView.html)
|
||||
|
||||
By default, the `UIKitView` widget appends the native `UIView` to the view hierarchy. For more documentation, see [UIKitView](https://api.flutter.dev/flutter/widgets/UiKitView-class.html).
|
||||
|
||||
## Performance
|
||||
|
||||
Platform views in Flutter come with performance trade-offs.
|
||||
|
||||
For example, in a typical Flutter app, the Flutter UI is composed
|
||||
on a dedicated raster thread. This allows Flutter apps to be fast,
|
||||
as the main platform thread is rarely blocked.
|
||||
|
||||
While a platform view is rendered with Hybrid Composition, the Flutter UI is composed from
|
||||
the platform thread, which competes with other tasks like
|
||||
handling OS or plugin messages, etc.
|
||||
|
||||
Prior to Android 10, Hybrid Composition copies each Flutter frame
|
||||
out of the graphic memory into main memory and then copied back to
|
||||
a GPU texture. As this copy happens per frame, the performance of
|
||||
the entire Flutter UI may be impacted.
|
||||
|
||||
On the other hand, Virtual Display makes each pixel of the native view
|
||||
flow through additional intermediate graphic buffers, which cost graphic
|
||||
memory and drawing performance.
|
||||
|
||||
For complex cases, there are some techniques that can be used to mitigate
|
||||
these issues.
|
||||
|
||||
For example, you could use a placeholder texture while an animation is
|
||||
happening in Dart. In other words, if an animation is slow while a
|
||||
platform view is rendered, then consider taking a screenshot of the
|
||||
native view and rendering it as a texture.
|
||||
|
||||
For more information, see:
|
||||
|
||||
* [`TextureLayer`](https://api.flutter.dev/flutter/rendering/TextureLayer-class.html)
|
||||
* [`TextureRegistry`](https://api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.html)
|
||||
* [`FlutterTextureRegistry`](https://api.flutter.dev/objcdoc/Protocols/FlutterTextureRegistry.html)
|
||||
11
docs/unsorted_wiki/Image-Codecs-in-the-Flutter-Engine.md
Normal file
11
docs/unsorted_wiki/Image-Codecs-in-the-Flutter-Engine.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Image Codecs in the Flutter Engine
|
||||
|
||||
Flutter has built-in support for a number of common codecs. Images in the supported formats can be decompressed by the Flutter Engine even if they are not supported by the underlying platform.
|
||||
|
||||
However, each codec supported out-of-the-box by the Flutter Engine adds to the binary size of the engine. Unlike AOT compiled Dart code, this binary size increase cannot be tree shaken away. Every user of the Flutter application will be forced to download the codec irrespective of whether their Flutter applications actually decompress images of that type. Flutter users and developers are extremely sensitive to increases in binary size of the application.
|
||||
|
||||
If the Flutter engine is unable to decompress specific images because it doesn’t support that codec, it will delegate responsibility of image decompression to the platform. This comes in handy if the platform has support for newer or less widely used codecs. The downside of course is that the application author will need to provide an alternative in case both the engine and platform don’t support a specific codec.
|
||||
|
||||
If the application wishes to support a codec that isn’t supported by either the engine or the platform, it will have to ship the codec along with their application and expose its functionality via a plugin. This is more cumbersome but the current recommendation for applications for whom support for specific formats is table stakes.
|
||||
|
||||
Speculatively adding and removing codecs into the Flutter engine may lead to fragmentation in the supported codecs across Flutter engine versions. But, if a format does become widely used, it strengthens the case for adding the codec to the engine in spite of the binary size increase.
|
||||
19
docs/unsorted_wiki/Impeller-Scene.md
Normal file
19
docs/unsorted_wiki/Impeller-Scene.md
Normal file
@@ -0,0 +1,19 @@
|
||||
We are excited to have you tinker on [the Impeller Scene Demo presented at Flutter Forward](https://www.youtube.com/live/zKQYGKAe5W8?feature=share&t=7048). While we spend time learning the use-cases and finalizing the API, the functionality for Impeller Scene is behind a compile-time flag. During this time, there are no guarantees around API stability.
|
||||
|
||||
**Compiling the Engine**
|
||||
|
||||
- Configure your Mac host to compile the Flutter Engine by [following the guidance in wiki](https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment).
|
||||
- Ensure that you are on the [main branch of the Flutter Engine](https://github.com/flutter/engine/tree/main).
|
||||
- Ensure that you are on the [main branch of the Flutter Framework](https://github.com/flutter/flutter/tree/main).
|
||||
- Configure the host build: `./flutter/tools/gn --enable-impeller-3d --no-lto`
|
||||
- Configure the iOS build: `./flutter/tools/gn --enable-impeller-3d --no-lto --ios`
|
||||
- Add the `--simulator --simulator-cpu=arm64` flag to the iOS build if you are going to test on the simulator.
|
||||
- Build host artifacts (this will take a while): `ninja -C out/host_debug`
|
||||
- Build iOS artifacts (this will take a while): `ninja -C out/ios_debug`
|
||||
- If targeting the simulator: `ninja -C out/ios_debug_sim_arm64`
|
||||
- Clone the demo repository: `git clone https://github.com/bdero/flutter-scene-example.git` and move into the directory.
|
||||
- Plug in your device or open `Simulator.app`, then run `flutter devices` to note the device identifier.
|
||||
- Run the demo application: `flutter run -d [device_id] --local-engine ios_debug --local-engine-host host_debug` (or `ios_debug_sim_arm64` if you are running on the Simulator).
|
||||
- On Silicon Macs, prefer `--local-engine-host host_debug_arm64` (adjusting your `ninja` command above accordingly)
|
||||
|
||||
We hope to continue evolving the API and have it available on the stable channel soon!
|
||||
7
docs/unsorted_wiki/Impeller.md
Normal file
7
docs/unsorted_wiki/Impeller.md
Normal file
@@ -0,0 +1,7 @@
|
||||
_For user information about Flutter's new rendering backend, check out [Impeller preview](https://docs.flutter.dev/perf/impeller)._
|
||||
|
||||
Team-facing documentation specific to Impeller:
|
||||
|
||||
- [[Setting up MoltenVK on macOS for Impeller]]
|
||||
- [[Flutter GPU]]
|
||||
- [[Instructions for playing with the Impeller Scene demo|Impeller Scene]]
|
||||
7
docs/unsorted_wiki/In-case-of-emergency.md
Normal file
7
docs/unsorted_wiki/In-case-of-emergency.md
Normal file
@@ -0,0 +1,7 @@
|
||||
## If flutter.dev is down
|
||||
|
||||
If one of our web sites is down, please ping `@emergency` on our [[Discord server|Chat]].
|
||||
|
||||
## If you find a security vulnerability
|
||||
|
||||
Please see our [security policy](https://docs.flutter.dev/security#reporting-vulnerabilities) for instructions.
|
||||
75
docs/unsorted_wiki/Infra-Ticket-Queue.md
Normal file
75
docs/unsorted_wiki/Infra-Ticket-Queue.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Quick Links
|
||||
* [Ticket queue kanban board](https://github.com/orgs/flutter/projects/81)
|
||||
* [Build dashboards](https://flutter-dashboard.appspot.com/)
|
||||
* [Current on-call](https://rotations.corp.google.com/rotation/5729708174999552) (Google internal link)
|
||||
|
||||
# Background
|
||||
|
||||
The Flutter infra team uses a ticket queue to manage operational tasks, such as:
|
||||
* Configuration requests: "Please add a new LUCI builder"
|
||||
* Outage/degradation notifications: "Build dashboard is down/slow"
|
||||
* Requests for help: "How do I debug a test on devicelab machine X?"
|
||||
|
||||
This allows the team to separate their engineering work from ["toil" work](https://landing.google.com/sre/sre-book/chapters/eliminating-toil/). It also lets them see which types of tasks are common and worth automating.
|
||||
|
||||
IMPORTANT: Whenever you have a request for the infra team, please file a ticket instead of contacting team members directly, even for seemingly trivial things or even if an individual has done the same thing for you in the past. Infra on-call will be there to handle your request, and it lets non on-call team members focus on their engineering tasks.
|
||||
|
||||
When in doubt, ask on the `#hackers-infra` channel in [[Chat]].
|
||||
|
||||
# How to File a Ticket as an Infra Customer
|
||||
1. Open a [new infra issue](https://github.com/flutter/flutter/issues/new?assignees=&labels=team-infra&projects=&template=6_infrastructure.yml). (That template summarizes the information on this page.)
|
||||
2. Add a descriptive **title**. A message like "Add a LUCI builder for linux web engine" or "Debug gallery startup" is much more helpful than "quick request" or "test doesn't work?".
|
||||
3. Clearly describe the issue or request in the description field. For example, if a ticket is requesting running several commands on the bots, the ticket should explain why, what commands are needed, on which bots and how to verify the results.
|
||||
4. Skip the priority label which infra on-call will add after triaging.
|
||||
5. **Add the project "Infra Ticket Queue".** This is the step that is important to get it into the queue!
|
||||
6. Click the **Submit new issue** button. No need to set an **assignee**; infra on-call will handle all new tickets.
|
||||
|
||||
Please note that **the ticket queue is meant for high priority P0 and P1 issues** and should not be used to file low priority issues like feature requests or minor bugs. We have another separate weekly triage meeting that will look through ALL of the open infra issues. The ticket queue should only be used for issues that fall into the following categories, which should be very rare:
|
||||
|
||||
* Build break or regression.
|
||||
* Critical work is blocked without a workaround.
|
||||
* An immediate-level incident will happen if this is not addressed (e.g., almost out of quota).
|
||||
* Degraded service (Build bots work but are slow to start).
|
||||
* Other time-sensitive requests.
|
||||
|
||||
# How to Serve Tickets as an Infra On-call
|
||||
Below are instructions for infra on-call on how to process the ticket queue. It describes the processes that on-call should follow, along with useful tips and tricks. If you are on call and see a problem or omission on this page, please change it!
|
||||
|
||||
## Triaging
|
||||
SLO: A ticket in the queue will be triaged within 4 business hours provided it is opened during regularly kept office hours (9 a.m. to 5 p.m. PST). Otherwise it will be triaged the following business day.
|
||||
|
||||
The issue priorities can be found [here](https://github.com/flutter/flutter/wiki/Issue-hygiene#priorities). Issues that are **not P0 or P1** will still be seen (during the infra weekly triage meeting) but do not belong on the ticket queue.
|
||||
|
||||
New, un-triaged tickets will be in the **New** column in [the ticket queue](https://github.com/orgs/flutter/projects/81/views/1).
|
||||
|
||||
When a new ticket comes in, an on-call should:
|
||||
1. Double check to see if the issue is a duplicate and close with a reference to the existing open issue.
|
||||
2. Check the issue summary and description. If the summary isn't clear, clarify it.
|
||||
3. Validate that the priority of the issue is accurate.
|
||||
4. Move triaged issues to the **Triaged** column.
|
||||
5. Assign the issue to the correct team member.
|
||||
|
||||
This is meant to be quick and mechanical, and doesn't require a lot of thought. Even if you don't have time to take any immediate action, it's helpful to keep the new column empty. Your marking it triaged also lets the ticket creator know that someone has seen it.
|
||||
|
||||
## Serving
|
||||
Once all tickets have been triaged, on-call's job is to service them. Apply judgement regarding which is most pressing. The order will also depend on your expertise and how much time you have. If a lower-priority ticket can be resolved in a couple minutes, don't feel like it has to wait behind a higher-priority ticket.
|
||||
|
||||
From the top of the priority queue down, on-call makes sure that someone is working on each ticket. It's important to keep things moving if you see that they're stuck; try CC'ing people with more information and making it clear what a given ticket is blocked on.
|
||||
|
||||
1. Set the assignee. Read the [guideline](https://github.com/flutter/flutter/wiki/Issue-hygiene#assigning-issues) first. In addition:
|
||||
* All tickets must be assigned to someone who is working on them.
|
||||
2. Start working on the ticket
|
||||
* Set the status to "in progress", typically by dragging its card to the **In progress** column.
|
||||
* Add a comment, if you think it helps.
|
||||
3. P0 issue should be updated daily and P1 issue should be updated weekly, since many people may be blocked and will be waiting for updates.
|
||||
4. Update the ticket's workflow state when you reach a stopping point
|
||||
* If it's closed, move it to **Done**.
|
||||
* If it's blocked on something else, make it clear in the comments.
|
||||
* If you (or the assignee) can no longer work on the ticket, find a new owner or move it back to **New**.
|
||||
* If you're heading home for the day, add a final status update, especially if they're not going to get resolved in their urgency window.
|
||||
|
||||
When servicing a ticket as an on-call, remember that **it is not your responsibility to fix every ticket, only to make sure that someone is working on it**. You may not be the most appropriate person to do the work, but you make sure the work gets done. This goes for new tickets as well as older tickets that someone has claimed but dropped on the floor -- some of those tickets may even have been created and assigned during the previous on-call shift, so it's important to check up on older tickets and re-assign if necessary.
|
||||
|
||||
## Handoff
|
||||
|
||||
On Monday during the 15-minute handoff meeting, please add comments and update the status on any tickets on which you have context, as this will help the next on-call person ramp up and understand the coming workload.
|
||||
@@ -0,0 +1,82 @@
|
||||
IntelliJ is a full-featured IDE; it supports refactorings, code navigation, debugging, searching, and source control integration.
|
||||
|
||||
The following is a subjective take on getting IntelliJ to be a bit more lightweight (and slightly speedier) editor. Your mileage may vary.
|
||||
|
||||
## Less Chrome
|
||||
|
||||
Less is more! You can hide the IntelliJ toolbar and status line. You're still left with IntelliJ's tool buttons - buttons around the exterior allowing you to toggle visibility of different views - and the navigation bar, for common run actions.
|
||||
|
||||
From the View menu, toggle off the Toolbar and Status Bar:
|
||||
|
||||

|
||||
|
||||
## Breadcrumbs
|
||||
|
||||
The breadcrumbs view shows at the top of each editor. This view adds visual noise to the UI. To disable it, open the Settings view (ctrl-alt-s) and search for 'breadcrumbs'.
|
||||
|
||||

|
||||
|
||||
## Line numbers
|
||||
|
||||
Perhaps more controversially, you can disable line numbers in the UI as well. Similarly to disabling breadcrumbs, open the Settings dialog and search for 'line numbers'.
|
||||
|
||||

|
||||
|
||||
## Code folding
|
||||
|
||||
Some people disable it. Whether it adds value is highly subjective; your mileage may vary. In Settings, search for 'code folding'. Uncheck all the checkboxes under 'collapse by default'.
|
||||
|
||||
## The structure view
|
||||
|
||||
Also called the outline view in other tools. If you have a Dart file open this view will show the class and method structure for the file. This can be invaluable for quickly getting a sense of the structure of a file and for knowing where you are in one.
|
||||
|
||||
By default this is inline with the Project view on the left side of the IDE window. This can make it difficult to see your project structure and the structure of your current library at the same time. You can drag the various views around to dock in exterior of your window. To experiment, drag the 'Structure' tab from the left side of the window and dock it on the right-hand side:
|
||||
|
||||

|
||||
|
||||
## Synchronize views
|
||||
|
||||
When some people navigate around files in a project, and within the current file, they like the project view and the structure view to stay synchronized with the selection.
|
||||
|
||||
From the Project view, click on the gear icon, and ensure that 'Autoscroll to Source' and 'Autoscroll from Source' are checked:
|
||||
|
||||

|
||||
|
||||
And from the Structure view, in the toolbar, ensure that the two icons for 'Autoscroll to Source' and 'Autoscroll from Source' are selected:
|
||||
|
||||

|
||||
|
||||
## Darcula
|
||||
|
||||
Obviously a critical choice when developing - after coming down on one side or the other of the tabs-vs-spaces debate - is to choose a light or dark color theme. 😛 If you prefer a dark theme, you're in good company, with [52.5%](http://stackoverflow.com/research/developer-survey-2015#tech-ide) of other developers.
|
||||
|
||||
To set your UI theme to Darcula open the Settings and, under Appearance & Behavior > Appearance, adjust the value of the 'Theme' chooser.
|
||||
|
||||

|
||||
|
||||
## IDE layout
|
||||
|
||||
Some people prefer to have their IDE views positioned so that they are able to see the Project view, the Structure view, and the Dart Analysis view (errors and warnings) at once. Some people think of this as their
|
||||
[work triangle](https://en.wikipedia.org/wiki/Kitchen_work_triangle),
|
||||
similar to how you optimize for frequent tasks when designing a kitchen. After some fussing, here's a typical IDE layout:
|
||||
|
||||

|
||||
|
||||
## Remove unused plugins
|
||||
|
||||
IntelliJ (especially IntelliJ Ultimate) ships with a lot of plugins installed by default. Many of these plugins are harmless; a few may consume memory and CPU at various times. To disable plugins, open the Settings view and select the 'Plugins' category. Some people err on the side of only disabling plugins they clearly won't use.
|
||||
|
||||
## Community Edition vs Ultimate?
|
||||
|
||||
The two versions of IntelliJ are very similar. Ultimate includes plugins for web development; if web development is not an important use case for you, you can prefer to use the community edition. It has significantly fewer plugins installed than the Ultimate edition.
|
||||
|
||||
## Adjust the default heap
|
||||
|
||||
The recommended way of changing the JVM options in IntelliJ is from the Help | Edit Custom VM Options menu. This action will create a copy of the .vmoptions file in the IDE config directory and open an editor where you can change them (see also:
|
||||
[configuring VM options](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)).
|
||||
|
||||
Current default values for IntelliJ:
|
||||
|
||||
`-Xms128m -Xmx750m`
|
||||
|
||||
Increase these for fun and profit.
|
||||
387
docs/unsorted_wiki/Issue-hygiene.md
Normal file
387
docs/unsorted_wiki/Issue-hygiene.md
Normal file
@@ -0,0 +1,387 @@
|
||||
## tl;dr
|
||||
|
||||
- Avoid asking about the status of an issue; if we have an update, we'll post it.
|
||||
- If you have permission, assign bugs to yourself if you're working on them.
|
||||
- Unassign bugs that you are not working on soon.
|
||||
- If an issue is not assigned, assume it is available to be worked on.
|
||||
|
||||
## Overview
|
||||
|
||||
We use three issue trackers: the [main one on flutter/flutter](https://github.com/flutter/flutter/issues), one for [the flutter.dev Website, on flutter/website](https://github.com/flutter/website/issues), and one for [the IntelliJ and Android Studio plugins, on flutter/flutter-intellij](https://github.com/flutter/flutter-intellij/issues).
|
||||
|
||||
This page mostly talks about how we handle things for the flutter/flutter issue tracker.
|
||||
|
||||
### Issue philosophy
|
||||
|
||||
We assume that Flutter, like all non-trivial software, has an infinite number of bugs. The issue tracker contains the list of bugs that we are very lucky to have had reported by our generous community. Bugs includes known defects, as well as feature requests, planned work, and proposals.
|
||||
|
||||
Within the bug database we try to make sure each issue is actionable and discoverable. We do this by carefully updating the issue subject line, making sure every issue has steps to reproduce, and using labels to categorize the issue in ways that can be found by GitHub search.
|
||||
|
||||
|
||||
## Comments
|
||||
|
||||
### Do not add "me too" or "same" or "is there an update" comments to bugs
|
||||
|
||||
The Flutter team prioritizes issues in part based on the number of +1 (thumbs
|
||||
up) reactions on the top level comment of the bug. Adding comments like "me
|
||||
too" or "same here" is generally distracting and makes it harder to find
|
||||
other more meaningful content in the bug. If you have no new details to add,
|
||||
consider just thumbs up-ing the issue. If you wish to subscribe to the issue,
|
||||
click the "subscribe" button in the right hand column of the GitHub UI.
|
||||
|
||||
Adding comments explaining how a bug is dire and how you will stop using Flutter
|
||||
if it is not fixed is upsetting for the engineers working on Flutter (many of
|
||||
whom are volunteers, not that being paid to work on Flutter makes such comments
|
||||
any less upsetting). Out of a respect for the team, and as required by our [code
|
||||
of conduct](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md), we
|
||||
ask that you avoid adding comments that are not actively helpful. There are other
|
||||
venues if you want to complain without being constructive.
|
||||
|
||||
Asking for updates is also not generally helpful, because it just leads to issues
|
||||
being full of comments asking for updates and that makes finding useful information
|
||||
in a bug harder (an exception might be if you are participating in the triage process,
|
||||
but even then consider reaching out to people directly if possible). If you believe
|
||||
there could be information that has not been posted, ask on our Discord server instead
|
||||
(see [[Chat]]).
|
||||
|
||||
### Issues are not always the best venue for discussions
|
||||
|
||||
Discussions within an issue should remain focused on the topic, specifically about what the filed issue is and how to solve it. Broader discussions are best suited to happen on Discord (see [[Chat]]) or in design docs using Google Docs (see [[Design Documents]]). This is because GitHub hides comments, doesn't have threading, notifications get lost in the swamp of other GitHub e-mails, etc.
|
||||
|
||||
If you move to another tool for part of the discussion, remember to add a summary of the discussion and document any decisions that took place. This allows people following the issue to keep updated and continue to participate.
|
||||
|
||||
Issues are never an appropriate venue for asking for help with your code. Issues are also not a good venue for discussing project direction.
|
||||
|
||||
### Comments providing workarounds
|
||||
|
||||
Providing workarounds for issues can be helpful for developers using Flutter and finding a bug,
|
||||
but please keep such comments to a minimum so as to avoid disrupting the engineers trying to
|
||||
fix the issue. Rather than discussing workarounds, provide a pointer to another forum
|
||||
(e.g. Stack Overflow) where workarounds and temporary solutions are more appropriate. Thanks.
|
||||
However, when a workaround has been identified, consider applying the `workaround available` label to make that info readily available.
|
||||
|
||||
### Avoid posting screenshots of text
|
||||
|
||||
If you want to show code, quote someone, or show a string of text that does
|
||||
not render properly with Flutter, please avoid sharing it via an image or
|
||||
screenshot. Text in images cannot be copied, and cannot be automatically
|
||||
translated via services like Google Translate. This makes it harder for team
|
||||
members who do not speak that language to participate in the issue.
|
||||
|
||||
It is perfectly fine to share a screenshot of text rendering invalidly, but
|
||||
also include the actual string or character(s) that lead to it so that they
|
||||
can be copied and pasted into a test case.
|
||||
|
||||
### Provide reduced test cases
|
||||
|
||||
To debug a problem, we will need to be able to reproduce it. The best way
|
||||
to help us do that is to provide code, licensed according to [the BSD license
|
||||
used by Flutter](https://github.com/flutter/flutter/blob/master/LICENSE), that
|
||||
has been reduced as far as possible (such that removing anything further stops
|
||||
showing the bug). Attach such a file or files to the issue itself.
|
||||
|
||||
For legal reasons, we cannot debug problems that require looking at proprietary
|
||||
code or, generally, code that is not publicly available.
|
||||
|
||||
### Consider posting issues in English
|
||||
|
||||
If you are able to read and write English clearly, consider posting your issue
|
||||
in English, even if it is about a language specific issue (like the way text
|
||||
renders in some non-English language).
|
||||
|
||||
It is fine to post issues in languages other than English, but consider that
|
||||
many readers will rely on automatic translation services to read your issue.
|
||||
Please avoid using screenshots in languages other than English, as services like
|
||||
Google Translate will not translate the text in images, and the pool of people
|
||||
able to assist you will be reduced.
|
||||
|
||||
|
||||
## Locking an issue
|
||||
|
||||
**Closed** issues that haven't received any activity in a [few weeks](https://github.com/flutter/flutter/blob/master/.github/lock.yml#L4)
|
||||
are automatically locked by a [bot](https://github.com/apps/lock). This is
|
||||
done to encourage developers to file new bugs, instead of piling comments
|
||||
on old ones.
|
||||
|
||||
Under normal circumstances, open issues should not regularly be locked. The most
|
||||
common reason for manually locking an open issue is that issue is well
|
||||
understood by the engineers working on it,
|
||||
is believed to be appropriately prioritized, has a clear
|
||||
path to being fixed, and is otherwise attracting
|
||||
a lot of off-topic or distracting comments like "me too" or
|
||||
"when will this be fixed" or "I have a similar issue that might
|
||||
or might not be the same as this one".
|
||||
|
||||
If you are concerned that such an issue is not receiving its due
|
||||
attention, see Escalating an Issue, described above. If you are
|
||||
not already a contributor but would like to work on that issue,
|
||||
consider reaching out on an appropriate [chat](https://github.com/flutter/flutter/wiki/Chat).
|
||||
|
||||
If you have a similar issue and are not sure if it is the same,
|
||||
it is fine to file a new issue and linking it to the other issue.
|
||||
Please avoid intentionally filing duplicates.
|
||||
|
||||
Very rarely, an issue gets locked because discussion has become
|
||||
unproductive and has repeatedly violated the [Code of Conduct](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md).
|
||||
|
||||
|
||||
## Priorities
|
||||
|
||||
**The [`P0`](https://github.com/flutter/flutter/labels/P0) label** indicates that the issue is one of the following:
|
||||
* a build break, regression, or failure in an existing feature that prevents us from shipping the current build.
|
||||
* an important item of technical debt that we want to fix promptly because it is impacting team velocity.
|
||||
* an issue blocking, or about to block, a top-tier customer. (See [below](https://github.com/flutter/flutter/wiki/Issue-hygiene#customers) under "customers" for a definition of "top-tier customer".)
|
||||
|
||||
There are generally less than twenty-five P0 bugs (one GitHub search results page). If you find yourself assigning a P0 label to an issue, please be sure that there's a positive handoff between filing and a prospective owner for the issue.
|
||||
|
||||
Issues at this level should be resolved in a matter of weeks and should have weekly updates on GitHub.
|
||||
|
||||
During normal work weeks (e.g. not around the new year), issues marked P0 get audited weekly during the "critical triage" meeting to ensure we do not forget about them. Issues marked P0 should get updates at least once a week, to keep the rest of the team (and anyone affected by the issues) apprised of progress.
|
||||
|
||||
**The [`P1`](https://github.com/flutter/flutter/labels/P1) label** indicates high-priority issues that are at the top of the work list. This is the highest priority level a bug can have if it isn't affecting a top-tier customer or breaking the build. Bugs marked P1 are generally actively being worked on unless the assignee is dealing with a P0 bug (or another P1 bug).
|
||||
|
||||
Issues at this level should be resolved in a matter of months and should have monthly updates on GitHub.
|
||||
|
||||
**The [`P2`](https://github.com/flutter/flutter/labels/P2) label** indicates issues that we agree are important to work on, but are not at the top of the work list. This is the default level for new issues. A bug at this priority level may not be fixed for a long time. Sometimes an issue at this level will first migrate to P1 before we work on them, but that is not required.
|
||||
|
||||
**The [`P3`](https://github.com/flutter/flutter/labels/P3) label** indicates issues that we currently consider less important to the Flutter project. We use "thumbs-up" on these issues as a signal when discussing whether to promote them to P2 or higher based on demand. (Of course, this does not mean the issues are not important to _you_, just that we don't view them as the especially important for Flutter itself.)
|
||||
|
||||
Typically we would accept PRs for `P3` issues (assuming they follow our [style guide](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo) and follow our [other rules](https://github.com/flutter/flutter/wiki/Tree-hygiene)). Issues marked with the [`would require significant investment`](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3A%22would+require+significant+investment%22) label may require more than just a PR, for example, adding support for a whole new platform will require a commitment to provide CI resources for build and test, and someone to own the maintenance of those systems.
|
||||
|
||||
### When will my bug be fixed?
|
||||
|
||||
Flutter is an open source project and many people contribute their time (or their employees' time) to fix code and implement features. Typically, people fix bugs that are relevant to their customers. For example, Google engineers who contribute to Flutter are going to prioritize issues that affect Flutter apps written by Google teams. Many of us, however, also volunteer time to fix more general issues.
|
||||
|
||||
To determine when a bug will be fixed, look at the issue.
|
||||
|
||||
If there's a recent status update on the issue, that is the best information we have about the bug. If there's a lot of comments on the issue, we try to link to the latest status from the top comment, so look there. (Please [don't _ask_](https://github.com/flutter/flutter/wiki/Issue-hygiene#do-not-add-me-too-or-same-or-is-there-an-update-comments-to-bugs) for updates, though.)
|
||||
|
||||
If the issue is labeled with priorities `P0` or `P1`, or if the issue is assigned, we are likely to address it in the near term; we just need to find time.
|
||||
|
||||
Otherwise, we don't know when we're going to fix it. We may never get to it. In general, `P2` bugs are seen as more important than `P3` bugs. See the more detailed definitions of _priorities_ above.
|
||||
|
||||
_See also [[Popular issues]]._
|
||||
|
||||
### Escalating an issue that has the wrong priority
|
||||
|
||||
If you have a relationship with the Flutter team, raise the issue with
|
||||
your contact if you think the priority should be changed.
|
||||
|
||||
If you don't, consider finding like-minded developers to either implement
|
||||
the feature as a team, or to fund hiring someone to work on the feature,
|
||||
or to [mark the issue with a thumbs-up reaction](https://github.com/flutter/flutter/wiki/Issue-hygiene#thumbs-up-reactions).
|
||||
|
||||
Please don't comment on an issue to indicate your interest. Comments should
|
||||
be reserved for making progress on the issue.
|
||||
|
||||
|
||||
### Thumbs-up reactions
|
||||
|
||||
To vote on an issue, use the "Thumbs-up" emoji to react to the issue.
|
||||
|
||||
When examining issues, we use the number of thumbs-up reactions to an issue to determine an issue's relative popularity.
|
||||
This is, of course, but one input.
|
||||
At the end of the day, Flutter is an open source project and everyone (or every company) who contributes does so to further their own needs.
|
||||
To the extent that those needs are aligned with making Flutter popular,
|
||||
they tend to let their priorities be influenced by the "thumbs-up" reactions,
|
||||
but if you have something on which your business depends,
|
||||
the best solution is to pay someone to work on it.
|
||||
|
||||
See also:
|
||||
|
||||
* [All open issues sorted by thumbs-up](https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc)
|
||||
|
||||
* [Feature requests by thumbs-up](https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3A%22c%3A+new+feature%22)
|
||||
|
||||
* [Bugs by thumbs-up](https://github.com/flutter/flutter/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+-label%3A%22c%3A+new+feature%22+)
|
||||
|
||||
We ignore other emoji reactions.
|
||||
|
||||
|
||||
|
||||
## Labels
|
||||
|
||||
We use [many labels](https://github.com/flutter/flutter/labels).
|
||||
|
||||
### Naming conventions
|
||||
|
||||
Common naming conventions for labels include:
|
||||
- **`a: *`** - The `a` ("area") prefix is used for labels that are about a specific topic that could span different layers of Flutter's implementation (for example "accessibility" or "text input").
|
||||
- **`browser: *`** - Indicates the browser for browser-specific issues for the web port of Flutter.
|
||||
- **`c: *`** - The `c` ("category") prefix says what kind of bug we're looking at (regression, crash, new feature request, etc).
|
||||
- **`d: *`** - The purple `d` ("devtools") labels are for organizing our developer tool issues.
|
||||
- **`d: *`** - The green `d` ("documentation") labels are for organizing our documentation-related issues.
|
||||
- **`dependency: *`** - Indicates the upstream team for issues that are blocked on some work from an upstream project (e.g. Skia, Dart).
|
||||
- **`e: *`** - The `e` ("engine") prefix is for subsets of the Flutter engine ([flutter/engine](https://github.com/flutter/engine)).
|
||||
- **`f: *`** - The `f` ("framework") prefix is for subsets of the Flutter framework ([flutter/flutter's packages/flutter/](https://github.com/flutter/flutter/tree/master/packages/flutter)).
|
||||
- **`found in release: x.yy`** - Used for a series of labels that indicate which versions of Flutter an issue was found in.
|
||||
- **`from: *`** - Labels that indicate where an issue originated (e.g. research, postmortems), if it wasn't filed organically.
|
||||
- **`t: *`** - The `t` ("tool") prefix is for subsets of the Flutter tool ([flutter/flutter's packages/flutter_tools/](https://github.com/flutter/flutter/tree/master/packages/flutter_tools)).
|
||||
- **`p: *`** - The `p` ("package") prefix is for specific packages ([flutter/packages](https://github.com/flutter/packages)). Light teal for packages and darker teal for plugins.
|
||||
- **`platform-*`** - The `platform` prefix is for bugs that are specific to one or more platforms.
|
||||
- **`r: *`** - The `r` ("resolution") prefix is used for labels that describe why an issue was closed.
|
||||
|
||||
### Adding labels
|
||||
|
||||
Labels are more or less free, so we can add them pretty easily. Please mention it to other team members first, so that they know what you are planning and can give feedback (please at a minimum mention it on `#hidden-chat` in our [[Chat]]). Please make sure labels use a consistent color and naming scheme (e.g. all the framework-related labels are blue and start with `f:`).
|
||||
|
||||
Labels should be used for adding information to a bug. If you plan to use a label to find all instances of a particular topic (e.g. finding all PRs where someone wrote a design doc), be aware that there's no way to force people to label issues or PRs. You can, however, rely on automation to do it, for example we have a script that labels all PRs that affect the framework.
|
||||
|
||||
### Customers
|
||||
|
||||
The Flutter team is formed of engineers from many sources, including dedicated volunteers and employees of companies like Google. Each of these may have different ideas of who their customers are. For example, Google engineers consider some Google teams to be their customers, but someone who contributes on a code-for-hire basis may have their own customers.
|
||||
|
||||
Some teams using Flutter have a special relationship with some members of the Flutter team (e.g. they're collaborating with us on a new feature, or they're working with us on a product demo for an upcoming event). This is usually a fairly short-term arrangement for a specific business purpose. We provide such customers with a label (`customer: ...`) in our GitHub issue tracker. When these customers are working closely with members of the Flutter team, we may consider them "top-tier customers" for the purposes of prioritization.
|
||||
|
||||
Priority `P0` (see below) is sometimes used for bugs that affect these top-tier customers.
|
||||
|
||||
#### Coordinating between bug systems
|
||||
|
||||
Some customers have their own separate bug systems, in which they track Flutter
|
||||
issues. We consider our GitHub issue list to be canonical. However, if there
|
||||
is a link from the issue in our bug system to the customer's issue in their bug
|
||||
system, and we have been granted access, we will follow that link and may
|
||||
communicate in that separate bug system when attempting to track down the issue.
|
||||
|
||||
#### Special customer labels
|
||||
|
||||
The `customer: product` label is used to bring issues that product management
|
||||
and senior leads want resolved to the attention of the appropriate engineering
|
||||
team.
|
||||
|
||||
The `customer: crowd` label is used to represent bugs that are affecting large
|
||||
numbers of people; during initial [[Triage]], high-profile bugs get labeled in
|
||||
this way to bring them to the attention of the engineering team. "Large numbers"
|
||||
is a judgement call. If dozens of people independently run into the same issue
|
||||
and file a bug and we end up realizing that they're all duplicates of each other,
|
||||
then that would be a good candidate. On the other hand, if there is an active
|
||||
campaign to get people to comment on a bug, then it's probably not legitimately
|
||||
a `customer: crowd` bug, because people generally report bugs without having to
|
||||
be convinced to do so.
|
||||
|
||||
In general, a bug should only be marked `customer: crowd` `P0` if it
|
||||
is so bad that it is literally causing large numbers of people to consider changing
|
||||
careers.
|
||||
|
||||
|
||||
#### Other noteworthy labels
|
||||
|
||||
The `blocked` label can be used to indicate that a particular issue is unable to make progress until some other problem is resolved. This is particularly useful if you use your own list of assigned issues to drive your work.
|
||||
|
||||
The `good first issue` label should be used on issues that seem like friendly introductions to contributing to Flutter. They should be relatively well-understood issues that are not controversial, do not require a design doc, and do not require a deep understanding of our stack, but are sufficiently involved that they at least require a basic test to be added.
|
||||
|
||||
|
||||
## Milestones
|
||||
|
||||
We do not use GitHub milestones to track work.
|
||||
|
||||
|
||||
## Assigning Issues
|
||||
|
||||
Issues are typically self-assigned. Only assign a bug to someone else if
|
||||
they have explicitly volunteered to do the task. If you don't have permissions
|
||||
to assign yourself an issue you want to work on, don't worry about it, just
|
||||
submit the PR (see [[Tree Hygiene]]).
|
||||
|
||||
Only assign a bug to yourself when you are actively working on it
|
||||
or scheduled to work on it. If you don't know when you'll be working
|
||||
on it, leave it unassigned. Similarly, don't assign bugs to
|
||||
people unless you know they are going to work on it. If you find
|
||||
yourself with bugs assigned that you have not scheduled specific time
|
||||
to work on, unassign the bug so that other people feel
|
||||
empowered to work on them.
|
||||
|
||||
_Do_ assign a bug to yourself if you are working on it, or if you have
|
||||
scheduled time to work on it and are confident you will do so! This is how
|
||||
people can figure out what is happening. It also prevents duplicate
|
||||
work where two people try to fix the same issue at once.
|
||||
|
||||
You may hear team members refer to "licking the cookie". Assigning a
|
||||
bug to yourself, or otherwise indicating that you will work on it,
|
||||
tells others on the team to not fix it. If you then don't work on it,
|
||||
you are acting like someone who has taken a cookie,
|
||||
licked it to be unappetizing to other people, and then not eaten it.
|
||||
By extension, "unlicking the cookie" means indicating to the
|
||||
rest of the team that you are not actually going to work on the bug
|
||||
after all, e.g. by unassigning the bug from yourself.
|
||||
|
||||
## File bugs for everything
|
||||
|
||||
File bugs for anything that you come across that needs doing. When you
|
||||
implement something but know it's not complete, file bugs for what you
|
||||
haven't done. That way, we can keep track of what still needs doing.
|
||||
|
||||
### Exceptions
|
||||
|
||||
Do _not_ file bugs that meet the following criteria:
|
||||
|
||||
- Asking meta-questions like "why was bug #XYZ closed?" Instead, post
|
||||
on the original issue or raise the actual problem that is still not
|
||||
resolved.
|
||||
- Intentional duplicates like "This is the same as bug #ABC but that
|
||||
one is not getting enough attention." Instead, upvote the original
|
||||
issue or add a comment that provides new details that are not already
|
||||
captured or (best of all) assign it to yourself and start working on it!
|
||||
|
||||
### How to propose a specific change
|
||||
|
||||
If you have an idea that you would like to land, the recommended process is:
|
||||
|
||||
1. [File a bug](https://github.com/flutter/flutter/issues/new/choose) describing the problem.
|
||||
2. Write a [design doc](https://flutter.dev/go/template) that references this problem and describes your solution.
|
||||
3. Socialize your design on the bug you filed and on [[Chat]]. Collect feedback from various people.
|
||||
4. Once you have received feedback, if it is mostly positive, implement your idea and submit it. See the [[Tree Hygiene]] wiki page for details on submitting PRs.
|
||||
|
||||
### Every issue should be actionable
|
||||
|
||||
Avoid filing issues that are on vague topics without a clear problem description.
|
||||
|
||||
Please close issues that are not actionable. See [[Triage]] for more details.
|
||||
|
||||
#### Issues should have clear steps to reproduce
|
||||
|
||||
Every issue should have a clear description of the steps to reproduce the problem, the expected results, and the actual results.
|
||||
|
||||
If an issue is lacking this information, request it from the commenter and close the issue if information is not forthcoming.
|
||||
|
||||
## Closing issues
|
||||
|
||||
An issue should be closed if:
|
||||
|
||||
* it is fixed!
|
||||
* it is a [duplicate](https://github.com/flutter/flutter/wiki/Triage#duplicates).
|
||||
* it makes multiple requests which could be addressed independently. Encourage people to file separate bugs for each independent item.
|
||||
* it is describing a _solution_ rather than a _problem_. For example, it has no use cases, and the use cases are not obvious, or might have other solutions.
|
||||
* it is not [actionable](https://github.com/flutter/flutter/wiki/Triage#what-makes-an-issue-actionable) and does not [have unusual symptoms](https://github.com/flutter/flutter/wiki/Triage#unactionable-bugs-with-unusual-symptoms). This covers a wide variety of cases, such as invalid bugs, bugs without steps to reproduce, bugs that have become irrelevant, or bugs that are unclear and which the reporter has not offered more details for. It also includes non-catastrophic bugs that cannot be reproduced by anyone but the original reporter. For this latter case, encourage the reporter to attempt to debug the issue themselves, potentially giving suggestions for places where they could instrument the code to find the issue, and invite them to join the Discord for help; then add the `waiting for customer response` label. The issue will get automatically closed after a few weeks if they don't respond.
|
||||
* it is a feature request that we are unlikely to ever address, and if we did address it, it would not be part of the core SDK (e.g. it would be in a package). (For example, anything in the [`would be a good package` `P3`](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3A%22would+be+a+good+package%22+label%3AP3) list is a good candidate for closing without fixing.)
|
||||
* we would not accept a fix even if one were to be offered ([e.g. support for platforms at level of support 4](https://github.com/flutter/flutter/wiki/Values#levels-of-support)).
|
||||
* it is an issue regarding internal processes, tooling, or infrastructure (i.e. something that our users are not affected by), that we have no plans to get to (e.g. that would be marked P3). (For example, anything in the [`c: tech-debt` `P3`](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3A%22c%3A+tech-debt%22+label%3AP3) list is a good candidate for closing.)
|
||||
* it is tracking technical debt but the suggested improvements are marginal at best or would require significant research to be evaluated. Prefer having folks who work in the relevant part of the code make improvements based on their judgment.
|
||||
|
||||
|
||||
The following are poor reasons for closing an issue:
|
||||
|
||||
* it has not been updated for a long time. This is fine; if the issue has not changed, then it is normal for it to not be updated.
|
||||
* it is a low-priority user-facing issue. We would prefer to have one long-lived open bug with a single conversation, than many short-lived closed bugs with many independent conversations.
|
||||
* it would be hard to fix.
|
||||
|
||||
|
||||
In general, any bug that has the following characteristics should definitely not be closed:
|
||||
|
||||
* it is a well-described problem that we can reproduce reliably.
|
||||
* it is a well-argued feature request with a solid use case and clear goal that cannot reasonably be implemented in a package. (If it's something we're unlikely to ever do, it should be marked P3.)
|
||||
* it is tracking technical debt that is clearly actionable and whose benefits are clear.
|
||||
* it is a request to add a customization to a material widget that fits cleanly into the existing material design library's ethos.
|
||||
* it was filed by a team member and is assigned to that team member.
|
||||
|
||||
|
||||
## Tracking bugs for team members
|
||||
|
||||
If you need to track some work item, you can file a bug and assign it to yourself. Self-assigned bugs like this are mostly ignored by the bots and you can ignore the rules for such issues. (When you leave the team, we'll likely close these issues.) Some people like to use bugs like this as "umbrella" bugs for tracking work. You may also find it useful to use GitHub projects to manage work items.
|
||||
|
||||
|
||||
## Flaky tests
|
||||
|
||||
When a test flakes, a P0 bug is automatically filed with the label [`team: flakes`](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3A%22team%3A+flakes%22+sort%3Aupdated-asc). This issue should be investigated with all due haste, and a priority level should then be assigned to the issue. At any particular time, the most flaky tests should remain P0. However, flakes that are hard to pin down may be downgraded in priority (e.g. to P1). Please do not ignore the issue entirely, however, and make sure to close bugs once they are resolved, even if it's by magic.
|
||||
|
||||
_See also: [[Reducing test flakiness]]_
|
||||
8
docs/unsorted_wiki/Issue-triage-reports.md
Normal file
8
docs/unsorted_wiki/Issue-triage-reports.md
Normal file
@@ -0,0 +1,8 @@
|
||||
This page contains weekly issue triage reports from the Nevercode front-line triage team.
|
||||
|
||||
- [2024 reports](https://github.com/flutter/flutter/wiki/2024-Issue-Triage-Reports)
|
||||
- [2023 reports](https://github.com/flutter/flutter/wiki/2023-Issue-Triage-Reports)
|
||||
- [2022 reports](https://github.com/flutter/flutter/wiki/2022---Issue-Triage-Reports)
|
||||
- [2021 reports](https://github.com/flutter/flutter/wiki/2021---Issue-Triage-Reports)
|
||||
|
||||
_See also: [[Triage]]_
|
||||
15
docs/unsorted_wiki/JIT-Release-Modes.md
Normal file
15
docs/unsorted_wiki/JIT-Release-Modes.md
Normal file
@@ -0,0 +1,15 @@
|
||||
Normally Flutter runs in JIT for faster compilation/debugging support in `debug` mode and AOT mode for better performance in `profile` and `release` mode. For platforms that Flutter cannot produce AOT artifacts for, such as Android x86 (32 bit), a JIT release build may be used instead. The advantage of this mode over a regular debug build is that it removes debugging support and disables assertions which makes the final artifact smaller and more performant, though less so than a full AOT build.
|
||||
|
||||
|
||||
JIT release mode can be used with a local engine configuration. For example, to setup an Android x86 jit_release and host build you can use the GN command below. Both device and host artifacts need to be built, except in cases where they are the same such as the Desktop shells.
|
||||
|
||||
```shell
|
||||
./flutter/tools/gn --runtime-mode=jit_release --android --android-cpu=x86
|
||||
ninja -C out/android_jit_release_x86
|
||||
./flutter/tools/gn --runtime-mode=jit_release
|
||||
ninja -C out/host_jit_release
|
||||
```
|
||||
|
||||
This can be used with the flutter tool [via the `--local-engine`](https://github.com/flutter/flutter/wiki/Debugging-the-engine#running-a-flutter-app-with-a-local-engine) flag to produce a bundle containing the jit release artifacts using the `flutter assemble` command. By default, flutter.gradle does not know how to package this artifacts so it requires custom integration into a build pipeline. Nevertheless, the artifact structure should be identical to a debug build, but with asserts disabled and product mode enabled.
|
||||
|
||||
jit_release is not supported on iOS devices. Applications built in JIT mode cannot be distributed on the Apple App Store.
|
||||
23
docs/unsorted_wiki/Labeling-PRs.md
Normal file
23
docs/unsorted_wiki/Labeling-PRs.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Labeling PRs
|
||||
|
||||
Across the Flutter organization, the [labeler](https://github.com/actions/labeler) GitHub action is used per repo.
|
||||
|
||||
For repos that already use it, only `.github/labeler.yml` needs to be edited. For bringing up new repos, `.github/workflows/labeler.yml` should be copied from an existing repo into the new repo.
|
||||
|
||||
## How to add new labels
|
||||
|
||||
```yaml
|
||||
macos:
|
||||
# **/* recursively searches all subdirectories and files
|
||||
- shell/platform/darwin/macos/**/*
|
||||
|
||||
# For complex label names, it may need to be wrapped in quotes
|
||||
'a: accessibility':
|
||||
- **/accessibility/*
|
||||
```
|
||||
|
||||
## Verifying changes in presubmit
|
||||
|
||||
GitHub actions do not test changes in presubmit. To verify, copy your local change into a YAML linter to verify the file is not malformed.
|
||||
|
||||
Once landed, you can look at new workflow runs to see if the matches are being used.
|
||||
87
docs/unsorted_wiki/Landing-Changes-With-Autosubmit.md
Normal file
87
docs/unsorted_wiki/Landing-Changes-With-Autosubmit.md
Normal file
@@ -0,0 +1,87 @@
|
||||
# Using the Auto-submit Bot
|
||||
|
||||
This page details the workflow for Flutter's Auto-submit bot and how to use it to submit your changes into Flutter owned repositories.
|
||||
|
||||
## Auto-submit Labels
|
||||
|
||||
### Label descriptions and Who Applies these Labels
|
||||
|
||||
The following is a table of the labels that Auto-submit currently responds to
|
||||
and who adds them.
|
||||
|
||||
| Label | Description | Human | Bot | Why? |
|
||||
| --- | --- | :---: | :---: | --- |
|
||||
| `autosubmit` | Merge a pull request when the tree becomes green. | X | | Merge on a validated pull request. |
|
||||
| `revert` | Label used to initiate a revert request on a closed and merged PR. | X | | Revert a particular change that has been merged. |
|
||||
| `revert of` | Tracking label for the revert request generated from the closed and merged original pull request. | | X | To track the new pull request that reverts a previous change. |
|
||||
| `warning: land on red to fix tree breakage` | Override the tree-status check and land even when tree is closed. | X | | To submit a potential fix for the current tree-status |
|
||||
|
||||
Note: that `warning: land on red to fix tree breakage` cannot be used on its own
|
||||
and should be used in conjunction with the `autosubmit` label.
|
||||
|
||||
### Usage Examples
|
||||
|
||||
#### Merging a change (tree is open)
|
||||
This is the happy path. The tree is green and you just need to make
|
||||
sure validations pass and have the correct number of reviews.
|
||||
|
||||
**Labels to use:** [ `autosubmit` ]
|
||||
|
||||
**Validations:**
|
||||
|
||||
* ci checks
|
||||
* approvals (2 from flutter hackers)
|
||||
* mergeability
|
||||
|
||||
#### Merging a fix on red tree-status (tree is closed)
|
||||
This path should only be done in the event you have a change that will
|
||||
contribute a fix to the status of the tree.
|
||||
|
||||
**Labels to use:** [ `autosubmit`, `warning: land on red to fix tree breakage` ]
|
||||
|
||||
**Validations:**
|
||||
|
||||
* ci checks
|
||||
* approvals (2 from flutter hackers)
|
||||
* mergeability
|
||||
* ignores the results of the tree status check.
|
||||
|
||||
Warning: if you are not merging a fix for the tree you should not use the
|
||||
`warning: land on red to fix tree breakage` label. You will need to wait for the
|
||||
tree to open again.
|
||||
|
||||
#### Reverting a change from the tree
|
||||
This path is a way to revert a broken change from the tree that is
|
||||
within 24 hours old.
|
||||
|
||||
The reasoning behind this is that there will be someone with context as to
|
||||
why the change needed to be reverted.
|
||||
|
||||
Note: that it might make sense to add the `warning: land on red to fix tree breakage`
|
||||
label to a revert request but you do not need to do this. The revert request is
|
||||
assumed to be done out of urgency.
|
||||
|
||||
**Labels to use:** [ `revert` ]
|
||||
|
||||
**Validations:**
|
||||
|
||||
* "required" ci checks \*
|
||||
* mergeability
|
||||
|
||||
\* There are two types of required 'ci checks'. Ones that are controlled
|
||||
by/through Github and those enforced through our auto-submit configuration
|
||||
(TODO add link to the config). Currently there is only one required check in
|
||||
both cases but the later can be extended to support additional checks.
|
||||
|
||||
#### Reverting older changes from the tree
|
||||
This path describes what you should do in order to revert a change that is
|
||||
older than 24 hours.
|
||||
|
||||
In this case you will need to open the revert request in the traditional way.
|
||||
That is by navigating to your change in the Github UI and clicking the
|
||||
'Revert' button from the pull request page.
|
||||
|
||||
The pull request will then need to be treated as a regular pull request where
|
||||
you will need to wait for all ci checks to complete and gather 2 reviews from
|
||||
members of the 'flutter-hackers' team. See
|
||||
[Merging a change (tree is open)]() above.
|
||||
62
docs/unsorted_wiki/Life-of-a-Flutter-Frame.md
Normal file
62
docs/unsorted_wiki/Life-of-a-Flutter-Frame.md
Normal file
@@ -0,0 +1,62 @@
|
||||
Flutter apps work by transforming the widget tree in an application to a render tree that describes how to graphically render the widgets onscreen, and animating in response to input events or the passage of time. We refer to a single still image within the sequence of images composing an animation as a frame, similar to a frame in a movie filmstrip. In the context of a complete Flutter application these are rendered into a `FlutterView` class which is typically an instance of a platform-specific view class like [SurfaceView][surfaceview] on Android, [UIView][uiview] on iOS, [HWND][hwnd] on Windows, [NSView][nsview] on macOS, or [GtkBox][gtkbox] on Linux.
|
||||
|
||||
This page attempts to describe the life of a Flutter frame in the engine from initial trigger to rasterization, presentation, and finally destruction/recycling. For an overview of the Framework side of this process, see the [Flutter's Rendering Pipeline][renderingPipelineTalk] tech talk.
|
||||
|
||||
[gtkbox]: https://docs.gtk.org/gtk3/class.Box.html
|
||||
[hwnd]: https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types#HWND
|
||||
[nsview]: https://developer.apple.com/documentation/appkit/nsview
|
||||
[surfaceview]: https://developer.android.com/reference/android/view/SurfaceView
|
||||
[uiview]: https://developer.apple.com/documentation/uikit/uiview
|
||||
|
||||
## How a frame begins
|
||||
|
||||
All frames are born with a call to `RequestFrame` in the [Animator][animator].
|
||||
|
||||
A frame may be requested for a variety of reasons, ranging from resizing the Flutter view, to lifecycle events like backgrounding or foregrounding an app, to requests from either the app (via dart:ui's [PlatformDispatcher.scheduleFrame][scheduleFrame]) or the embedder (via the [embedder API][embedderAPI]'s `FlutterEngineScheduleFrame`).
|
||||
|
||||
Flutter does some minimal housekeeping when a frame is requested, primarily to ignore any duplicate requests to schedule a frame before the frame is actually produced.
|
||||
|
||||
Once a frame is scheduled, Flutter [waits for a vsync][vsyncWaiter] from the operating system to proceed.
|
||||
|
||||
|
||||
## Building the frame
|
||||
|
||||
At the heart of Flutter's graphics workflow is the frame [pipeline][pipeline]. The pipeline is responsible for coordinating work between the UI thread, where the application code runs, and the Raster thread, where rasterization and compositing is performed. See the [threading section][engineArchThreading] of the Engine Architecture wiki for more details on threading in the engine.
|
||||
|
||||
When a vsync occurs, Flutter begins the work of producing the frame in [Animator][animator]'s aptly-named `BeginFrame`. At this point, the animator reserves a spot in the pipeline and notifies the framework to begin the process of producing a frame by triggering the [PlatformDispatcher.onBeginFrame][onBeginFrame] dart:ui callback.
|
||||
|
||||
When using the engine with the Flutter framework, `onBeginFrame` is handled by [handleBeginFrame][handleBeginFrame] in the framework, whose job it is to kick off the production of a [Scene][scene] in the framework. A good overview of this process can be found in the documentation of [RendererBinding.drawFrame][drawFrame] and the [Flutter's Rendering Pipeline][renderingPipelineTalk] tech talk. This process ultimately culminates in the production of a `Scene` which is handed back to the engine through a call to [FlutterView.render][flutterViewRender].
|
||||
|
||||
On the engine side, a `Scene` is represented as a [LayerTree][layerTree]. Calling `FlutterView.render` hands the layer tree to the Animator via a call its `Render` method, which posts the layer tree to the pipeline and notifies the Rasterizer that it's time to start rasterizing the frame.
|
||||
|
||||
## Rasterizing the frame
|
||||
|
||||
Rasterization is the process of converting the in-memory layer tree into pixels on a surface. Rasterization-related code in Flutter is executed on the Raster thread, which coordinates with the GPU. On some platforms, the Raster thread and the Platform thread may be the same thread.
|
||||
|
||||
Rasterization starts with a call to the `Draw` method in the [Rasterizer][rasterizer]. At this point, the recently-produced `LayerTree` is pulled from the pipeline. The rasterizer does a quick check to see whether the app is running in headless mode (e.g. backgrounded) and if so, the frame is discarded; otherwise, rasterization proceeds.
|
||||
|
||||
Rasterization begins with a request for a surface to which the GPU can draw via a call to the `AcquireFrame` method of [Surface][surface]. This delegates platform-specific code implemented in each embedder in response to callbacks configured in `FlutterRendererConfig` which acquires an appropriate Metal, OpenGL, Vulkan, or software surface for use by the rasterizer.
|
||||
|
||||
Once a surface is acquired, the [LayerTree][layerTree] is rasterized to the surface via recursive `Preroll` and `Paint` calls through the layers. Behavior of these calls is specific to each layer type, but in the end, generally resolves to drawing via either either Skia or Impeller. Once the layer tree has been walked and all graphics operations have been collected, the frame is submitted to the GPU, and embedders are provided a callback to perform further platform-specific handling on their part -- typically presenting the surface via the platform-specific view implementation.
|
||||
|
||||
The above process is repeated until the pipeline is empty.
|
||||
|
||||
## Cleaning up frame resources
|
||||
|
||||
TODO(cbracken): write this up using [this patch](https://github.com/flutter/engine/pull/38038) as a reminder.
|
||||
|
||||
[animator]: https://github.com/flutter/engine/blob/main/shell/common/animator.h
|
||||
[drawFrame]: https://api.flutter.dev/flutter/rendering/RendererBinding/drawFrame.html
|
||||
[embedderAPI]: https://github.com/flutter/engine/blob/main/shell/platform/embedder/embedder.h
|
||||
[engineArchThreading]: https://github.com/flutter/flutter/wiki/The-Engine-architecture#threading
|
||||
[flutterViewRender]: https://api.flutter.dev/flutter/dart-ui/FlutterView/render.html
|
||||
[handleBeginFrame]: https://api.flutter.dev/flutter/scheduler/SchedulerBinding/handleBeginFrame.html
|
||||
[layerTree]: https://github.com/flutter/engine/blob/main/flow/layers/layer_tree.h
|
||||
[onBeginFrame]: https://api.flutter.dev/flutter/dart-ui/PlatformDispatcher/onBeginFrame.html
|
||||
[pipeline]: https://github.com/flutter/engine/blob/main/shell/common/pipeline.h
|
||||
[rasterizer]: https://github.com/flutter/engine/blob/main/shell/common/rasterizer.h
|
||||
[renderingPipelineTalk]: https://www.youtube.com/watch?v=UUfXWzp0-DU
|
||||
[scene]: https://api.flutter.dev/flutter/dart-ui/Scene-class.html
|
||||
[surface]: https://github.com/flutter/engine/blob/main/flow/surface.h
|
||||
[scheduleFrame]: https://api.flutter.dev/flutter/dart-ui/PlatformDispatcher/scheduleFrame.html
|
||||
[vsyncWaiter]: https://github.com/flutter/engine/blob/main/shell/common/vsync_waiter.h
|
||||
37
docs/unsorted_wiki/Making-animated-GIFs-of-Flutter-apps.md
Normal file
37
docs/unsorted_wiki/Making-animated-GIFs-of-Flutter-apps.md
Normal file
@@ -0,0 +1,37 @@
|
||||
Animated GIFs are useful for documentating animations. Here’s how to make them:
|
||||
|
||||
## Capturing video of an Android device
|
||||
|
||||
* This feature is available on KitKat and later.
|
||||
* Make sure to launch the app using `flutter run --release` for faster performance.
|
||||
* Start recording video by running this command on the command line:
|
||||
|
||||
```adb shell screenrecord /sdcard/recording.mp4```
|
||||
|
||||
* Interact with the app. When you are done you can terminate the recording with CTRL+c.
|
||||
|
||||
* Pull the recording off the device and onto your local hard drive:
|
||||
|
||||
```adb pull /sdcard/recording.mp4 ~/Downloads/```
|
||||
|
||||
## Capturing video of the iOS simulator
|
||||
|
||||
* Move the iOS simulator above your other applications
|
||||
* Launch the "QuickTime Player" app
|
||||
* Select “New Screen Recording” from the File menu
|
||||
* Draw a box around the Simulator and click "Start Recording"
|
||||
* When you're finished, click on Stop Recording on the Menu Bar.
|
||||
* If needed, trim your recording using "Trim" from the "Edit" menu.
|
||||
* Save the recording
|
||||
|
||||
## Converting the recording to GIF
|
||||
|
||||
* Go to http://ezgif.com/video-to-gif and upload the video.
|
||||
* If further trimming is needed, select the start and end times for your GIF.
|
||||
* Select an appropriately small size for the GIF (recommended: 320xAUTO).
|
||||
* Select a high framerate for the GIF (the max is 20) for smoothest animation
|
||||
* Convert to GIF and download the GIF file
|
||||
|
||||
## Example
|
||||
|
||||

|
||||
44
docs/unsorted_wiki/Managing-template-image-assets.md
Normal file
44
docs/unsorted_wiki/Managing-template-image-assets.md
Normal file
@@ -0,0 +1,44 @@
|
||||
Image assets used in templates in the `flutter` tool are maintained in the [flutter_template_images][fti_pkg] package on [Pub.dev][pub] and are not checked into the main [flutter/flutter][flutter_repo] repository.
|
||||
|
||||
Flutter's presubmit checks prevent binaries from being checked in to the repository. Binary files add significant size to the repository and produce large diffs when updated. This negatively impacts Flutter users when running `flutter upgrade`. Downloading a pub package does not involve a full sync of the git history, and is therefore significantly lighter weight.
|
||||
|
||||
## Adding/Updating template image assets
|
||||
|
||||
In order to add or update image assets, two patches are required: one to the `flutter/packages` repository and one to the `flutter/flutter` repository.
|
||||
|
||||
The [flutter_template_images][fti_repo] package repository contains a [`templates`][package_templates_dir] directory laid out identically to the [`templates`][tools_templates_dir] directory in the [flutter_tools][tools_repo] package in the main repository. Assets are first added to the flutter_template_images repo, which is then rolled into the main repository, where the template files and manifest must be updated.
|
||||
|
||||
### Add the assets to flutter_template_images
|
||||
|
||||
First, add the images to the flutter_template_images package:
|
||||
|
||||
1. Fork the [flutter/packages][packages_repo] repo on GitHub.
|
||||
2. Add the images at the relevant path under the `templates` directory. Filenames should be the exact final filenames as they will appear in a project generated by the `flutter` tool. They should _not_ include a `.img.tmpl` suffix.
|
||||
3. Update the version in [`pubspec.yaml`](https://github.com/flutter/packages/blob/main/packages/flutter_template_images/pubspec.yaml). For new assets, increment the _minor_ version in the `major.minor.patch` version number; for updates to existing assets, increment the _patch_ version.
|
||||
4. Add new heading for this version in [`CHANGELOG.md`](https://github.com/flutter/packages/blob/main/packages/flutter_template_images/CHANGELOG.md) and add a line describing your change. Follow the [Changelog Style][changelog_style] guidelines.
|
||||
5. Commit your changes and send a pull request.
|
||||
6. Once your changes are landed, a post-submit job will automatically publish the new version on Pub. You can verify this has occurred under the _Versions_ tab of the [flutter_template_images][fti_pkg] page.
|
||||
|
||||
### Update Flutter package dependencies
|
||||
|
||||
Once the updated package has been published on Pub, roll your changes into the main Flutter repository.
|
||||
|
||||
1. Fork the [flutter/flutter][flutter_repo] repo on GitHub.
|
||||
2. Edit [`packages/flutter_tools/lib/src/commands/update_packages.dart`](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/update_packages.dart) and update the pinned version number for the `flutter_template_images` to the new version.
|
||||
3. From within the repo directory, run `flutter update-packages --force-upgrade`.
|
||||
4. For each image that you added to `flutter_template_images`, add a zero-byte file with a `.img.tmpl` suffix in the corresponding location under the [`templates`][tools_templates_dir] directory of the `flutter_tools` package.
|
||||
5. Edit [`packages/flutter_tools/templates/template_manifest.json`](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/templates/template_manifest.json) and add an entry for each file you added, including the `.img.tmpl` suffix.
|
||||
6. Commit your changes, and perform a test run to be sure they're emitted successfully by the `flutter` tool.
|
||||
7. Assuming everything looks good, send a pull request.
|
||||
|
||||
_(This page is referenced by an error message in the Flutter presubmit checks.)_
|
||||
|
||||
[fti_pkg]: https://pub.dev/packages/flutter_template_images
|
||||
[fti_repo]: https://github.com/flutter/packages/tree/main/packages/flutter_template_images
|
||||
[pub]: https://pub.dev
|
||||
[flutter_repo]: https://github.com/flutter/flutter
|
||||
[packages_repo]: https://github.com/flutter/packages
|
||||
[package_templates_dir]: https://github.com/flutter/packages/tree/main/packages/flutter_template_images/templates
|
||||
[tools_templates_dir]: https://github.com/flutter/flutter/tree/master/packages/flutter_tools/templates
|
||||
[tools_repo]: https://github.com/flutter/flutter/tree/master/packages/flutter_tools
|
||||
[changelog_style]: https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changelog-style
|
||||
@@ -0,0 +1,13 @@
|
||||
Due to the newly added framework presubmit tests, if your engine commit breaks the framework in some way, **build_and_test_host** will likely catch it. In some cases, that breakage is intended and it requires a subsequent framework change (a.k.a., a manual engine roll) to fix the breakage.
|
||||
|
||||
While the breaking commit landed in the engine tree but the manual engine roll has not landed in the framework tree, all engine PRs could fail **build_and_test_host** unless those PRs are created based on an older engine tree without that breaking commit.
|
||||
|
||||
Therefore, for the author of the breaking commit that needs a manual roll, please notify others in
|
||||
* Flutter engine,
|
||||
* Flutter & Dart,
|
||||
* Flutter & Skia chat rooms,
|
||||
* and anyone who's rolling into the Flutter engine tree.
|
||||
|
||||
Feel free to @all to grab attentions as many people probably will skip any message without a red dot.
|
||||
|
||||
For authors of other PRs: please hold your PR until the manual roll finishes and rerun build_and_test_host for a green landing if it's not urgent. If your PR needs to fix something urgently, you may still land it on red build_and_test_host with an explicit explanation that the redness is caused by another commit.
|
||||
75
docs/unsorted_wiki/Multi-device-debugging-in-VS-Code.md
Normal file
75
docs/unsorted_wiki/Multi-device-debugging-in-VS-Code.md
Normal file
@@ -0,0 +1,75 @@
|
||||
The Flutter plugin for Visual Studio code has been updated to provide _experimental_ support for [Visual Studio Code’s multi-target debugging](https://code.visualstudio.com/docs/editor/debugging#_multitarget-debugging).
|
||||
|
||||
## Requirements
|
||||
- You must be on latest Flutter master channel for concurrent builds to not overwrite each other and cause build failures.
|
||||
|
||||
## Known Issues
|
||||
- The Hot Reload button on the debug toolbar does all sessions, but Hot Restart only does the active session
|
||||
|
||||
|
||||
## Setup
|
||||
To debug multiple devices concurrently you should set up a launch config for each device that has the `deviceId` field set (this is the same ID you'd pass to `flutter run -d xxx`). Open the launch config by clicking `Debug -> Open Configurations`. Add a `compound` config at the bottom that will launch both (or more) configurations at the same time:
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Current Device",
|
||||
"request": "launch",
|
||||
"type": "dart"
|
||||
},
|
||||
{
|
||||
"name": "Android",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"deviceId": "android"
|
||||
},
|
||||
{
|
||||
"name": "iPhone",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"deviceId": "iphone"
|
||||
},
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "All Devices",
|
||||
"configurations": ["Android", "iPhone"],
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Once saved, the compound configuration will show up in the drop-down at the top of the Debug side bar.
|
||||
|
||||
## Running
|
||||
Selecting the compound config on the Debug side bar and clicking `Debug -> Start Debugging` (or `Start Without Debugging`) will launched debug sessions for each device at the same time.
|
||||
|
||||
_Note: This may be slow because there are multiple concurrent builds (it may be faster on subsequent builds). You will also see multiple progress notification windows during the builds (we can likely improve this, but right now they just run without knowledge of each other so spawn their own notifications)._
|
||||
|
||||
When there are multiple active debug sessions, the debug toolbar will show a dropdown that lets you select the "active" debug session.
|
||||
|
||||
Actions on the debug toolbar will be sent only to this session (so you can step individually). The Debug Console will show a similar dropdown to switch between the output of each session.
|
||||
|
||||
The Variables and Watch panels on the Debug sidebar will be applied to the active debug session (being re-evaluated as you switch between them), though the Call Stack will show all sessions together, grouped by name.
|
||||
|
||||
All the usual functionality like hot-reload-on-save should work. Terminating an app should close only that single debug session.
|
||||
|
||||
## Troubleshooting
|
||||
The following are tips and tricks learned from connecting a large number of devices for simultaneous debugging (up to 9 at a time have been tested with these techniques).
|
||||
|
||||
### Hardware
|
||||
- Make sure to use high quality USB cables, e.g. Anker Powerline+ and/or the official Apple cables
|
||||
- Make sure to use a high quality USB hub, e.g. Anker 7-Port USB 3.0 Data Hub
|
||||
- If you feel the device buzzing periodically, it may be connected and disconnecting, which isn't conducive to good debugging
|
||||
|
||||
### Chrome OS
|
||||
- Make sure that the ChromeOS box is in developer mode and supports adb deployment
|
||||
- Make sure the left port is used for the connection (at least for the Google Pixel family of Chrome OS devices)
|
||||
- If not showing in ```flutter devices```, reboot the Chrome OS device with the USB cable in place
|
||||
|
||||
### Misc
|
||||
- Changes not being replicated to the web and/or desktop app via hot reload? Clicking on the app should cause the changes to be replicated.
|
||||
- Starting a debugging session always failing? Make sure that you're using the proper device name, e.g. Apple likes to use smart quotes in their device names instead of the standard apostrophe, e.g. ```Bob’s iPad``` instead of ```Bob's iPad```.
|
||||
- If you're still having trouble, make sure to test each configuration on its own via the Debug Sidebar instead of choosing the device to debug from the status bar -- the one in the status bar is going to ignore your launch settings and hide your errors.
|
||||
73
docs/unsorted_wiki/New-Android-version.md
Normal file
73
docs/unsorted_wiki/New-Android-version.md
Normal file
@@ -0,0 +1,73 @@
|
||||
Support a new android API level flutter
|
||||
go/flutter-android-new-api-level
|
||||
|
||||
## Objective
|
||||
Provide a list of areas to consider and examples of former work for how to update flutter to support a new version of the android API. This happens every fall and flutter developers expect to build against the latest versions quickly after they are available.
|
||||
### Overview
|
||||
#### New Android features
|
||||
New android features can require a broad spectrum of work. Some will require nothing from flutter. Some will require a lot of work, such as the support for “back preview”. The android team generally needs to be aware and schedule work ahead of time.
|
||||
#### Update Gradle/AGP support
|
||||
Sometimes newer versions of gradle are required to build without warning against a new version of android api. The warning looks like
|
||||
```
|
||||
WARNING:We recommend using a newer Android Gradle plugin to use compileSdkPreview = "somenamedversion"
|
||||
This Android Gradle plugin (X.X.X) was tested up to compileSdk = XX
|
||||
```
|
||||
Bump the gradle version used in the engine.
|
||||
|
||||
|
||||
#### Update Robolectric
|
||||
Robolectric is a dependency that allows us to write unit tests that run on a local development machine against the android api surface without being on an android device.
|
||||
Update what version of Robolectric we use in framework, engine and packages.
|
||||
Example packages: https://github.com/flutter/packages/pull/4018
|
||||
Example engine: https://github.com/flutter/engine/pull/42965
|
||||
|
||||
|
||||
#### Update CI
|
||||
|
||||
Update emulator and/or physical device testing to use the new android api version for framework, engine and packages.
|
||||
Firebase test lab emulators and physical devices need support from the firebase team
|
||||
Run command `gcloud firebase test android models list` [documentation](https://firebase.google.com/docs/test-lab/android/available-testing-devices) to see available devices.
|
||||
Flutter managed Emulators (engine) require a new AVD image to one that supports the new api: https://flutter-review.googlesource.com/c/recipes/+/45049
|
||||
Example Framework: https://flutter-review.googlesource.com/c/recipes/+/45048
|
||||
Example Engine: https://github.com/flutter/engine/pull/42492
|
||||
Packages
|
||||
Modify https://github.com/flutter/packages/blob/main/.cirrus.yml “firebase_test_lab_script”
|
||||
Specifically the value for “--device” `./script/tool_runner.sh firebase-test-lab --device model=redfin,version=30 --exclude=script/configs/exclude_integration_android.yaml`
|
||||
https://github.com/flutter/packages/pull/4430
|
||||
#### Update documentation
|
||||
Update documentation page to indicate the new api is tested
|
||||
https://docs.flutter.dev/reference/supported-platforms
|
||||
#### Modify defaults
|
||||
In flutter/flutter:
|
||||
Update default compile sdk version and target sdk version to the new api value
|
||||
Code here https://github.com/flutter/flutter/blob/master/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy
|
||||
Follow comments in that file to update other locations that are assumed to be the same.
|
||||
Example bumping min sdk which is similar but different: https://github.com/flutter/flutter/pull/125515
|
||||
In flutter/buildroot:
|
||||
Upload new android sdk version to CIPD (steps at end of document)
|
||||
Update default android sdk version
|
||||
https://github.com/flutter/buildroot/blob/7984a08044b94bfb4c466ac881c6b56fdfe9148b/build/config/android/config.gni#L19
|
||||
In flutter/engine:
|
||||
Update android SDK in DEPS file
|
||||
https://github.com/flutter/engine/blob/9289cb6a36aa86990e3ffe0f20324dafa38e7c11/DEPS#L731
|
||||
Update buildroot version in DEPS file to consume the changes in the flutter/buildroot steps above
|
||||
https://github.com/flutter/engine/blob/9289cb6a36aa86990e3ffe0f20324dafa38e7c11/DEPS#L260
|
||||
In flutter/packages
|
||||
Set examples to build with the new api.
|
||||
#### Test “Integration Test” package
|
||||
Integration test is a package shipped in the flutter tool for running integration tests on flutter apps. Ensure that the integration test package has an example that targets the new api level on the most recent published stable version of the flutter tool.
|
||||
|
||||
#### Related documents
|
||||
[Emulators for Flutter Android Testing (PUBLICLY SHARED)](https://docs.google.com/document/d/10wYUcLcSTF4Epg2EUGoBqOkkOe4zxKHvYKjXFZAOgGs/edit?resourcekey=0-pltjPvEtVezXDADMbUwFHQ)
|
||||
|
||||
### Additional notes
|
||||
#### Upload new SDK version to CIPD and consume in buildroot
|
||||
|
||||
Make a fork of the [buildroot](https://github.com/flutter/buildroot) if you haven’t yet.
|
||||
Get CIPD temporary write access, if you don’t have it:
|
||||
Make a github issue describing that there is a new android release that needs to be uploaded to CIPD
|
||||
Go to [go/flutter-luci-cipd#requesting-writeread-access-to-cipd-packages](http://goto.google.com/flutter-luci-cipd#requesting-writeread-access-to-cipd-packages) and click request access on the hyperlinked page
|
||||
Fill out the justification with b/12345 - <your GitHub issue> (the form requires a buganizer link, and the addition of b/12345 satisfies this).
|
||||
Reach out to someone on the infra team to get your request approved
|
||||
Run the [create_cipd_packages.sh script](https://github.com/flutter/engine/blob/a2adaa39a2c35d1ab23394d550c9a7e50fe41fe9/tools/android_sdk/create_cipd_packages.sh) with your desired version tag (note that there is a .ci.yaml validation step that requires this version tag to be a combination of lowercase letters and numbers). The script pulls the version that will be uploaded from the packages.txt file in the same subdirectory.
|
||||
The remaining steps are to consume the changes in the buildroot, and then consume those buildroot changes in the engine.
|
||||
40
docs/unsorted_wiki/Obfuscating-Dart-Code.md
Normal file
40
docs/unsorted_wiki/Obfuscating-Dart-Code.md
Normal file
@@ -0,0 +1,40 @@
|
||||
Code obfuscation hides function and class names in your compiled Dart code, making it difficult for an attacker to reverse engineer your proprietary app. This can be enabled with the `--obfuscate` option, which is required to be paired with `--split-debug-info` to generate a symbol map.
|
||||
|
||||
|
||||
<i>As of flutter 1.16.2, the information below is out of date. Only use this if you're on an earlier version of Flutter. If you are using Flutter 1.16.2 or later, please refer to [Obfuscating Dart code](https://flutter.dev/docs/deployment/obfuscate) on flutter.dev.</i>
|
||||
|
||||
## Android
|
||||
|
||||
Add the following line to `<ProjectRoot>/android/gradle.properties`:
|
||||
|
||||
```
|
||||
extra-gen-snapshot-options=--obfuscate
|
||||
```
|
||||
For information on obfuscating the Android host, see [Enabling Proguard](https://flutter.dev/android-release/#enabling-proguard) in [Preparing an Android App for Release](https://flutter.dev/android-release/#minify-and-obfuscate).
|
||||
|
||||
## iOS
|
||||
|
||||
### Step 1 - Modify the "build aot" call
|
||||
|
||||
Add the following flag to the `build aot` call in the `<FlutterRoot>/packages/flutter_tools/bin/xcode_backend.sh` file:
|
||||
|
||||
```
|
||||
${extra_gen_snapshot_options_or_none}
|
||||
```
|
||||
|
||||
Define this flag as follows:
|
||||
|
||||
```
|
||||
local extra_gen_snapshot_options_or_none=""
|
||||
if [[ -n "$EXTRA_GEN_SNAPSHOT_OPTIONS" ]]; then
|
||||
extra_gen_snapshot_options_or_none="--extra-gen-snapshot-options=$EXTRA_GEN_SNAPSHOT_OPTIONS"
|
||||
fi
|
||||
```
|
||||
|
||||
### Step 2 - Modify the release config
|
||||
|
||||
In `<ProjectRoot>/ios/Flutter/Release.xcconfig`, add the following line:
|
||||
|
||||
```
|
||||
EXTRA_GEN_SNAPSHOT_OPTIONS=--obfuscate
|
||||
```
|
||||
1704
docs/unsorted_wiki/PRs-addressed-between-1.5.4-and-1.7.8.md
Normal file
1704
docs/unsorted_wiki/PRs-addressed-between-1.5.4-and-1.7.8.md
Normal file
File diff suppressed because it is too large
Load Diff
1900
docs/unsorted_wiki/PRs-merged-between-1.7.8-and-1.9.1.md
Normal file
1900
docs/unsorted_wiki/PRs-merged-between-1.7.8-and-1.9.1.md
Normal file
File diff suppressed because it is too large
Load Diff
16
docs/unsorted_wiki/Package-migration-to-1.0.0.md
Normal file
16
docs/unsorted_wiki/Package-migration-to-1.0.0.md
Normal file
@@ -0,0 +1,16 @@
|
||||
_**TL;DR** To facilitate a smooth ecosystem migration, a package author may ask dependent packages to migrate to a 1.0.0 version with a `>=0.x.y+z <2.0.0` constraint rather than a `^1.0.0`._
|
||||
|
||||
API stability* is an important milestone in a package’s lifetime and bumping the version to 1.0.0 is an exciting way to celebrate this moment.
|
||||
|
||||
This is what the [Semantic Versioning Specification](https://semver.org/#spec-item-4) (2.0.0) is saying about pre 1.0.0 versions:
|
||||
|
||||
> Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.
|
||||
|
||||
Pub on the other hand treats pre 1.0.0 versions semantically (see [pub_semver corner cases](https://pub.dev/packages/pub_semver)), shifting the numbers by one position.
|
||||
|
||||
Often, at the time a package author is ready to announce API stability their package is versioned 0.x.y+z. Bumping a package version from 0.x.y+z to 1.0.0 is a major version bump in the Dart ecosystem. Migrations across a major version bump are slower, and may result in some period of ecosystem fragmentation (when some dependent packages are only willing to take ^0.x.y+z and some require ^1.0.0).
|
||||
|
||||
To go through an ecosystem migration to 1.0.0 in a smoother way, users of the newly API-stable package (particularly dependent packages) are encouraged to update their constraints to `>=0.a.b+c <2.0.0` instead of `^1.0.0`, this reduces friction during the transition period while some dependents have updated to post 1.0.0 and some have not.
|
||||
|
||||
|
||||
* While an API can never be guaranteed to be stable, version 1.0.0 is the milestone in which the package author is feeling comfortable to let others depend on the current API, and does not have concrete plans to change it in a breaking way.
|
||||
12
docs/unsorted_wiki/Packages-repo.md
Normal file
12
docs/unsorted_wiki/Packages-repo.md
Normal file
@@ -0,0 +1,12 @@
|
||||
This is an index of team-facing documentation for the [flutter/packages repository](https://github.com/flutter/packages/).
|
||||
|
||||
- [[Contributing to Plugins and Packages]]
|
||||
- [[Flutter migrate]]
|
||||
- [[Migrating Plugins repository PRs to Packages]]
|
||||
- [[Package migration to 1.0.0]]
|
||||
- [[Plugin Tests]]
|
||||
- [[Plugins and Packages repository structure]]
|
||||
- [[Setting up the Packages development environment]]
|
||||
- [[Understanding Packages tests]]
|
||||
- [[Releasing a Plugin or Package]]
|
||||
- [[Updating Packages repo for a stable release]]
|
||||
237
docs/unsorted_wiki/Plugin-Tests.md
Normal file
237
docs/unsorted_wiki/Plugin-Tests.md
Normal file
@@ -0,0 +1,237 @@
|
||||
*If you haven't already read it, start with [the repository structure overview](https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure) to familiarize yourself with the types of packages discussed below.*
|
||||
|
||||
## Types of Tests
|
||||
|
||||
Because of the complexities of having native code, plugins have many more types of tests than most other Flutter packages. A plugin will generally have some combination of the following:
|
||||
- **Dart unit tests**. All plugin packages should have these, with the exception of a federated implementation package that contains only native code (i.e., one that only implements a shared method channel). In a plugin, Dart unit tests would cover:
|
||||
- The Dart code in a monolithic plugin (generally using a mock method channel).
|
||||
- The Dart code in an app-facing plugin package (using a mock implementation of the platform interface).
|
||||
- The Dart code in a platform interface package that contains a shared method channel implementation (using a mock method channel).
|
||||
- The Dart code of an implementation package, if any. Some federated implementations are pure Dart, and would be largely tested via unit tests, and some have Dart code binding to a package-internal method channel.
|
||||
|
||||
These should live in `test/`
|
||||
- **Integration tests**. These use [the `integration_test` package](https://flutter.dev/docs/testing/integration-tests). Unlike Dart unit tests, integration tests run in the context of a Flutter application (the `example/` app), and can therefore load and exercise native plugin code. Almost all plugin packages other than the platform interface package should have these. The only exceptions would be:
|
||||
- Plugins that need native UI tests (see below)
|
||||
- Plugins that have pure Dart implementations which can be comprehensively tested with Dart unit tests.
|
||||
|
||||
These should live in `example/integration_tests/`
|
||||
- **Native unit tests**. Most plugins that have native code should have unit tests for that native code. (Currently, many do not; fixing that is currently a priority for plugins work.) They are written as:
|
||||
- Android: **JUnit** - These should live in `android/src/test/`
|
||||
- iOS: **XCTest** - These should live in `example/ios/RunnerTests/` (**Note**: These are in the example directory, not the main package directory, because they are run via the example app's project)
|
||||
- macOS: **XCTest** - These should live in `example/macos/RunnerTests/` (**Note**: These are in the example directory, not the main package directory, because they are run via the example app's project)
|
||||
- Linux: **Google Test** - These should live in `linux/test/`, and be named `*_test.cc`.
|
||||
- Windows: **Google Test** - These should live in `windows/test/`, and be named `*_test.cpp`.
|
||||
- **Native UI tests**. Some plugins show native UI that the test must interact with (e.g., `image_picker`). For these normal integration tests won't work, as there is not way to drive the native UI from Dart. They are written as:
|
||||
- Android: **Espresso**, via the [`espresso` plugin](https://pub.dev/packages/espresso) - These should live in `example/android/app/src/androidTest/`
|
||||
- iOS: **XCUITest** - These should live in `example/ios/RunnerUITests/`
|
||||
- macOS: **XCUITest** - These should live in `example/macos/RunnerUITests/`
|
||||
- Windows and Linux: **TBD**, see [#70233 (Windows)](https://github.com/flutter/flutter/issues/70233) and [#70235 (Linux)](https://github.com/flutter/flutter/issues/70235)
|
||||
|
||||
## Running Tests
|
||||
|
||||
### Dart unit tests
|
||||
|
||||
These can be run like any other Flutter unit tests, either from your preferred Flutter IDE, or using `flutter test`. The one exception is unit tests for `*_web` packages, which must be run with `flutter test --platform=chrome`.
|
||||
|
||||
You can also run them via the [repository tools `drive-examples` command](https://github.com/flutter/packages/blob/main/script/tool/README.md):
|
||||
|
||||
```sh
|
||||
dart run script/tool/bin/flutter_plugin_tools.dart drive-examples --packages=<name_of_plugin>
|
||||
```
|
||||
|
||||
### Integration tests
|
||||
|
||||
To run the integration tests using Flutter test (while in a plugin directory):
|
||||
|
||||
```sh
|
||||
cd example
|
||||
flutter test integration_test
|
||||
```
|
||||
|
||||
(optionally including a `-d <device>` flag to select the target device), or use the [repository tools `drive-examples` command](https://github.com/flutter/packages/blob/main/script/tool/README.md)
|
||||
from the root of the repository:
|
||||
|
||||
```sh
|
||||
dart run script/tool/bin/flutter_plugin_tools.dart drive-examples --packages=<name_of_plugin> --<platform>
|
||||
```
|
||||
|
||||
To run integration tests as instrumentation tests on a local Android device:
|
||||
|
||||
```sh
|
||||
cd example
|
||||
flutter build apk
|
||||
cd android && ./gradlew -Ptarget=$(pwd)/../test_driver/<name_of_plugin>_test.dart app:connectedAndroidTest
|
||||
```
|
||||
|
||||
### Native tests
|
||||
|
||||
From a terminal (while at the repository root), use the [repository tools `native-test` command](https://github.com/flutter/packages/blob/main/script/tool/README.md). Examples:
|
||||
|
||||
```sh
|
||||
# Unit and integration (UI) tests, multiple platforms
|
||||
dart run script/tool/bin/flutter_plugin_tools.dart native-test --android --ios --packages=<some_plugin_name>
|
||||
# iOS, integration tests only
|
||||
dart run script/tool/bin/flutter_plugin_tools.dart native-test --ios --no-unit --packages=<some_plugin_name>
|
||||
# Android, unit tests only
|
||||
dart run script/tool/bin/flutter_plugin_tools.dart native-test --android --no-integration --packages=<some_plugin_name>
|
||||
```
|
||||
|
||||
It's also possible to run them from native IDEs:
|
||||
|
||||
#### JUnit
|
||||
|
||||
Run from Android Studio once the example app is opened as an Android project
|
||||
|
||||
#### XCTest and XCUITest
|
||||
|
||||
[Run from Xcode](https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/05-running_tests.html)
|
||||
once the example app is opened as an Xcode project.
|
||||
|
||||
#### Google Test
|
||||
|
||||
For Windows plugins, Visual Studio should auto-detect the tests and allow running them as usual.
|
||||
|
||||
### Web Tests
|
||||
|
||||
Most web tests are written as Integration Tests because they need a web browser (like Chrome) to run. Web integration tests are located in the `example` directory of the `<plugin_name_web>` package.
|
||||
|
||||
To run web integration tests:
|
||||
|
||||
1. Check what version of Chrome is running on the machine you're running tests on.
|
||||
2. Download and install the ChromeDriver for that version from here:
|
||||
* https://chromedriver.chromium.org/downloads
|
||||
3. Start ChromeDriver with:
|
||||
```sh
|
||||
chromedriver --port=4444
|
||||
```
|
||||
4. Run tests:
|
||||
* **All:** from the root `plugins` directory, run:
|
||||
```sh
|
||||
dart run script/tool/bin/flutter_plugin_tools.dart drive-examples --packages=<plugin_name>/<plugin_name_web> --web
|
||||
```
|
||||
* **One:** `cd` into the `example` directory of the package, then run:
|
||||
```sh
|
||||
flutter drive -d web-server --web-port 7357 --browser-name chrome --driver test_driver/integration_test.dart --target integration_test/NAME_OF_YOUR_test.dart
|
||||
```
|
||||
|
||||
All web packages contain a standard `test` directory in the root of the package that can be run with `flutter test`. In most cases, the test there will direct users to the Integration Tests that live in the `example` directory. In some cases (like `file_selector_web`), the directory contains actual Unit Tests that are not web-specific and can run in the Dart VM.
|
||||
|
||||
#### Mocks
|
||||
|
||||
Some packages (like `google_maps_flutter_web`) contain `.mocks.dart` files alongside the test files that use them.
|
||||
|
||||
Mock files are [generated by `package:mockito`](https://pub.dev/packages/mockito#lets-create-mocks). The contents of mock files can change with how the mocks are used within the tests, in addition to actual changes in the APIs they're mocking.
|
||||
|
||||
Mock files must be updated by running the following command:
|
||||
|
||||
```sh
|
||||
flutter pub run build_runner build
|
||||
```
|
||||
|
||||
|
||||
## Adding tests
|
||||
|
||||
A PR changing a plugin [should add tests](https://github.com/flutter/flutter/wiki/Tree-hygiene#tests). Which type(s) of tests you should add will depend on what exactly you are changing. See below for some high-level guidance, but if you're not sure please ask in your PR or in `#hackers-ecosystem` [on Discord](https://github.com/flutter/flutter/wiki/Chat).
|
||||
Hopefully the scaffolding to run the necessary kinds of tests are already in place for that plugin, in which case you just add tests to the existing files in the locations referenced above. If not, see below for more information about adding test scaffolding.
|
||||
|
||||
### FAQ: Do I need to add tests even if the part of the code I'm changing isn't already tested?
|
||||
|
||||
**Yes.** Much of the plugin code predates the current strict policy about testing, and as a result the coverage is not as complete as it should be. The goal of having a strict policy going forward is to ensure that the situation improves.
|
||||
|
||||
### What types of tests to add
|
||||
|
||||
The type(s) of tests to add depends on the details of the PR, and there is not always one right answer. Some high level principles to keep in mind:
|
||||
- Your tests should cover all of the new code you've added whenever possible. For instance, if your change has an error path you should test both the normal path and the error path.
|
||||
- Unit tests are more reliable, faster to run, and more precise at isolating bugs than integration tests, so it is generally good to have unit testing of any non-trivial logic.
|
||||
- New functionality should generally include integration tests that validate that the feature works end to end. (In some cases asserting that the native code has done the right thing is impractical in a full integration test, however.)
|
||||
|
||||
Some specific guidelines about different test types:
|
||||
- **Dart unit tests**: If you are changing Dart code, you should almost always have Dart unit tests as well. They are fast to run, and generally easy to write and maintain. Even if your Dart changes are just wiring a new parameter through an app-facing package to the platform interface, or a platform interface implementation to a method channel, Dart unit tests can easily validate that they are being passed through correctly at each step.
|
||||
- Unless your change has no native code changes, remember that Dart unit tests **are not sufficient by themselves**. No native code is run as part of Dart unit tests.
|
||||
- **Dart integration tests**: These are the only fully end-to-end tests for plugins, so should be written when possible. This is the only kind of test that can actually test the entire flow as it will be run by plugin clients. Some comment cases where they won't work, however:
|
||||
- The test requires interacting with native UI (e.g., pushing a button in a modal dialog before the test can complete).
|
||||
- The test requires inspecting native UI (e.g., changing the properties of a view inside a platform view provided by the native code—although in some cases it may be viable to write a special platform interface just for testing, that can query those properties from Dart via calls to native code).
|
||||
- The test requires specific hardware state.
|
||||
- **Native unit tests**: Native unit tests are the only way to unit-test native code; if your native code is non-trivial, then it should probably have native unit tests. In particular:
|
||||
- It is often much easier to get complete coverage of edge cases in native unit tests than via full integration tests.
|
||||
- If you need to mock out system components (such as hardware state), you'll need native unit tests.
|
||||
- **Native integration tests**: These are usually the most complex to maintain (being both per-platform, and more likely to be flaky than unit tests), so use with caution. However, they are the only way to get end-to-end testing when interacting with native UI.
|
||||
|
||||
Some patterns to consider given all of the above:
|
||||
- If Dart integration tests are viable, use that to ensure end-to-end behavior of the overall feature, and add Dart and/or native unit testing to cover specific implementation details.
|
||||
- If the test requires interacting with native UI (e.g., image or file selection):
|
||||
- use native integration tests to validate the overall flow, plus unit testing of specific details, or
|
||||
- use native unit tests that are set up to test the native portion end to end (i.e., calling into the method channel entry point with a synthesized call, and checking the method call response) with the UI APIs stubbed out, plus Dart unit tests that everything is plumbed through from the Dart API surface to the method call, or
|
||||
- use the first to validate basic functionality, and the second for edge cases that can't be easily tested that way.
|
||||
- If the tests require mocking device state (e.g., camera), use native unit tests that are set up to test the native portion end to end (i.e., calling into the method channel entry point with a synthesized call, and checking the method call response) with the UI APIs stubbed out, plus Dart unit tests that everything is plumbed through from the Dart API surface to the method call.
|
||||
|
||||
### Adding test scaffolding
|
||||
|
||||
If a plugin is missing test scaffolding for the type of tests you want to add, you have several options:
|
||||
- If it's simple to enable them, and you are comfortable making the changes, you can enable them as part of your PR.
|
||||
- If it's non-trivial to enable them, but you are comfortable doing it, you can make a new PR that enables them with some minimal test, and ask for that to be reviewed and landed before continuing with your PR.
|
||||
- If you aren't comfortable making the change, reach out [via Discord](https://github.com/flutter/flutter/wiki/Chat) and ask in `#hackers-ecosystem`.
|
||||
|
||||
Regardless of the approach you use, please reach out on Discord if a PR that sets up a new kind of test doesn't get reviewed within two weeks. Filling in the gaps in test scaffolding is a priority for the team, so we want to review such PRs quickly whenever possible.
|
||||
|
||||
See below for instructions on bringing up test scaffolding in a plugin (*does not yet cover all types of tests*):
|
||||
|
||||
#### Enabling XCTests or XCUITests
|
||||
|
||||
1. Open `<path_to_plugin>/example/ios/Runner.xcworkspace` using Xcode. (For macOS, replace `ios` with `macos`.)
|
||||
1. Create a new "Unit Testing Bundle" or "UI Testing Bundle", depending on the type of test.
|
||||
1. In the target options window, populate details as following, then click on "Finish".
|
||||
* In the "product name" field, type "RunnerTests" or "RunnerUITests", depending on the type of test.
|
||||
* In the "Team" field, select "None".
|
||||
* Set the Organization Identifier to "dev.flutter.plugins".
|
||||
* In the Language field, select "Objective-C" for iOS, or "Swift" for macOS.
|
||||
* In the Project field, select the xcodeproj "Runner" (blue color).
|
||||
* In the Target to be Tested, select xcworkspace "Runner" (white color).
|
||||
* In the Build Settings tab, remove most of the target-level overrides that are generated by the
|
||||
template. In particular:
|
||||
* `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` is currently incompatible with Flutter.
|
||||
* `IPHONEOS_DEPLOYMENT_TARGET` and `TARGETED_DEVICE_FAMILY` may cause issues running tests.
|
||||
* The compiler settings (`CLANG_*`, `GCC_*`, and `MTL_*`) shouldn't be needed.
|
||||
1. For XCTests, edit `example/ios/Podfile` (`example/macos/Podfile` for macOS) to add the following to the `target 'Runner' do` block:
|
||||
|
||||
```ruby
|
||||
target 'RunnerTests' do
|
||||
inherit! :search_paths
|
||||
pod 'OCMock', '3.5'
|
||||
end
|
||||
```
|
||||
The `OCMock` line is only necessary if your tests use OCMock.
|
||||
1. A RunnerTests/RunnerUITests folder should be created and you can start hacking in the added `.m`/`.swift` file.
|
||||
|
||||
#### Enabling Android UI tests
|
||||
|
||||
1. Duplicate the `DartIntegrationTests.java` file from another plugin to `example/android/app/src/androidTest/java/io/flutter/plugins/DartIntegrationTest.java`
|
||||
1. Create a file under `example/android/app/src/androidTest/java/` with a sub-path corresponding to the example app's package identifier from `example/android/app/src/main/AndroidManifest.xml`. The file should be called `FlutterActivityTest.java` (or if the example uses a custom MainActivity as its `android:name` in `AndroidManifest.xml`, `MainActivityTest.java`).
|
||||
* For example, if `AndroidManifest.xml` uses `io.flutter.plugins.fooexample` as the package identifier, and `io.flutter.embedding.android.FlutterActivity` as its `android:name`, the file should be `example/android/app/src/androidTest/java/io/flutter/plugins/fooexample/FlutterActivityTest.java`.
|
||||
|
||||
The file should look like:
|
||||
```
|
||||
package io.flutter.plugins.fooexample;
|
||||
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
import dev.flutter.plugins.integration_test.FlutterTestRunner;
|
||||
import io.flutter.embedding.android.FlutterActivity;
|
||||
import io.flutter.plugins.DartIntegrationTest;
|
||||
import org.junit.Rule;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@DartIntegrationTest
|
||||
@RunWith(FlutterTestRunner.class)
|
||||
public class FlutterActivityTest {
|
||||
@Rule
|
||||
public ActivityTestRule<FlutterActivity> rule = new ActivityTestRule<>(FlutterActivity.class);
|
||||
}
|
||||
```
|
||||
|
||||
Note:
|
||||
* Update the `package` to match the actual package.
|
||||
* If using a custom `MainActivity`, replace the `FlutterActivity` references with `MainActivity`.
|
||||
1. Ensure that `example/android/app/build.gradle`'s `defaultConfig` section contains:
|
||||
```
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
```
|
||||
@@ -0,0 +1,47 @@
|
||||
This provides an overview of the structure of the flutter/packages repository.
|
||||
|
||||
# Packages
|
||||
|
||||
Most packages are located in `packages`. A few which are derived heavily from third-party code are instead in `third_party/packages/`.
|
||||
|
||||
## Plugins
|
||||
|
||||
Plugins in flutter/packages uses the federated plugin model. If you are not familiar with federated plugins, start with reading [the federated plugin overview](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins) to understand the terms below.
|
||||
|
||||
All plugins are located in the `packages/` directory. Almost all plugins have the following layout:
|
||||
- `some_plugin/` - A directory containing the individual packages of the federated plugin:
|
||||
- `some_plugin/` - The app-facing package
|
||||
- `some_plugin_platform_interface/` - The platform interface
|
||||
- `some_plugin_android/`, `some_plugin_ios/`, `some_plugin_web/`, `some_plugin_windows/`, `some_plugin_macos/`, and/or `some_plugin_linux/` - The individual platform implementations, as applicable
|
||||
- In some special cases, implementation packages have different names; examples include `webview_flutter_wkwebview` and `in_app_purchase_storekit`. These would normally be named `_ios`, but have more generic names because they include (or expected to include in the future) macOS implementations. Sharing a package allows sharing the code, as the OS APIs are largely the same across the two platforms.
|
||||
|
||||
This layout reflects the goal of having all multi-platform plugins in flutter/packages being fully federated. (While this is not strictly necessary, as all packages are being maintained by the Flutter team, using a fully federated structure ensures that we are testing the federated model and finding issues and areas for improvement specific to federation.)
|
||||
|
||||
### Android Specifics
|
||||
|
||||
#### Gradle structure
|
||||
|
||||
`package/example/android/settings.gradle` imports the flutter tooling, includes the app directory (same as `flutter create` projects) additionally it configures GoogleCloudPlatform/artifact-registry-maven-tools for use in CI.
|
||||
|
||||
This repo has a GCP instance that mirrors dependencies available from `google()` and `mavenCentral()` used by CI (or Googlers). This gives us redundant uptime for dependency availability.
|
||||
|
||||
Using the specific google hosted cache is not intended for contributors outside of CI. We protect that execution with an environment variable `ARTIFACT_HUB_REPOSITORY` to ensure that by default users do not see rejected cloud credentials or errors in builds. Contributors could setup an artifact repository and set the environment variable to point to a hosted repository but that is practically not worth it for almost all contributors.
|
||||
|
||||
Googlers can debug locally by setting `ARTIFACT_HUB_REPOSITORY` to the valid artifact hub value and authenticating with GCP. To authenticate run `gcloud auth application-default login`. To find artifact hub url use `<url>` section of go/artifact-hub#maven or inspect the value on CI servers. CI uses a service account for billing. That is defined in go/artifact-hub-service-account (Googler access only).
|
||||
|
||||
## Useful links for debuging
|
||||
https://github.com/GoogleCloudPlatform/artifact-registry-maven-tools/blob/master/README.md
|
||||
https://docs.gradle.org/current/userguide/declaring_repositories.html
|
||||
https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html
|
||||
|
||||
Command to force refresh of dependencies `./gradlew app:dependencies --configuration <SOME_TASK> --refresh-dependencies`
|
||||
|
||||
### Unfederated plugins
|
||||
|
||||
A few plugins are inherently single-platform (for example, `flutter_plugin_android_lifecycle`), and so are not federated. For those plugins the structure is:
|
||||
|
||||
- `some_plugin/` - A plugin containing the app-facing API and its implementation
|
||||
|
||||
# Tools
|
||||
|
||||
`script/tool/` contains the tooling used to manage tasks across all packages in the repository. See [its README](https://github.com/flutter/packages/blob/main/script/tool/README.md) for more information.
|
||||
82
docs/unsorted_wiki/Popular-issues.md
Normal file
82
docs/unsorted_wiki/Popular-issues.md
Normal file
@@ -0,0 +1,82 @@
|
||||
When deciding what to work on, we usually focus on issues that have a lot of thumbs-up reactions on the first comment, what we call the "popular issues".
|
||||
|
||||
Some popular issues are topics on which we cannot find a good way to make progress. Since those issues where we _do_ make progress get closed, the result is that [the list of most-popular issues](https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) is now full of issues where we have conspicuously not made progress!
|
||||
|
||||
In the interests of transparency, this wiki page discusses the status of the ten most popular issues. It is only updated occasionally and so may not be entirely up to date; for the most up to date information, please see the latest comments on the relevant issue. (Please avoid asking for an update on issues, otherwise they become full of people asking for updates and nobody can find the actual updates.)
|
||||
|
||||
_See also: [the list of popular issues including closed issues](https://github.com/flutter/flutter/issues?q=is%3Aissue+sort%3Areactions-%2B1-desc), which shows that popular issues do get closed. 😅_
|
||||
|
||||
## [Code Push / Hot Update / out of band updates](https://github.com/flutter/flutter/issues/14330) (#14330)
|
||||
|
||||
<!-- https://github.com/flutter/flutter/issues/14330#issuecomment-442274897 (terminology) -->
|
||||
<!-- https://github.com/flutter/flutter/issues/14330#issuecomment-485565194 (2019 update) -->
|
||||
<!-- https://github.com/flutter/flutter/issues/14330#issuecomment-442274897 (rfw) -->
|
||||
|
||||
There are three main areas that people are referring to here:
|
||||
|
||||
* **Modular application delivery**: the ability to package a single app into multiple separate archives when compiling it, and download them independently as needed. This is supported on Android via [deferred components](https://docs.flutter.dev/perf/deferred-components). We suspect it is not possible to achieve this on iOS with Apple's current guidelines and tools. We have not yet attempted to provide this on desktop or web, primarily because we have more important issues to resolve on those platforms first.
|
||||
|
||||
* **Dynamic extension loading**: the ability to download some Dart code that wasn't written when the app was first published, which adds a new feature to the app. This could be done on the fly. It may require the core app to be larger since we can't know ahead of time what is needed by each future extension. There are various solutions in this space, such as combining [the rfw package](https://pub.dev/packages/rfw) and an FFI-based or Wasm-based solution (e.g. [package:wasm](https://pub.dev/packages/wasm)). There is [an example](https://github.com/flutter/packages/tree/master/packages/rfw/example/wasm) that provides a proof-of-concept for this combination of packages: a Flutter desktop application that knows nothing about being a calculator downloads an interface description specifying all the buttons and their layout to show on the screen, and downloads a C program compiled to Wasm to perform the calculations. The Flutter program is merely a bridge between these two downloaded files. We are looking for feedback from people using this feature; please add your experiences to [issue 90218](https://github.com/flutter/flutter/issues/90218).
|
||||
|
||||
* **Dynamic patching**: the ability to update the Dart code of an app in the field by downloading a patch (of sorts) and providing it to the Dart VM. This would require a reload of the app to take effect. Dynamic patching was previously on our roadmap for 2019. After investigating this in greater detail, we decided not to proceed with that work. There were several factors that led us to this decision:
|
||||
|
||||
* To comply with our understanding of store policies on Android and iOS, any solution would be limited to JIT code on Android and interpreted code on iOS. We are not confident that the performance characteristics of such a solution on iOS would reach the quality that we demand of our product. (In other words, "it would be too slow".)
|
||||
|
||||
* There are some serious security concerns. Since these patches would essentially allow arbitrary code execution, they would be extremely attractive malware vectors. We could mitigate this by requiring that patches be signed using the same key as the original package, but this is error prone and any mistake would have serious consequences. This is, fundamentally, the same problem that has plagued platforms that allow execution of code from third-party sources. This problem could be mitigated by integrating with a platform update mechanism, but this defeats the purpose of an out-of-band patching mechanism.
|
||||
|
||||
* There is currently no out-of-the-box open source hosting solution for patching applications, so we would either have to rely on people configuring their Web servers accordingly, or we would have to create integrations for proprietary third-party services, or we would have to create our own bespoke solution. Hosting patches is a space we are not eager to enter. Having people configure their own server leaves them open to making mistakes with potentially serious implications as explained in the previous point about security. Depending on third-party services puts Flutter in an awkward position of having to pick winners and exposes us to the risk of those projects themselves making policy changes that would affect this feature.
|
||||
|
||||
## [Let flutter be installable via homebrew](https://github.com/flutter/flutter/issues/14050) (#14050)
|
||||
|
||||
<!-- https://github.com/flutter/flutter/issues/14050#issuecomment-1012647917 -->
|
||||
|
||||
Currently, we see this as a lower priority than our other release-related work (such as working towards [SLSA compliance](https://slsa.dev)). There are a number of other mechanisms for obtaining Flutter today, so this does not immediately unblock anyone, it is "merely" a convenience. That said, we recognize that homebrew is a pretty idiomatic way of getting software for developers on macOS, and so the request is quite valid.
|
||||
|
||||
If anyone would be interested in implementing an official homebrew installation path, the best thing to do would be to reach out on the #hackers-releases channel of our Discord (see [[Chat]]). Implementing it would require integrating into our release pipeline, so familiarity with that would be extremely helpful. It would also require carefully negotiating how Flutter's primary distribution mechanism (shipping the `git` repo directly) should interact with Homebrew's mechanisms, so familiarity with both of those would also be needed.
|
||||
|
||||
## [Design a new vector file format](https://github.com/flutter/flutter/issues/1831) (#1831)
|
||||
|
||||
A [design document](https://flutter.dev/go/vector-graphics) containing both a detailed study of the problem and a strawman proposal have been published (comments welcome). The primary goal of the strawman proposal is to see if it is possible to create a format that is implemented entirely on the GPU (the thought being that creating yet another CPU-bound format doesn't really bring the industry forward). The next step is to experiment with implementing the proposal. Unfortunately all our shader experts are currently busy on higher-priority problems (like improving rendering performance and reducing jank), so this work has stalled.
|
||||
|
||||
As usual, contributions are welcome. Reach out to Hixie directly (either by e-mail, ian@hixie.ch, or on our [[Chat]] channels) if you are interested in helping out.
|
||||
|
||||
## [Enable "hot reload" (not just "hot restart") for Flutter Web](https://github.com/flutter/flutter/issues/53041) (#53041)
|
||||
|
||||
Nobody has currently volunteered to work on this. Long term web efforts are primarily focused on Wasm, so we don't expect
|
||||
to see progress soon. It is a technically extremely difficult and subtle problem.
|
||||
|
||||
## [Improve the indexability (SEO) of Flutter apps on the web](https://github.com/flutter/flutter/issues/46789) (#46789)
|
||||
|
||||
This feature is one that is recognized as important. There are some prerequisites, like improving Flutter's deep linking and accessibility features, which we have to deal with first. There are also other issues, like those around performance, plugins, and embedding, that are currently higher on the list for people who are currently contributing to Flutter's web support.
|
||||
|
||||
Fixing this issue is non-trivial, as Flutter's architecture is one that is fundamentally different than what the web usually expects. If you are interested in contributing, the best place to begin would be to discuss potential approaches on our #hackers-web [[Chat]] channel, followed by writing up a design doc (the process for which is also on the [[Chat]] page).
|
||||
|
||||
## [Bring Material 3 to Flutter](https://github.com/flutter/flutter/issues/91605) (#91605)
|
||||
|
||||
Work continues to implement the latest version of Material Design in Flutter's framework, we are making great progress here!
|
||||
|
||||
## [Apple CarPlay / Android Auto support?](https://github.com/flutter/flutter/issues/26801) (#26801)
|
||||
|
||||
For Apple CarPlay, there is a package called [flutter_carplay](https://pub.dev/packages/flutter_carplay) by Oğuzhan Atalay that gives a Flutter API for controlling the CarPlay API. It's not clear that anything beyond that really makes sense for CarPlay, because Apple's API is template based and so Flutter (with its rendering engine, widgets framework, platform neutrality, etc) doesn't really provide any direct value.
|
||||
|
||||
For Android Auto, our understanding is that the situation is similar: there are some templates that you can fill in using Android APIs. To our knowledge nobody has yet created a plugin to expose those APIs to Dart code, but we are not aware of any reason why that would not be possible. (For extra bonus points, one could imagine a package that tries to intelligently fill both CarPlay and Android Auto templates from the same source data, but that may be hard if the templates are too different from each other.)
|
||||
|
||||
Currently, it does not seem that we can provide substantially more value here than anyone else could in writing plugins like Oğuzhan's, so we do not intend to work on this. We would encourage people to work with Oğuzhan and/or create new plugins for these features. Should the situation change (e.g. if CarPlay or Android Auto supported a way for us to directly send pixels to the car dashboard, allowing the power of Flutter's widgets to be useful here), we would reconsider this feature.
|
||||
|
||||
## [Server-side rendering for Flutter web](https://github.com/flutter/flutter/issues/47600) (#47600)
|
||||
|
||||
Fundamentally, rendering Flutter web apps to HTML is incompatible with Flutter's current architecture, and therefore this is not something we are likely to ever attempt. It's also not something we think is particularly useful. We see Flutter as the first of a new breed of frameworks that target WebGL and Wasm and leave HTML behind. For more detailed thoughts, see [the status update on the issue](https://github.com/flutter/flutter/issues/47600#issuecomment-1016920547).
|
||||
|
||||
We believe indexability (SEO) can be addressed without server-side rendering; see the issue above for a discussion of that topic.
|
||||
|
||||
## [Automatic/scalable shader warm-up](https://github.com/flutter/flutter/issues/32170) (#32170)
|
||||
|
||||
Shader warm-up is available on every platform. To automate the generation of shader warm-up files currently requires first manually writing automated tests, and then running these in CI.
|
||||
|
||||
Our medium-term efforts are around removing the need for shader warm-up entirely, and therefore we are not currently planning on working on further automating the creation of shader warm-up files (no point working on something that we want to make irrelevant).
|
||||
|
||||
If we manage to remove the need for shader warm-up entirely, we will close issue #32170. If not, we will reconsider whether additional efforts to automate shader warm-up file generation are warranted.
|
||||
|
||||
## [OpenContainer jank due to multiple frames of shader compilation](https://github.com/flutter/flutter/issues/76180) (#76180)
|
||||
|
||||
A huge area of focus for us right now is our new graphics backend, [Impeller](https://docs.flutter.dev/perf/impeller), which should remove all runtime shader compilation, thus entirely removing this source of jank.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user