Skip to content

Conversation

johnpryan
Copy link
Contributor

@johnpryan johnpryan commented Jul 25, 2022

I'm not sure why the unit tests aren't catching this, but we changed the location of the GoRouteData and TypedRoute classes in #2317 so these strings need to be updated to match.

Fixes flutter/flutter#108274

@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.

Copy link
Contributor

@kevmoo kevmoo left a comment

Choose a reason for hiding this comment

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

VERY weird this is not picked up as breaking in CI

@johnpryan
Copy link
Contributor Author

I think the tests are failing because this expects go_router 4.2.1 (#2317), but the latest version on Pub is 4.2.0.

@johnpryan
Copy link
Contributor Author

@stuartmorgan what's the best way to proceed?

@loic-sharma
Copy link
Member

@kevmoo See: flutter/plugins#6146

@stuartmorgan-g
Copy link
Collaborator

stuartmorgan-g commented Jul 26, 2022

Capturing from issue and Discord comments: 4.2.1 isn't available because I retracted it, as the issue this PR is intended to fix caused out-of-band tree breakage. Retracting 4.2.1 acted as an immediate quasi-revert to fix the tree (and avoided more people hitting flutter/flutter#108274)

The next step is to revert the breaking changes in go_router, or fix them forward once I publish the tooling update (in a few minutes hopefully) so that the PR will be tested correctly.

@stuartmorgan-g
Copy link
Collaborator

Okay, version 0.8.9 of the tooling is published with the change from flutter/plugins#6146. So the next step is to make a PR that rolls to 0.8.9 (see #2300 for the two files you need to change; unfortunately there's not a single source of truth for the version right now) to make sure the PR is being tested correctly, and also either:

  • reverts the changes that were in go_router 4.2.1, or
  • fixes them forward in a way that passes with the new tooling.

Importantly, that PR should not change go_router_builder in order to make presubmit pass, because that would indicate that the PR was papering over an actual version incompatibility between go_router and go_router_builder that could hit end users of the packages (see discussion in Discord #hackers-routing).

No other changes should be landed in go_router until that's happened, per my comment in another PR, as any new version published before then will just re-break everyone (including flutter/packages PRs) and need to be retracted as well.

@@ -18,7 +18,7 @@ class GoRouterGenerator extends GeneratorForAnnotation<void> {

@override
TypeChecker get typeChecker => const TypeChecker.fromUrl(
'package:go_router/src/route_data.dart#TypedGoRoute',
'package:go_router/src/typed_routing.dart#TypedGoRoute',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kevmoo Do you know if we change this to package:go_router/go_router.dart#TypedGoRoute instead? go_router.dart exports this library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't seem to work...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note also that changing go_router_builder can't be a complete fix for the issue created by 4.2.1; a complete fix must be in go_router.

Versions of go_router_builder that have this src dependency have already been published and are in use in the wild, and they depend on go_router: ^4.0.0. People using those existing versions can get new versions of go_router without getting new versions of go_router_builder, so unless you are comfortable breaking those people by violating semver you need to revert or otherwise fix go_router before publishing it again as 4.x.x.

@@ -18,7 +18,7 @@ class GoRouterGenerator extends GeneratorForAnnotation<void> {

@override
TypeChecker get typeChecker => const TypeChecker.fromUrl(
'package:go_router/src/route_data.dart#TypedGoRoute',
'package:go_router/src/typed_routing.dart#TypedGoRoute',
Copy link
Contributor

Choose a reason for hiding this comment

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

typedgoroute is exposed as a public class, this should be 'package:go_router/go_router.dart#TypedGoRoute`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, this doesn't seem to work

@johnpryan
Copy link
Contributor Author

Reverting the change to go_router here: #2385

@johnpryan johnpryan closed this Jul 26, 2022
@johnpryan johnpryan deleted the fix-go-router-builder branch August 11, 2022 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[go_router] go_router 4.2.1 breaks go_router_builder
5 participants