-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[go_router] Cleans up route match API and introduces dart fix #3819
Conversation
@@ -0,0 +1 @@ | |||
# This ensures that parent analysis options do not accidentally break the fix tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is causing issues with CI: "Unexpected local analysis options"
@stuartmorgan can you take a look at the ci setup? |
analysis_options.yaml
Outdated
@@ -19,6 +19,9 @@ analyzer: | |||
# Ignore generated files | |||
- '**/*.g.dart' | |||
- '**/*.mocks.dart' # Mockito @GenerateMocks | |||
# Ignore go_router dart fix test file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this is the right place to disable the lint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could make a custom analysis_options.yaml in packages/go_router/
that includes this one, and then adds this exclude. Then you'd need to add go_router to script/configs/custom_analysis.yaml
.
That would make it more obvious locally that something strange is going on with analysis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, this doesn't work. In order to let dart fix --compare-to-golden to work. I can't ignore the lint using analysis_options.yaml as the dart fix would only touch the code that has analyzer error or warning. That means I can't do any kind or ignore that would affect dart analyze
.
I took a look at the flutter repro, it looks like they wrote the custom analyzer script to ignore these lint.
I think I will have to need to update the code in flutter_plugin_tools to ignore the folder when running analyze.
Do you have any other idea that I should do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm, it seems like i can use some analyzer-options trick to get around this
analysis_options.yaml
Outdated
@@ -19,6 +19,9 @@ analyzer: | |||
# Ignore generated files | |||
- '**/*.g.dart' | |||
- '**/*.mocks.dart' # Mockito @GenerateMocks | |||
# Ignore go_router dart fix test file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could make a custom analysis_options.yaml in packages/go_router/
that includes this one, and then adds this exclude. Then you'd need to add go_router to script/configs/custom_analysis.yaml
.
That would make it more obvious locally that something strange is going on with analysis.
.cirrus.yml
Outdated
- name: go_router_dart_fix_test | ||
test_script: | ||
- cd packages/go_router/test_fix | ||
- dart fix --compare-to-golden |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want custom, package-specific tests, they should be in your package, not in the CI config. The mechanism that's in place for that is the custom-test
repo tooling command, which looks for a tool/run_tests.dart
in your package, and runs it if it's there. packages/cross_file/tool/run_tests.dart
is a simple example you can follow. (There's a legacy mode that uses a run_script.sh, but please do not add a new shell-based script. Those are only there because they predate standardizing on repo tooling.)
By default it will run on every host platform, so if you only run it on Linux you should check for Platform.isLinux
in your script, and no-op if it's not Linux.
0a196ef
to
663d38a
Compare
Hi @johnpryan , I updated some code, can you take another look Hi @stuartmorgan , can you take a look at the ci setup again, I addressed all comments |
@@ -37,6 +37,7 @@ See the API documentation for details on the following topics: | |||
- [Error handling](https://pub.dev/documentation/go_router/latest/topics/Error%20handling-topic.html) | |||
|
|||
## Migration guides | |||
- [Migrating to 7.0.0](https://docs.google.com/document/d/10Xbpifbs4E-zh6YE5akIO8raJq_m3FIXs6nUGdOspOg). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would update to flutter go link once website is unfrozen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI parts LGTM with small comments.
@@ -5,5 +5,6 @@ | |||
# mac/windows CI test runs. | |||
|
|||
- cross_file | |||
- go_router |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: I would prefer the platform check to be in the script (e.g., exit immediately if (!Platform.isLinux)
), with an explanation there as to why it's platform-limited, to make the logic as localized as possible. This exclude system was needed because we still have some .sh
scripts, but I hope to eventually eliminate the custom test exclude files.
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Runs `dart test -p chrome` in the root of the cross_file package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not accurate.
packages/go_router/CHANGELOG.md
Outdated
@@ -1,3 +1,19 @@ | |||
## 7.0.0 | |||
|
|||
- **BREAKING CHANGE** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: **BREAKING CHANGES**:
packages/go_router/CHANGELOG.md
Outdated
- For the below changes, please follow the [migration guide](https://docs.google.com/document/d/10Xbpifbs4E-zh6YE5akIO8raJq_m3FIXs6nUGdOspOg). | ||
- `params` and `queryParams` in `BuildContext`'s `namedLocation`, `pushNamed`, `pushReplacementNamed` | ||
`replaceNamed` have been renamed to `pathParameters` and `queryParameters`. | ||
- Cleans up API and makes RouteMatchList immutable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: missing .
3e26f07
to
4fdaf85
Compare
auto label is removed for flutter/packages, pr: 3819, due to - The status or check suite repo_checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
* main: (46 commits) [go_router] Cleans up route match API and introduces dart fix (flutter#3819) [camerax] Add `LifecycleOwner` Proxy (flutter#3837) [file_selector] Add getDirectoryPaths implementation for Windows (flutter#3704) [various] Update Android example min SDKs (flutter#3847) Bump github/codeql-action from 2.2.12 to 2.3.2 (flutter#3838) [camerax] Implement Image Streaming (flutter#3454) [various] update agp and gradle for all examples in packages (flutter#3822) Update xcode to 14c18 (flutter#3774) [camera_android] Add NV21 as an image stream format flutter#3277 (flutter#3639) [go_router] Remove unused navigator keys (flutter#3708) [image_picker] Move I/O operations to a separate thread (flutter#3506) [pigeon]: Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.8.20 to 1.8.21 in /packages/pigeon/platform_tests/test_plugin/android (flutter#3824) [pigeon] Reland: Add an initial example app (flutter#3832) Roll Flutter from c9004ff to 66fa4c5 (68 revisions) (flutter#3830) [various] Conditionalize the namespace in all Android plugins (flutter#3836) [in_app_pur]: Bump com.android.billingclient:billing from 5.1.0 to 5.2.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter#3672) [auick_action_ios] Retries multiple times to not fail ci when there is a flake (flutter#3823) Swap some iOS package CODEOWNERS (flutter#3793) [various] Add `targetCompatibility` to build.gradle (flutter#3825) [various] Set cmake_policy versions (flutter#3828) ...
Roll Packages from 7e3f5da to de6131d (41 revisions) flutter/packages@7e3f5da...de6131d 2023-05-01 reidbaker@google.com I122213 update non examples (flutter/packages#3846) 2023-04-29 47866232+chunhtai@users.noreply.github.com [go_router] Cleans up route match API and introduces dart fix (flutter/packages#3819) 2023-04-29 43054281+camsim99@users.noreply.github.com [camerax] Add `LifecycleOwner` Proxy (flutter/packages#3837) 2023-04-29 stuartmorgan@google.com [file_selector] Add getDirectoryPaths implementation for Windows (flutter/packages#3704) 2023-04-29 stuartmorgan@google.com [various] Update Android example min SDKs (flutter/packages#3847) 2023-04-28 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.2.12 to 2.3.2 (flutter/packages#3838) 2023-04-28 43054281+camsim99@users.noreply.github.com [camerax] Implement Image Streaming (flutter/packages#3454) 2023-04-28 reidbaker@google.com [various] update agp and gradle for all examples in packages (flutter/packages#3822) 2023-04-28 54558023+keyonghan@users.noreply.github.com Update xcode to 14c18 (flutter/packages#3774) 2023-04-28 andrewjohncoutts@gmail.com [camera_android] Add NV21 as an image stream format #3277 (flutter/packages#3639) 2023-04-28 gautier.bayzelon@gmail.com [go_router] Remove unused navigator keys (flutter/packages#3708) 2023-04-28 JeroenWeener@users.noreply.github.com [image_picker] Move I/O operations to a separate thread (flutter/packages#3506) 2023-04-28 49699333+dependabot[bot]@users.noreply.github.com [pigeon]: Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.8.20 to 1.8.21 in /packages/pigeon/platform_tests/test_plugin/android (flutter/packages#3824) 2023-04-28 stuartmorgan@google.com [pigeon] Reland: Add an initial example app (flutter/packages#3832) 2023-04-28 engine-flutter-autoroll@skia.org Roll Flutter from c9004ff to 66fa4c5 (68 revisions) (flutter/packages#3830) 2023-04-28 stuartmorgan@google.com [various] Conditionalize the namespace in all Android plugins (flutter/packages#3836) 2023-04-27 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.billingclient:billing from 5.1.0 to 5.2.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#3672) 2023-04-27 ychris@google.com [auick_action_ios] Retries multiple times to not fail ci when there is a flake (flutter/packages#3823) 2023-04-26 magder@google.com Swap some iOS package CODEOWNERS (flutter/packages#3793) 2023-04-26 stuartmorgan@google.com [various] Add `targetCompatibility` to build.gradle (flutter/packages#3825) 2023-04-26 stuartmorgan@google.com [various] Set cmake_policy versions (flutter/packages#3828) 2023-04-26 stuartmorgan@google.com [path_provider] Allow `win32` up to version 4.x (flutter/packages#3820) 2023-04-26 stuartmorgan@google.com [tool] Move Android lint checks (flutter/packages#3816) 2023-04-25 evace93@gmail.com [google_maps_flutter_android] Fix Android lint warnings (flutter/packages#3751) 2023-04-25 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump androidx.annotation:annotation from 1.5.0 to 1.6.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#3381) 2023-04-25 jason-simmons@users.noreply.github.com Update test golden images for the latest Skia roll (flutter/packages#3787) 2023-04-25 stuartmorgan@google.com [various] Adds Android namespace (flutter/packages#3791) 2023-04-25 reidbaker@google.com [shared_preferences] Update gradle/agp in example apps (flutter/packages#3809) 2023-04-24 43640732+dancamdev@users.noreply.github.com [go_router] Adds name to TypedGoRoute (flutter/packages#3702) 2023-04-22 10687576+bparrishMines@users.noreply.github.com [webview_flutter] Adds support to receive permission requests (flutter/packages#3543) 2023-04-21 stuartmorgan@google.com [google_sign_in] Fix Android Java warnings (flutter/packages#3762) 2023-04-21 stuartmorgan@google.com [local_auth] Fix enum return on Android (flutter/packages#3780) 2023-04-21 stuartmorgan@google.com [pigeon] Warn when trying to use enums in collections (flutter/packages#3782) 2023-04-21 10687576+bparrishMines@users.noreply.github.com [webview_flutter_android] [webview_flutter_wkwebview] Platform implementations for supporting permission requests (flutter/packages#3792) 2023-04-21 scheglov@google.com [pigeon] Update for compatibility with a future change to the analyzer. (flutter/packages#3789) 2023-04-21 10687576+bparrishMines@users.noreply.github.com [camera_android] Fix Android lint warnings (flutter/packages#3716) 2023-04-21 10687576+bparrishMines@users.noreply.github.com [webview_flutter_platform_interface] Adds method to receive permission requests (flutter/packages#3767) 2023-04-21 magder@google.com [image_picker_ios] In unit test write and read kCGImagePropertyExifUserComment property (flutter/packages#3783) 2023-04-21 widrans@gmail.com [go_router_builder] Fixed the return value of the generated push method (flutter/packages#3650) 2023-04-21 JeroenWeener@users.noreply.github.com [image_picker] Mention `launchMode: singleInstance` in README (flutter/packages#3759) 2023-04-21 stuartmorgan@google.com Revert "[pigeon] Add an initial example app" (flutter/packages#3785) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human ...
@chunhtai I just tried v7.0.0 and dart fix isn't getting computed at all
|
@ahmednfwela thanks for reporting. It is weird that It does work if I point the go_router to local directory in pubspec.yaml. I filed a bug dart-lang/sdk#52233 For now, i think you can workaround it by doing a local check out of the go_router and override your dependencies in pubspec.yaml with the path, and run |
@chunhtai nope, doesn't even work when importing path |
Can you try git clone the entire package https://github.com/flutter/packages and then link the dependency into the go_router inside the local copy of the repo? you will need to do |
@ahmednfwela I didn't use dependency_override, can you try using the path in |
@chunhtai doesn't make a difference |
I am sorry to hear that. since this is likely a dart sdk issue, there isn't much I can do to fix this. I will update the migration doc with more detail steps. |
btw here is my environment, so maybe it's a windows only problem ? flutter doctor -v
|
#3819 Fixed go_router_builder to generate code for go_router v7.0.0.
flutter#3819 Fixed go_router_builder to generate code for go_router v7.0.0.
…r#3819) Clean up API around RouteMatch/RouteMatchList/GoRouterState, This is a breaking change that renamed some of the GoRouterState property to have a more descriptive name as flutter style guide suggested https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#avoid-abbreviations also introducing dart fix to help with migration
flutter#3819 Fixed go_router_builder to generate code for go_router v7.0.0.
Clean up API around RouteMatch/RouteMatchList/GoRouterState,
This is a breaking change that renamed some of the GoRouterState property to have a more descriptive name as flutter style guide suggested https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#avoid-abbreviations
also introducing dart fix to help with migration
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.