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

refactor(ivy): abstract all styling-related compiler logic into a shared class #27043

Closed
wants to merge 1 commit into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented Nov 10, 2018

No description provided.

@mary-poppins
Copy link

You can preview 98d3dba at https://pr27043-98d3dba.ngbuilds.io/.

case 'list-style-image':
return true;
}
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

This minifies better and I think it's more performant too:

return prop === 'background-image'
  || prop === 'background'
  || prop === 'border-image'
  || prop === 'filter'
  || prop === 'filter'
  || prop === 'list-style'
  || prop === 'list-style-image';

P.S.: If you don't use triple equals it minifies even better. You can safely ignore any linting rule just for this block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excellent. Thank you.

}).toLowerCase();
function isStyleSanitizable(prop: string): boolean {
return prop === 'background-image' || prop === 'background' || prop === 'border-image' ||
prop === 'filter' || prop === 'filter' || prop === 'list-style' ||
Copy link
Contributor

Choose a reason for hiding this comment

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

filter check is repeated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahhhhh :(

@mary-poppins
Copy link

You can preview 0ff832d at https://pr27043-0ff832d.ngbuilds.io/.

@matsko matsko added the target: major This PR is targeted for the next major release label Nov 11, 2018
@mhevery mhevery added the action: merge The PR is ready for merge by the caretaker label Nov 12, 2018
FrederikSchlemmer pushed a commit to FrederikSchlemmer/angular that referenced this pull request Jan 3, 2019
@matsko matsko deleted the host_styling branch January 17, 2019 19:41
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants