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

fix(ivy): avoid destroy renderer method invocation for child views #27592

Conversation

AndrewKushnir
Copy link
Contributor

Since Renderer is shared across root and child views, we need to avoid destroy method invocation for child views and only invoke is for root view when needed. Prior to this change, the destroy function was called whenever child view was destroyed, thus causing errors at runtime.

As a part of this PR, the MockRendererFactory was moved to render_util.ts, so it can be leveraged in other tests when needed.

This PR resolves issue FW-801.

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)

Does this PR introduce a breaking change?

  • Yes
  • No

@AndrewKushnir AndrewKushnir added type: bug/fix action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release comp: ivy labels Dec 11, 2018
@ngbot ngbot bot added this to the needsTriage milestone Dec 11, 2018
@AndrewKushnir
Copy link
Contributor Author

AndrewKushnir commented Dec 11, 2018

Presubmit

Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

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

LGTM, aside from nits. Feel free to apply merge label when you've addressed the comments.

packages/core/test/render3/component_spec.ts Outdated Show resolved Hide resolved
packages/core/test/render3/component_spec.ts Outdated Show resolved Hide resolved
@kara kara added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 11, 2018
@mary-poppins
Copy link

You can preview b73efa2 at https://pr27592-b73efa2.ngbuilds.io/.

@AndrewKushnir
Copy link
Contributor Author

Thanks for the review @kara! I've updated the code, will wait for tests to pass and add the merge label.

@mary-poppins
Copy link

You can preview cc0466c at https://pr27592-cc0466c.ngbuilds.io/.

@angular angular deleted a comment from mary-poppins Dec 11, 2018
@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Dec 11, 2018
@mhevery mhevery added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note action: merge The PR is ready for merge by the caretaker and removed action: merge The PR is ready for merge by the caretaker labels Dec 11, 2018
Since Renderer is shared across root and child views, we need to avoid `destroy` method invocation for child views and only invoke is for root view when needed. Prior to this change, the `destroy` function was called whenever child view was destroyed, thus causing errors at runtime.
@alxhub alxhub force-pushed the FW-801_host_element_of_undefined-v3 branch from cc0466c to 6142983 Compare December 12, 2018 00:33
@mary-poppins
Copy link

You can preview 6142983 at https://pr27592-6142983.ngbuilds.io/.

@alxhub alxhub removed the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Dec 12, 2018
@alxhub
Copy link
Member

alxhub commented Dec 12, 2018

Rebased after #27586

@mhevery mhevery closed this in 37c05bd Dec 12, 2018
ngfelixl pushed a commit to ngfelixl/angular that referenced this pull request Jan 28, 2019
…ngular#27592)

Since Renderer is shared across root and child views, we need to avoid `destroy` method invocation for child views and only invoke is for root view when needed. Prior to this change, the `destroy` function was called whenever child view was destroyed, thus causing errors at runtime.

PR Close angular#27592
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes target: major This PR is targeted for the next major release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants