Skip to content

[go_router] Add support for Iterable, List and Set to TypedGoRoute #2698

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

Conversation

Skogsfrae
Copy link
Contributor

@Skogsfrae Skogsfrae commented Oct 10, 2022

Add support for Iterable, List and Set to TypedGoRoute

Changed signature of GoRouteData.$location for PR #2679
Resolves Issue #108437

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].
  • I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style].
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@stuartmorgan-g
Copy link
Contributor

@chunhtai From triage: ping on this review.

@chunhtai
Copy link
Contributor

Updates: this one is waiting on #2679

Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chunhtai
Copy link
Contributor

chunhtai commented Dec 1, 2022

Hi @Skogsfrae looks like there are ci failures and merge conflict. can you rebase off the latest main and fix the ci?

@Skogsfrae Skogsfrae force-pushed the feature/#108437_go_router-support-for-iterables branch from aa84861 to 173e37a Compare December 7, 2022 14:23
@Skogsfrae
Copy link
Contributor Author

Hi @chunhtai I finally managed to make the ci work. I temporarily modified the analysis_options.yaml to skip go_router_builder example app .g.dart files. I'll restore it in the go_router_builder pr after this gets merged

@@ -18,6 +18,7 @@ analyzer:
exclude: # DIFFERENT FROM FLUTTER/FLUTTER
# Ignore generated files
- '**/*.mocks.dart' # Mockito @GenerateMocks
- 'packages/go_router_builder/example/*' # TODO(skogsfrae): remove in https://github.com/flutter/packages/pull/2679
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not be turning off analysis for an entire directory. What problem is this intended to solve?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartmorgan This pr changes the signature of a go_router method used in .g.dart generated files and causing problems in cyrrus ci analysis step when running the analyser for go_router_builder/example app.

Talking about that on discord, @chunhtai told me to temporarily disable the analysis for that example app so this pr can be merged and then reenable it in #2679
I first tried to disable the analysis only on those specific files, but then I faced another problem for updating a file of a library without increasing its version, so I had to revert it.

This are the cyrrus ci logs:
https://cirrus-ci.com/task/4546239256592384
https://cirrus-ci.com/task/6292642485501952

Running command: "dart analyze --fatal-infos" in /tmp/cirrus-ci-build/packages/go_router_builder
Analyzing go_router_builder...
   info - example/lib/all_types.g.dart:205:61 - Unnecessary null checks. - unnecessary_null_checks
   info - example/lib/all_types.g.dart:226:60 - Unnecessary null checks. - unnecessary_null_checks
   info - example/lib/all_types.g.dart:244:63 - Unnecessary null checks. - unnecessary_null_checks
   info - example/lib/main.g.dart:122:54 - Unnecessary null checks. - unnecessary_null_checks
4 issues found.
if [[ $CIRRUS_PR == "" ]]; then
./script/tool_runner.sh version-check --ignore-platform-interface-breaks
else
./script/tool_runner.sh version-check --check-for-missing-changes --pr-labels="$CIRRUS_PR_LABELS"
fi
Running for all packages that have diffs relative to "fdf708371f2e33f44189ebc43d896679b7ebf463"

Changed packages: go_router,go_router_builder
�[36m[0:00] Running for go_router...�[0m
  5.2.0 -> 5.2.1
�[36m[0:00] Running for go_router_builder...�[0m
  No version change.
�[31mNo CHANGELOG change found. If this PR needs an exemption from the standard policy of listing all changes in the CHANGELOG, comment in the PR to explain why the PR is exempt, and add (or ask your reviewer to add) the "override: no changelog needed" label. Otherwise, please add a NEXT entry in the CHANGELOG as described in the contributing guide.�[0m


�[31mThe following packages had errors:�[0m
�[31m  go_router_builder:
    Missing CHANGELOG change�[0m
�[31mSee above for full details.�[0m

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then I faced another problem for updating a file of a library without increasing its version, so I had to revert it.

The second failure you linked to is only for not having a CHANGELOG entry, not lack of version update, and as the error message says that's trivially overridable when it makes sense to do so (as in this case). Local ignores and an override for the changelog would be much better than changing the root analysis configuration to opt everything out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for that, I genuinely thought it was a versioning problem.
I fixed the pr, can you add the override: no changelog needed label? I can't do it

@Skogsfrae
Copy link
Contributor Author

If someone can please add the override: no changelog needed I'll update the pr to solve the conflicts and the CI could run without the previous changelog problem

@stuartmorgan-g stuartmorgan-g added the override: no changelog needed Override the check requiring CHANGELOG updates for most changes label Dec 12, 2022
@stuartmorgan-g
Copy link
Contributor

Overriding for go_router_builder; ignores are dev-only changes.

@Skogsfrae Skogsfrae force-pushed the feature/#108437_go_router-support-for-iterables branch from 3217a65 to 691a372 Compare December 12, 2022 16:38
@Skogsfrae
Copy link
Contributor Author

@chunhtai this is ready to be merged

@stuartmorgan-g
Copy link
Contributor

@johnpryan Who should do the second review on this?

@stuartmorgan-g
Copy link
Contributor

@chunhtai It looks like you reviewed this before, could you re-review as the second reviewer?

Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chunhtai
Copy link
Contributor

@Skogsfrae can you rebase off latest main?

@Skogsfrae Skogsfrae force-pushed the feature/#108437_go_router-support-for-iterables branch from 691a372 to 262df99 Compare February 7, 2023 14:01
@Skogsfrae
Copy link
Contributor Author

@chunhtai I rebased both this pr and the one on go_router_builder

@Skogsfrae Skogsfrae force-pushed the feature/#108437_go_router-support-for-iterables branch from 28e55cd to eacf2f2 Compare February 14, 2023 08:26
@Skogsfrae
Copy link
Contributor Author

@chunhtai I just rebased it again with the last release. Is there something else that needs to be done to merge this PR?

@Skogsfrae Skogsfrae force-pushed the feature/#108437_go_router-support-for-iterables branch from eacf2f2 to fc79f9c Compare February 16, 2023 17:03
@Skogsfrae
Copy link
Contributor Author

@chunhtai @stuartmorgan @johnpryan can this PR be merged so I can update the linked one and hopefully have that merged too?
I'm keeping this updated with upstream and I'd really like to be able to use this feature with go_router_builder

Thank you guys 🙏🏼

@stuartmorgan-g
Copy link
Contributor

Based on the last comments from reviewers it looks like this is ready to land and just didn't get the label.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 16, 2023
@auto-submit auto-submit bot merged commit fa7cdfa into flutter:main Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App needs tests override: no changelog needed Override the check requiring CHANGELOG updates for most changes p: go_router
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants