-
Notifications
You must be signed in to change notification settings - Fork 461
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
Rename some selector AST nodes #2101
Conversation
This better matches the Ruby Sass implementation.
This better matches the Ruby Sass implementation.
This better matches the Ruby Sass implementation.
This better matches the Ruby Sass implementation.
This better matches the Ruby Sass implementation.
This better matches the Ruby Sass implementation.
95a6bc9
to
d675a84
Compare
IMO this should be reverted. a) previously we used the names as given by the css spec @xzyfer do you agree on this? Please don't do this already. I'm currently trying to implement a reference counted memory implementation and will do the renaming in that commit. If we do it now on master it will give me a major re-basing headache! Thx! |
In this case being accurate to spec was a hindrance not a help. This change was a made to move use closer to the reference implementation.
This is easy to fix.
This is a good argument for eventually doing this. Now is now not the time.
May be not, but being close the reference implementation has many benefits.
I agree we should eventually move to match Dart Sass. IMO it's too early. With 3.5 feature ready to land we should stay close to Ruby Sass until we're committed to making Dart Sass our reference. I don't see this being reasonable until after we ship 3.5.
Please don't do this on your branch. Lets keep feature PR focused on one problem at a time. |
a lot of the Sass code was written when @nex3 and I were quite naive regarding the official CSS spec. As time has passed we've preferred to match the CSS naming as closely as possible and as @mgreter mentioned it's the preferred naming in the dart impl. I think the css names are more correct than what we use in ruby. honestly wouldn't get too hung up on matching the ruby impl names. |
In defense of our past selves, the spec has also changed its terminology to be clearer and more consistent over time. |
@xzyfer I think we do not have the same understanging of what a "hindrance" is. For me changing/renaming the 4 main selector classes is really like learning a new language patois. I've become used to the original names and had to lookup which new name represents what class pretty much every time. That's why one of the first things I did to pull off #2222 was to rename these to their names as they have always been in libsass. I pretty much beg you to return to the original way as it always has been in libsass. I really don't see any benefit to keep it "closer to the reference implementation."! Thanks! |
The reason for this change was to match the reference implementation. Our selector handling and extends code is in bad shape. I spent a couple weeks trying to resolve some issues with at-root which was slowed significantly but the disparity in selector node names. I'm in favour of adopting the naming scheme from dart-sass, but against bespoke naming. We're going to be moving closer the reference implementation, especially in light of dart-sass dropping some inconsistent behaviour that we're hacked into libsass. |
This PR renames most selector AST nodes to better match
their Ruby Sass equivalents. Although we mostly have 1-to-1
mapping between the AST nodes their implementations still
differ significantly. Aligning our selector implementation with
Ruby Sass will the focus upcoming work.
I wasn't able to split the
Element_Selector
into the respectiveElement
andUniversal
selector in Ruby Sass because theLibSass implementation differed too much.