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): flatten css selectors #23074
Conversation
*/ | ||
export type SimpleCssSelector = string[]; | ||
export type CssSelector = (string | number)[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be number
=> SelectorFlags
?
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This PR flattens the CSS selectors generated for directives and components. This should help directives to generate less code, and will make selectors generally friendlier to work with.
Simple selector:
selector: 'div'
Parsed (before):
Parsed (after):
Complex selector:
selector: 'div.foo[title=title]:not([bar]):not(.baz), [test]'
Parsed (before):
Parsed (after, with flags written out for clarity):
Because
SelectorFlags
is aconst enum
, the real output will be a number (see below):Parsed (after, actual):
Notes:
selector
toselectors
inDirectiveDef
because I think it clarifies that it is a list of selectors for the directive, as opposed to one selector.First commit: updates runtime
Second commit: updates compiler