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

feat(core): add ApplicationRef.destroy method #45624

Closed
wants to merge 1 commit into from

Conversation

AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Apr 13, 2022

This commit implements the destroy method on the ApplicationRef class. This feature is a preparation for the new logic to bootstrap (and teardown) standalone components (without going through the NgModuleRef destroy), which would return an instance of the ApplicationRef (the current bootstrap APIs return an instance of the NgModuleRef).

PR Type

What kind of change does this PR introduce?

  • Feature

Does this PR introduce a breaking change?

  • Yes
  • No

@AndrewKushnir AndrewKushnir added feature Issue that requests a new feature state: WIP area: core Issues related to the framework runtime target: major This PR is targeted for the next major release labels Apr 13, 2022
@ngbot ngbot bot modified the milestone: Backlog Apr 13, 2022
@AndrewKushnir AndrewKushnir force-pushed the appref_destroy branch 5 times, most recently from 93c9643 to 13dfa8b Compare April 14, 2022 01:29
@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer and removed state: WIP labels Apr 14, 2022
@AndrewKushnir AndrewKushnir marked this pull request as ready for review April 14, 2022 01:55
@pullapprove pullapprove bot requested review from atscott and jelbourn and removed request for pkozlowski-opensource April 14, 2022 01:55
@AndrewKushnir
Copy link
Contributor Author

AndrewKushnir commented Apr 14, 2022

Presubmit (TGP).

@@ -15,7 +15,7 @@
"master": {
"uncompressed": {
"runtime": 4343,
"main": 451472,
"main": 452174,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note to reviewers: the payload size in this PR is expected (due to extra non-tree-shakable code that was added). It's ~350 bytes and the rest was accumulated already from other changes.

Copy link
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

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

reviewed-for: size-tracking, public-api

goldens/public-api/core/index.md Outdated Show resolved Hide resolved
@pullapprove pullapprove bot requested a review from dylhunn April 14, 2022 21:11
Copy link
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api, size-tracking

Copy link
Contributor

@jessicajaniuk jessicajaniuk left a comment

Choose a reason for hiding this comment

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

LGTM 🍪

reviewed-for: public-api, size-tracking

@AndrewKushnir AndrewKushnir force-pushed the appref_destroy branch 2 times, most recently from e2dfb62 to 43e9f67 Compare April 14, 2022 23:16
@AndrewKushnir
Copy link
Contributor Author

"Green" TGP.

@AndrewKushnir AndrewKushnir force-pushed the appref_destroy branch 4 times, most recently from a343cb0 to acaa26c Compare April 16, 2022 02:28
@AndrewKushnir AndrewKushnir removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 16, 2022
}

destroy(): void {
if (this._destroyed) {
Copy link
Member

Choose a reason for hiding this comment

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

Rather than track this._destroyed, we should delegate to injector.destroyed.

Copy link
Member

@alxhub alxhub left a comment

Choose a reason for hiding this comment

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

Reviewed-for: public-api

@AndrewKushnir AndrewKushnir force-pushed the appref_destroy branch 2 times, most recently from 936b555 to 8b30b0f Compare April 18, 2022 17:05
This commit implements the `destroy` method on the `ApplicationRef` class. This feature is a preparation for the new logic to bootstrap (and teardown) standalone components (without going through the `NgModuleRef` destroy), which would return an instance of the `ApplicationRef` (the current bootstrap APIs return an instance of the `NgModuleRef`).
@AndrewKushnir
Copy link
Contributor Author

Presubmit after the rebase.

@AndrewKushnir AndrewKushnir added action: presubmit The PR is in need of a google3 presubmit action: merge The PR is ready for merge by the caretaker and removed action: presubmit The PR is in need of a google3 presubmit labels Apr 18, 2022
@AndrewKushnir AndrewKushnir removed the request for review from jelbourn April 18, 2022 19:56
@dylhunn
Copy link
Contributor

dylhunn commented Apr 18, 2022

This PR was merged into the repository by commit 174ce7d.

@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 May 19, 2022
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 area: core Issues related to the framework runtime feature Issue that requests a new feature target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants