Skip to content

fix(ivy): add attributes and classes to host elements based on selector#34481

Closed
AndrewKushnir wants to merge 2 commits intoangular:masterfrom
AndrewKushnir:selector_attrs_and_classes
Closed

fix(ivy): add attributes and classes to host elements based on selector#34481
AndrewKushnir wants to merge 2 commits intoangular:masterfrom
AndrewKushnir:selector_attrs_and_classes

Conversation

@AndrewKushnir
Copy link
Copy Markdown
Contributor

@AndrewKushnir AndrewKushnir commented Dec 19, 2019

In View Engine, host element of dynamically created component received attributes and classes extracted from component's selector. For example, if component selector is [attr] .class, the attr attribute and .class class will be add to host element. This commit adds similar logic to Ivy, to make sure this behavior is aligned with View Engine.

This PR resolves #35445.

PR Type

What kind of change does this PR introduce?

  • Bugfix

Does this PR introduce a breaking change?

  • Yes
  • No

@AndrewKushnir AndrewKushnir added type: bug/fix state: blocked target: patch This PR is targeted for the next patch release comp: ivy labels Dec 19, 2019
@ngbot ngbot Bot added this to the needsTriage milestone Dec 19, 2019
@AndrewKushnir
Copy link
Copy Markdown
Contributor Author

Note: this PR is blocked on PR #34450, since functions that work with selectors (in this PR and in PR #34450) should be combined/refactored.

@AndrewKushnir AndrewKushnir force-pushed the selector_attrs_and_classes branch 2 times, most recently from 8bf5584 to b6156f9 Compare January 15, 2020 18:18
@pullapprove pullapprove Bot requested a review from alxhub January 29, 2020 20:25
@AndrewKushnir AndrewKushnir removed the request for review from alxhub January 31, 2020 00:46
@pullapprove pullapprove Bot requested a review from alxhub January 31, 2020 00:46
@AndrewKushnir AndrewKushnir force-pushed the selector_attrs_and_classes branch from b6156f9 to 947db2c Compare January 31, 2020 00:47
@AndrewKushnir AndrewKushnir force-pushed the selector_attrs_and_classes branch 2 times, most recently from 8a5350c to 4362bd1 Compare February 1, 2020 03:13
@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer and removed state: WIP labels Feb 1, 2020
@AndrewKushnir AndrewKushnir requested a review from kara February 1, 2020 03:14
@AndrewKushnir AndrewKushnir marked this pull request as ready for review February 1, 2020 03:14
Copy link
Copy Markdown
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.

Thanks for picking this up! Some thoughts below

Comment thread packages/core/test/acceptance/view_container_ref_spec.ts Outdated
Comment thread packages/core/src/render3/component.ts Outdated
Comment thread packages/core/src/render3/node_manipulation.ts Outdated
Comment thread packages/core/src/render3/component_ref.ts Outdated
Comment thread packages/core/src/render3/component.ts Outdated
Comment thread packages/core/test/acceptance/view_container_ref_spec.ts Outdated
@AndrewKushnir AndrewKushnir force-pushed the selector_attrs_and_classes branch 2 times, most recently from 4b37ae3 to 006690d Compare February 5, 2020 20:53
@AndrewKushnir AndrewKushnir removed the request for review from alxhub February 5, 2020 20:58
@AndrewKushnir
Copy link
Copy Markdown
Contributor Author

Thanks for the review @kara. I've updated the code according to the comments/suggestions. Could you please have another look when you get a chance? Thank you.

@pkozlowski-opensource
Copy link
Copy Markdown
Member

@AndrewKushnir in the description of this PR you've referenced issue #34256 but #34256 is closed now (and looks like a bit different issue from what this PR is solving?).

On the other hand it seems like this PR should fix #35445

@AndrewKushnir AndrewKushnir force-pushed the selector_attrs_and_classes branch from cf5b06d to a7715e7 Compare February 14, 2020 18:18
@AndrewKushnir
Copy link
Copy Markdown
Contributor Author

@pkozlowski-opensource issue #34256 was resolved by a different PR (#35136, to fix namespaces issue with dynamically created components). You are right, the problem described in the #35445 should be fixed by the changes in this PR. I've rebased it, waiting for final review from Kara. Thank you.

@AndrewKushnir AndrewKushnir force-pushed the selector_attrs_and_classes branch 2 times, most recently from af16106 to 82bea75 Compare February 14, 2020 19:36
Comment thread packages/core/src/render3/component_ref.ts Outdated
@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 Feb 18, 2020
@AndrewKushnir AndrewKushnir added action: presubmit The PR is in need of a google3 presubmit 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 Feb 18, 2020
@AndrewKushnir
Copy link
Copy Markdown
Contributor Author

AndrewKushnir commented Feb 18, 2020

Presubmit

Copy link
Copy Markdown
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

Comment thread packages/core/test/acceptance/view_container_ref_spec.ts Outdated
@kara kara added 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 Feb 18, 2020
@AndrewKushnir AndrewKushnir force-pushed the selector_attrs_and_classes branch from 1a38e83 to fabe7e7 Compare February 18, 2020 21:37
In View Engine, host element of dynamically created component received attributes and classes extracted from component's selector. For example, if component selector is `[attr] .class`, the `attr` attribute and `.class` class will be add to host element. This commit adds similar logic to Ivy, to make sure this behavior is aligned with View Engine.
@AndrewKushnir AndrewKushnir force-pushed the selector_attrs_and_classes branch from fabe7e7 to 16cd18e Compare February 18, 2020 21:37
@alxhub alxhub closed this in f95b8ce Feb 19, 2020
alxhub pushed a commit that referenced this pull request Feb 19, 2020
…or (#34481)

In View Engine, host element of dynamically created component received attributes and classes extracted from component's selector. For example, if component selector is `[attr] .class`, the `attr` attribute and `.class` class will be add to host element. This commit adds similar logic to Ivy, to make sure this behavior is aligned with View Engine.

PR Close #34481
AndrewKushnir added a commit to AndrewKushnir/angular that referenced this pull request Feb 19, 2020
This commit updates AIO payload size limit that is triggering a problem after merging angular@f95b8ce. That commit added some payload size, but all checks were "green" for the PR (angular#34481) after rebase that happened a couple hours before the merge, so this is an accumulated payload size increase from multiple changes. The goal of this commit is to bring the master and patch branches back to "green" state.
alxhub pushed a commit that referenced this pull request Feb 19, 2020
This commit updates AIO payload size limit that is triggering a problem after merging f95b8ce. That commit added some payload size, but all checks were "green" for the PR (#34481) after rebase that happened a couple hours before the merge, so this is an accumulated payload size increase from multiple changes. The goal of this commit is to bring the master and patch branches back to "green" state.

PR Close #35538
alxhub pushed a commit that referenced this pull request Feb 19, 2020
This commit updates AIO payload size limit that is triggering a problem after merging f95b8ce. That commit added some payload size, but all checks were "green" for the PR (#34481) after rebase that happened a couple hours before the merge, so this is an accumulated payload size increase from multiple changes. The goal of this commit is to bring the master and patch branches back to "green" state.

PR Close #35538
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 Mar 21, 2020
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: patch This PR is targeted for the next patch release type: bug/fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ivy: Component's class and attribute selectors are missing in created html element when router outlet is used

4 participants