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

docs(animations): add section about animations and view encapsulation #46738

Conversation

dario-piotrowicz
Copy link
Contributor

Add a section regarding component view encapsulations in the complex animation
sequences guide to let developers know how animations work in regard to
view encapsulations.

This section is used to both add information to the guide but also to
take a stand on how the animations should behave in regard to the
shadow dom view encapsulation.

This relates to PR #46488 which by trying to make sure the query
function works with shadow dom elements proved that having the
animations implementation work with shadow dom would increase the
complexity of the code and would have a negative impact on performance,
such facts alongide the small adoption of shadow dom by users influenced
the decision to keep the current functionalities and simply discourage
the use of animations and shadow dom components.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

New section added to the Complex Sequences guide:
Screenshot at 2022-07-07 16-31-04

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

  • @jessicajaniuk 🙂👍
  • I could have added just an alert/callout mentioning that using shadow dom and animations is discouraged, but I thought it would be more useful to actually add a section about animations and view encapsulations in general to make things clearer

Add a section regarding component view encapsulations in the complex animation
sequences guide to let developers know how animations work in regard to
view encapsulations.

This section is used to both add information to the guide but also to
take a stand on how the animations should behave in regard to the
shadow dom view encapsulation.

This relates to PR angular#46488 which by trying to make sure the query
function works with shadow dom elements proved that having the
animations implementation work with shadow dom would increase the
complexity of the code and would have a negative impact on performance,
such facts alongide the small adoption of shadow dom by users influenced
the decision to keep the current functionalities and simply discourage
the use of animations and shadow dom components.
@pullapprove pullapprove bot requested a review from alxhub July 7, 2022 15:45
dario-piotrowicz added a commit to dario-piotrowicz/angular that referenced this pull request Jul 7, 2022
…rent does (angular#46459)"

This reverts commit b417370.

The change applied is no longer appropriate since the use of animations
and shadow dom components is discouraged (as of angular#46738)

Angular animations are based on the components DOM structure and do not directly take [View Encapsulation](/guide/view-encapsulation) into account, this means that components using `ViewEncapsulation.Emulated` behave exactly as if they where using `ViewEncapsulation.None` (`ViewEncapsulation.ShadowDom` behaves differently as we'll discuss shortly).

For example if the `query()` function (which you'll see more of in the rest of the Animations guide) were to be applied at the top of a tree of components using the emulated view encapsulation, such query would be able to identify (and thus animate) DOM elements on any depth of the tree.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

query should probably be a link but it isn't, I kept it as is since it is not a link in the whole guide as well, this may be something to fix later in general

(there are many links in the animations guide which seem broken, it could be worth fixing them all in one PR)

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.

reviewed-for: fw-animations

@jessicajaniuk jessicajaniuk removed the request for review from alxhub July 7, 2022 20:19
@jessicajaniuk jessicajaniuk added action: merge The PR is ready for merge by the caretaker comp: docs area: animations labels Jul 7, 2022
@ngbot ngbot bot modified the milestone: Backlog Jul 7, 2022
@jessicajaniuk jessicajaniuk added the target: patch This PR is targeted for the next patch release label Jul 7, 2022
alxhub pushed a commit that referenced this pull request Jul 7, 2022
…rent does (#46459)" (#46739)

This reverts commit b417370.

The change applied is no longer appropriate since the use of animations
and shadow dom components is discouraged (as of #46738)

PR Close #46739
alxhub pushed a commit that referenced this pull request Jul 7, 2022
…rent does (#46459)" (#46739)

This reverts commit b417370.

The change applied is no longer appropriate since the use of animations
and shadow dom components is discouraged (as of #46738)

PR Close #46739
@alxhub
Copy link
Member

alxhub commented Jul 7, 2022

This PR was merged into the repository by commit 350e364.

alxhub pushed a commit that referenced this pull request Jul 7, 2022
…#46738)

Add a section regarding component view encapsulations in the complex animation
sequences guide to let developers know how animations work in regard to
view encapsulations.

This section is used to both add information to the guide but also to
take a stand on how the animations should behave in regard to the
shadow dom view encapsulation.

This relates to PR #46488 which by trying to make sure the query
function works with shadow dom elements proved that having the
animations implementation work with shadow dom would increase the
complexity of the code and would have a negative impact on performance,
such facts alongide the small adoption of shadow dom by users influenced
the decision to keep the current functionalities and simply discourage
the use of animations and shadow dom components.

PR Close #46738
@alxhub alxhub closed this in 350e364 Jul 7, 2022
@dario-piotrowicz dario-piotrowicz deleted the aio-animations-view-encapsulation-section branch July 8, 2022 18:19
@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 Aug 8, 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: animations target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants