Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[go_router_builder] Changes the parameter name of the auto-generated go method from buildContext to context#1635

Merged
fluttergithubbot merged 3 commits intoflutter:mainfrom
mono0926:gorouter-rename-context
May 5, 2022
Merged

[go_router_builder] Changes the parameter name of the auto-generated go method from buildContext to context#1635
fluttergithubbot merged 3 commits intoflutter:mainfrom
mono0926:gorouter-rename-context

Conversation

@mono0926
Copy link
Contributor

@mono0926 mono0926 commented Apr 27, 2022

Changes the parameter name of the auto-generated go method from buildContext to context.

buildContext is redundant, and context is more popular and concise.
It is also more convenient when writing code if it is completed ascontext instead of buildContext.

Screen.Recording.2022-04-27.at.13.58.50.mov

List which issues are fixed by this PR. You must list at least one issue.

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

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.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot changed the base branch from master to main April 27, 2022 04:59
@flutter-dashboard
Copy link

This pull request was opened against a branch other than main. Since Flutter pull requests should not normally be opened against branches other than main, I have changed the base to main. If this was intended, you may modify the base back to master. See the Release Process for information about how other branches get updated.

Reviewers: Use caution before merging pull requests to branches other than main, unless this is an intentional hotfix/cherrypick.

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

1 similar comment
@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.

@mono0926 mono0926 changed the title [go_router_builder] Rename to context from buildContext [go_router_builder] Changed the argument name of the auto-generated go method from buildContext to context Apr 27, 2022
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 chunhtai requested a review from kevmoo April 28, 2022 21:34
@chunhtai
Copy link
Contributor

ci.yaml validation is failing, can you rebased off the main branch to see if it fixes it?

@mono0926 mono0926 force-pushed the gorouter-rename-context branch from 88f59d0 to 86ab5d0 Compare April 28, 2022 22:55
@mono0926
Copy link
Contributor Author

@chunhtai

Thanks for the review 🙏

can you rebased off the main branch to see if it fixes it?

I've rebased now 🚀

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: you changed the parameter. The argument is the thing you pass in. 😄 – not a big deal

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

Thanks, I fixed it and squashed CHANGELOG changes 👍

@mono0926 mono0926 force-pushed the gorouter-rename-context branch from 86ab5d0 to 394f239 Compare April 28, 2022 23:03
@mono0926 mono0926 changed the title [go_router_builder] Changed the argument name of the auto-generated go method from buildContext to context [go_router_builder] Changes the parameter name of the auto-generated go method from buildContext to context Apr 28, 2022
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.

sorry I just realize there is no test, can you add a test to verify the generated code contains the change?

@kevmoo
Copy link
Contributor

kevmoo commented Apr 29, 2022 via email

@chunhtai
Copy link
Contributor

The examples already do that! You're good

On Thu, Apr 28, 2022, 16:58 chunhtai @.> wrote: @.* requested changes on this pull request. sorry I just realize there is no test, can you add a test to verify the generated code contains the change? — Reply to this email directly, view it on GitHub <#1635 (review)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEFCQGEQHYXMDSQGZHKQLVHMQ3BANCNFSM5UN3VH4Q . You are receiving this because you were mentioned.Message ID: @.***>

Are examples run as part of the test?

@ditman
Copy link
Member

ditman commented Apr 29, 2022

Are examples run as part of the test?

@chunhtai I'm not 100% sure: flutter/flutter#102799

@mono0926 mono0926 force-pushed the gorouter-rename-context branch from 394f239 to e704748 Compare April 29, 2022 02:16
@mono0926
Copy link
Contributor Author

mono0926 commented May 1, 2022

@chunhtai

sorry I just realize there is no test, can you add a test to verify the generated code contains the change?

After all, do I need to write a test?
If this part of the test was written already, I would of course fix it appropriately, but since it doesn't exist now, so I feel uncomfortable that I have to write the test.
It would be fine if a Flutter team member could write tests for the existing code first, and then update it.

@mono0926 mono0926 force-pushed the gorouter-rename-context branch 2 times, most recently from e2fb895 to 0d796d4 Compare May 3, 2022 09:52
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, the ci should pick up test in example

@chunhtai
Copy link
Contributor

chunhtai commented May 4, 2022

@mono0926 there may be a conflict in Changelog (looking at build failure). can you rebase off the latest main branch and fix the conflict?

@fluttergithubbot fluttergithubbot merged commit fae67c1 into flutter:main May 5, 2022
@mono0926 mono0926 deleted the gorouter-rename-context branch May 5, 2022 02:02
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.

5 participants