Skip to content

Conversation

@tvolkert
Copy link
Contributor

@tvolkert tvolkert commented Aug 19, 2020

Description

This deprecates the following methods:

  • RenderObjectElement.insertChildRenderObject
  • RenderObjectElement.moveChildRenderObject
  • RenderObjectElement.removeChildRenderObject

... and replaces them with the following methods:

  • RenderObjectElement.insertRenderObjectChild
  • RenderObjectElement.moveRenderObjectChild
  • RenderObjectElement.removeRenderObjectChild

The reason for the deprecation is to provide the oldSlot argument to
the moveRenderObjectChild method (such an argument was missing from
the now-deprecated moveChildRenderObject method) and the slot
argument to the removeRenderObjectChild method (such an argument was
missing from the now-deprecated removeChildRenderObject method). While
no argument was added to insertRenderObjectChild, the name change (and
corresponding deprecation) was made to maintain naming parity with the
other two methods.

This initial step does not update or remove any of the slotToChild
patterns that exist in the framework. This work is being separated
into two commits in case something needs to be reverted to minimize
the scope of each commit.

Related Issues

See #63269 for more info

Tests

I added the following tests:

  • Verify the correct slots are passed to the methods
  • Verify that the new methods delegate to the old methods in the base class
  • Verify that an assertion error is thrown that informs the developer of the deprecation if old methods are ever invoked

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read [Handling breaking changes].

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

This deprecates the following methods:

* RenderObjectElement.insertChildRenderObject
* RenderObjectElement.moveChildRenderObject
* RenderObjectElement.removeChildRenderObject

And replace them with the following methods:

* RenderObjectElement.insertRenderObjectChild
* RenderObjectElement.moveRenderObjectChild
* RenderObjectElement.removeRenderObjectChild

The reason for the deprecation is to provide the `oldSlot` argument to
the [moveRenderObjectChild] method (such an argument was missing from
the now-deprecated [moveChildRenderObject] method) and the `slot`
argument to the [removeRenderObjectChild] method (such an argument was
missing from the now-deprecated [removeChildRenderObject] method). While
no argument was added to [insertRenderObjectChild], the name change (and
corresponding deprecation) was made to maintain naming parity with the
other two methods.

This initial step does not update or remove any of the `slotToChild`
patterns that exist in the framework. This work is being separated
into two commits in case something needs to be reverted to minimize
the scope of each commit.

See #63269 for more info
@flutter-dashboard flutter-dashboard bot added f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Aug 19, 2020
@tvolkert tvolkert requested review from Hixie and goderbauer August 19, 2020 21:26
Copy link
Contributor

@Hixie Hixie left a comment

Choose a reason for hiding this comment

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

LGTM

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 once all checks pass.

@tvolkert tvolkert merged commit 21cfed3 into flutter:master Aug 20, 2020
@tvolkert tvolkert deleted the render_object_element branch August 20, 2020 00:39
@mehmetf
Copy link
Contributor

mehmetf commented Aug 20, 2020

This is a breaking change. Internal chart library compilation is failing with:

  This method overrides a method annotated as '@mustCallSuper' in 'RenderObjectElement', but doesn't invoke the overridden method. #must_call_super

We need to soft land this internally and come up with a breaking change document.

@tvolkert
Copy link
Contributor Author

Soft land step is cl/327627478, and re-application of this PR is #64254

tvolkert added a commit that referenced this pull request Aug 20, 2020
@goderbauer
Copy link
Member

Technically, because of the google3 breakage this is a breaking change now per https://github.com/flutter/flutter/wiki/Tree-hygiene#1-determine-if-your-change-is-a-breaking-change.

Maybe we should publish a quick migration guide for it on https://flutter.dev/docs/release/breaking-changes.

smadey pushed a commit to smadey/flutter that referenced this pull request Aug 27, 2020
)

* (insert|move|remove)ChildRenderObject Deprecation: Step 1

This deprecates the following methods:

* RenderObjectElement.insertChildRenderObject
* RenderObjectElement.moveChildRenderObject
* RenderObjectElement.removeChildRenderObject

...and replaces them with the following methods:

* RenderObjectElement.insertRenderObjectChild
* RenderObjectElement.moveRenderObjectChild
* RenderObjectElement.removeRenderObjectChild

The reason for the deprecation is to provide the `oldSlot` argument to
the `moveRenderObjectChild` method (such an argument was missing from
the now-deprecated `moveChildRenderObject` method) and the `slot`
argument to the `removeRenderObjectChild` method (such an argument was
missing from the now-deprecated `removeChildRenderObject` method). While
no argument was added to `insertRenderObjectChild`, the name change (and
corresponding deprecation) was made to maintain naming parity with the
other two methods.

This initial step does not update or remove any of the `slotToChild`
patterns that exist in the framework. This work is being separated
into two commits in case something needs to be reverted to minimize
the scope of each commit.

See flutter#63269 for more info
smadey pushed a commit to smadey/flutter that referenced this pull request Aug 27, 2020
smadey pushed a commit to smadey/flutter that referenced this pull request Aug 27, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
)

* (insert|move|remove)ChildRenderObject Deprecation: Step 1

This deprecates the following methods:

* RenderObjectElement.insertChildRenderObject
* RenderObjectElement.moveChildRenderObject
* RenderObjectElement.removeChildRenderObject

...and replaces them with the following methods:

* RenderObjectElement.insertRenderObjectChild
* RenderObjectElement.moveRenderObjectChild
* RenderObjectElement.removeRenderObjectChild

The reason for the deprecation is to provide the `oldSlot` argument to
the `moveRenderObjectChild` method (such an argument was missing from
the now-deprecated `moveChildRenderObject` method) and the `slot`
argument to the `removeRenderObjectChild` method (such an argument was
missing from the now-deprecated `removeChildRenderObject` method). While
no argument was added to `insertRenderObjectChild`, the name change (and
corresponding deprecation) was made to maintain naming parity with the
other two methods.

This initial step does not update or remove any of the `slotToChild`
patterns that exist in the framework. This work is being separated
into two commits in case something needs to be reverted to minimize
the scope of each commit.

See flutter#63269 for more info
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
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 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants