Skip to content

feat(ivy): convert [ngStyle] and [ngClass] to use ivy styling bindings - #28711

Closed
matsko wants to merge 3 commits into
angular:masterfrom
matsko:ng_style_ng_class
Closed

matsko wants to merge 3 commits into
angular:masterfrom
matsko:ng_style_ng_class

Conversation

@matsko

@matsko matsko commented Feb 13, 2019 •

Copy link
Copy Markdown
Contributor

Prior to this fix, both the NgStyle and NgClass directives made use
of Renderer2 and this dependency raised issues for future versions of
Angular that cannot inject it. This patch ensures that there are two
versions of both directives: one for the VE and another for Ivy.

@matsko
matsko requested review from a team February 13, 2019 22:25
@matsko matsko changed the title feat(ivy): convert [ngStyle] and [ngClass] to use ivy styling bindings wip: feat(ivy): convert [ngStyle] and [ngClass] to use ivy styling bindings Feb 13, 2019
@matsko
matsko force-pushed the ng_style_ng_class branch 2 times, most recently from 190d476 to 4ec5446 Compare February 13, 2019 23:41
@matsko
matsko requested a review from a team February 13, 2019 23:41
@matsko
matsko requested a review from a team February 13, 2019 23:53
@matsko
matsko force-pushed the ng_style_ng_class branch 8 times, most recently from 0e0d7a5 to e5cccfe Compare February 15, 2019 21:44
@matsko matsko added the target: major This PR is targeted for the next major release label Feb 15, 2019
@matsko

matsko commented Feb 15, 2019

Copy link
Copy Markdown
Contributor Author

@matsko matsko changed the title wip: feat(ivy): convert [ngStyle] and [ngClass] to use ivy styling bindings feat(ivy): convert [ngStyle] and [ngClass] to use ivy styling bindings Feb 15, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This has now been fixed in master (via #28773).

@matsko
matsko force-pushed the ng_style_ng_class branch 3 times, most recently from 4c45e90 to f7f77df Compare February 19, 2019 19:37
Comment thread packages/common/src/common.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are these exports needed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* If the VE is not present then NgStyle will normailze (through the injected service) and
* If the VE is not present then NgStyle will normalize (through the injected service) and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any particular reason why this code was pulled into a separate file?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* of how [style] and [class] behave in Angluar.
* of how [style] and [class] behave in Angular.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* the inner guts of the binding value have changed.
* the inner representation of the binding value have changed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

give an example. Right now the reader has no way of guessing wha the given the right combination of events are

Comment thread packages/core/src/render3/index.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

revert

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Something is wrong here. The public API reffers to NgClassBase but it is not shown here. Same issue for NgStyleBase

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* If the VE is not present then NgClass will normailze (through the injected service) and
* If the VE is not present then NgClass will normalize (through the injected service) and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* then write all styling changes to the `[class]` binding directly (through a host binding).
* then write all styling changes to the `[style]` binding directly (through a host binding).

@benlesh benlesh added the area: common Issues related to APIs in the @angular/common package label Feb 20, 2019
@ngbot ngbot Bot added this to the needsTriage milestone Feb 20, 2019
Prior to this fix, using the compiler's ivy_switch mechanism was
only available to core packages. This patch allows for this variable
switching mechanism to work across all other angular packages.
Prior to this fix, both the `NgStyle` and `NgClass` directives made use
of `Renderer2` and this dependency raised issues for future versions of
Angular that cannot inject it. This patch ensures that there are two
versions of both directives: one for the VE and another for Ivy.

Jira Issue: FW-882
@matsko matsko added the action: merge The PR is ready for merge by the caretaker label Feb 20, 2019
@benlesh benlesh closed this in 2cd9c6e Feb 20, 2019
benlesh pushed a commit that referenced this pull request Feb 20, 2019
#28711)

Prior to this fix, both the `NgStyle` and `NgClass` directives made use
of `Renderer2` and this dependency raised issues for future versions of
Angular that cannot inject it. This patch ensures that there are two
versions of both directives: one for the VE and another for Ivy.

Jira Issue: FW-882

PR Close #28711
IgorMinar pushed a commit to IgorMinar/angular that referenced this pull request Feb 20, 2019
Prior to this fix, using the compiler's ivy_switch mechanism was
only available to core packages. This patch allows for this variable
switching mechanism to work across all other angular packages.

PR Close angular#28711
IgorMinar pushed a commit to IgorMinar/angular that referenced this pull request Feb 20, 2019
angular#28711)

Prior to this fix, both the `NgStyle` and `NgClass` directives made use
of `Renderer2` and this dependency raised issues for future versions of
Angular that cannot inject it. This patch ensures that there are two
versions of both directives: one for the VE and another for Ivy.

Jira Issue: FW-882

PR Close angular#28711
@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 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 area: common Issues related to APIs in the @angular/common package cla: yes target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants