-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Make future and stream required arguments in their respective builder widgets
#125838
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
future and stream required arguments in their respective builder widgets
domesticmouse
left a comment
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.
Does this classify as a breaking change?
|
PTAL @goderbauer |
I figured so as it will throw a compiler error for anyone who has been using the builders with omitted |
All checks are passing (including goole and customer tests), so according to our breaking change policy, this is not considered breaking and we can merge this as is. |
goderbauer
left a comment
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.
LGTM
…tive builder widgets (flutter/flutter#125838)
flutter/flutter@828a040...db6074a 2023-05-02 [email protected] Roll Flutter Engine from 46d5ce4784b8 to 44376e8cd3de (1 revision) (flutter/flutter#125876) 2023-05-02 [email protected] Roll Flutter Engine from a687d62ff631 to 46d5ce4784b8 (1 revision) (flutter/flutter#125874) 2023-05-02 [email protected] Roll Flutter Engine from d0ed35b7bf67 to a687d62ff631 (1 revision) (flutter/flutter#125871) 2023-05-02 [email protected] Roll Flutter Engine from c0d68c36c376 to d0ed35b7bf67 (1 revision) (flutter/flutter#125870) 2023-05-02 [email protected] Roll Flutter Engine from a9e38dd0510d to c0d68c36c376 (1 revision) (flutter/flutter#125868) 2023-05-02 [email protected] Roll Flutter Engine from 024bf946232d to a9e38dd0510d (2 revisions) (flutter/flutter#125866) 2023-05-02 [email protected] Make `future` and `stream` required arguments in their respective builder widgets (flutter/flutter#125838) 2023-05-02 [email protected] Roll Flutter Engine from 7d87410a51d5 to 024bf946232d (6 revisions) (flutter/flutter#125858) 2023-05-02 [email protected] Roll Flutter Engine from 3fa6084dfb36 to 7d87410a51d5 (4 revisions) (flutter/flutter#125845) 2023-05-02 [email protected] Migrate Xcode projects last version checks to Xcode 14.3 (flutter/flutter#125827) 2023-05-01 [email protected] Roll Flutter Engine from 58cc54197a54 to 3fa6084dfb36 (1 revision) (flutter/flutter#125839) 2023-05-01 [email protected] Roll Flutter Engine from 687f4c761db1 to 58cc54197a54 (6 revisions) (flutter/flutter#125833) 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 Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/flutter@828a040...db6074a 2023-05-02 [email protected] Roll Flutter Engine from 46d5ce4784b8 to 44376e8cd3de (1 revision) (flutter/flutter#125876) 2023-05-02 [email protected] Roll Flutter Engine from a687d62ff631 to 46d5ce4784b8 (1 revision) (flutter/flutter#125874) 2023-05-02 [email protected] Roll Flutter Engine from d0ed35b7bf67 to a687d62ff631 (1 revision) (flutter/flutter#125871) 2023-05-02 [email protected] Roll Flutter Engine from c0d68c36c376 to d0ed35b7bf67 (1 revision) (flutter/flutter#125870) 2023-05-02 [email protected] Roll Flutter Engine from a9e38dd0510d to c0d68c36c376 (1 revision) (flutter/flutter#125868) 2023-05-02 [email protected] Roll Flutter Engine from 024bf946232d to a9e38dd0510d (2 revisions) (flutter/flutter#125866) 2023-05-02 [email protected] Make `future` and `stream` required arguments in their respective builder widgets (flutter/flutter#125838) 2023-05-02 [email protected] Roll Flutter Engine from 7d87410a51d5 to 024bf946232d (6 revisions) (flutter/flutter#125858) 2023-05-02 [email protected] Roll Flutter Engine from 3fa6084dfb36 to 7d87410a51d5 (4 revisions) (flutter/flutter#125845) 2023-05-02 [email protected] Migrate Xcode projects last version checks to Xcode 14.3 (flutter/flutter#125827) 2023-05-01 [email protected] Roll Flutter Engine from 58cc54197a54 to 3fa6084dfb36 (1 revision) (flutter/flutter#125839) 2023-05-01 [email protected] Roll Flutter Engine from 687f4c761db1 to 58cc54197a54 (6 revisions) (flutter/flutter#125833) 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 Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…tive builder widgets (flutter/flutter#125838)
…tive builder widgets (flutter/flutter#125838)
…tive builder widgets (flutter/flutter#125838)
…tive builder widgets (flutter/flutter#125838)
cc'ing existing conversation participants: @domesticmouse @srawlins
cc'ing to request review: @goderbauer
This PR makes the following constructor arguments required:
FutureBuilder.futureStreamBuilderBase.streamStreamBuilder.streamThis fixes:
#83081
#125188 (dupe of 83081)
This obviates:
dart-lang/sdk#59118
(I suggest we skip straight to merging this PR as this should be a low impact breaking change-assuming few to no devs are intentionally using the builders without their relevant arguments, however we could always merge 4309 first and then this)
#83101
(The above PR required that at least one of future and initial data be non-null, this is undesirable as there are plenty of valid reasons to have both arguments be null)
See above issues for a deeper dive, but here is a summary:
It is very easy for a developer to forget to specify
futureorstreamwhen using the respective*Builderwidgets. This produces a non-obvious failure where the UI sits in a "no data yet received" state. It is easy for a dev to misinterpret this as the async work backing the future/stream hanging and they thus waste a lot of time trying to debug the async work.As such, we should require these two constructor arguments to make it impossible/much harder for devs to make this time-wasting mistake.
This is a breaking change. However, it should break only a small number of active projects given that using a builder without specifying
futureorstreamseems highly niche.The only place I've found non-accidental examples of this is in widget tests where you're calling
pumpWidgetwith and without these arguments to test*Builder.didUpdateWidget's behavior. In this and similar cases, it is a trivial fix to addfuture: null/stream: null.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
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.