Skip to content
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

migrate rendering to nullsafety #64621

Merged
merged 4 commits into from Aug 27, 2020
Merged

Conversation

Hixie
Copy link
Contributor

@Hixie Hixie commented Aug 26, 2020

This is a continuation of #64456, the nnbd migration of rendering/.

@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Aug 26, 2020
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@Hixie Hixie marked this pull request as draft August 26, 2020 07:36
@Hixie Hixie mentioned this pull request Aug 26, 2020
13 tasks
@mit-mit
Copy link
Member

mit-mit commented Aug 26, 2020

Related to dart-lang/sdk#40146

/// [addWithPaintOffset].
///
/// * `paintTransform` has the semantics of the `transform` passed to
/// [addWithPaintTransform], except thit it must be invertible; it
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: that

@@ -165,6 +165,11 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
extends RenderBox with ContainerRenderObjectMixin<RenderSliver, ParentDataClass>
implements RenderAbstractViewport {
/// Initializes fields for subclasses.
/// Initializes fields for subclasses.
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicated line

@a14n
Copy link
Contributor

a14n commented Aug 26, 2020

Looks good but CI is failing

@Hixie Hixie force-pushed the nnbd-rendering branch 4 times, most recently from e812f9a to cd4421c Compare August 26, 2020 21:49
@Hixie Hixie added cla: yes and removed cla: no labels Aug 26, 2020
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@Hixie
Copy link
Contributor Author

Hixie commented Aug 26, 2020

(overriding clabot status because @a14n and I are working together on this)

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@Hixie Hixie force-pushed the nnbd-rendering branch 2 times, most recently from 93e5b51 to 06dea30 Compare August 26, 2020 23:53
@Hixie Hixie marked this pull request as ready for review August 27, 2020 00:21
@flutter-dashboard flutter-dashboard bot added the a: tests "flutter test", flutter_test, or one of our tests label Aug 27, 2020
@Hixie Hixie added cla: yes and removed cla: no labels Aug 27, 2020
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

Copy link
Contributor

@a14n a14n left a comment

Choose a reason for hiding this comment

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

LGTM

@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite testonly_devicelab_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM after comment is resolved

final Map<int, TableColumnWidth> columnWidths;
///
/// If this is set to null, then an empty map is assumed.
final Map<int, TableColumnWidth>/*?*/ columnWidths;
Copy link
Member

Choose a reason for hiding this comment

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

Why is this still specified as an annotation?

Copy link
Contributor

Choose a reason for hiding this comment

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

because this file is still opted-out (in widgets)

Copy link
Member

Choose a reason for hiding this comment

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

Ah, that makes sense! Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we haven't migrated widgets/ yet. This is just making sure we make the right call when we get to it.

String joiner = ', ',
DiagnosticLevel minLevel = DiagnosticLevel.debug,
}) {
if (kReleaseMode) {
Copy link
Member

Choose a reason for hiding this comment

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

IIRC the reason these were added is that dart2js could not optimize the function otherwise. If that is still the case I would expect it to show up on the web size benchmarks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on the history, @dnfield added the original if (kReleaseMode) return logic, then @ferhatb added the assert() around the body. This removes the if condition and leaves the assert so that the method can be non-nullable. I think it was ferhat's change that improved size, and this keeps that logic. Let's keep an eye on the numbers though, certainly...

Copy link
Member

Choose a reason for hiding this comment

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

Ahh, yeah - I think I was remembering it backwards

Copy link
Contributor

Choose a reason for hiding this comment

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

The problem with making this an assert is that profile mode will no longer show as much helpful information. But I guess we don't have any tests covering that and no one is complaining about it so oh well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My general opinion on this is release and profile should be as close to identical as possible except for the minimum required to actually enable collecting metrics.

@@ -830,52 +827,52 @@ class RenderCustomPaint extends RenderProxyBox {
config.isChecked = properties.checked;
}
if (properties.selected != null) {
Copy link
Member

Choose a reason for hiding this comment

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

This function makes me sad

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah...

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@Hixie Hixie added cla: yes and removed cla: no labels Aug 27, 2020
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@fluttergithubbot fluttergithubbot merged commit 8a6a76a into flutter:master Aug 27, 2020
@ferhatb
Copy link
Contributor

ferhatb commented Aug 28, 2020

Yes profile mode info is reduced but closer to release build. This also allowed us to write an integration test to detect if treeshaking regresses.

mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants