Re: [csswg-drafts] [css-nesting] Problem with mixing properties and selectors (#8249)

I don't want to take this thread even further of topic because the focus here isn't how authors will deal with the transition period, but there are too many inaccuracies here :)

-----

https://github.com/w3c/csswg-drafts/issues/8249#issuecomment-1501062075

> But this is nothing new. Javascript has had breaking syntactic changes all over the years. And, yes, for a while, you have to rely on UA sniffing to decide wether to ship the (shorter) modern code or its desugared version. Authors have been sucessfully doing this for years now.

This isn't exactly true.
Very few people roll their own UA sniffing.
Most ship a single bundle targeted at the oldest browsers they need to support.

Others rely on services like polyfill.io which abstract away the UA sniffing.
UA sniffing is a very complex problem to solve because browsers lie, have bugs and because of recent privacy preserving changes.

------

https://github.com/w3c/csswg-drafts/issues/8249#issuecomment-1501062075

At the current rate at which browsers ship, in less than 5 years, 99.9% of browsers will support nesting natively and you will no longer need the transpiler at all. Just like everyone feels free to use ES5 today.

This is not true.
Not even `flex` has `99.9%` adoption and that shipped 10 years ago.

------

https://github.com/w3c/csswg-drafts/issues/8249#issuecomment-1500997885

> just use a transpiler and ship un-nested stylesheets like they aready do today, and we don't need to bother with the feature.

Authors don't want to use tools for anything. If nesting never ships it will also never reach the point when tools become unneeded.

------

https://github.com/w3c/csswg-drafts/issues/8249#issuecomment-1501737869

> I suspect that rather than UI sniffing, authors will just wait a bit until Nesting is supported in a reasonable percentage of browsers, then detect it client side and load an additional stylesheet only for those browsers that don't support Nesting. I believe the styling you get from a stylesheet that uses Nesting in an older browser is a proper subset of all the rules, so that would be a largely smooth progression, it would just involve 2x the download for older browsers, which is a commonly acceptable tradeoff once the set of nonsupporting browsers for a feature becomes small enough. 

Authors typically do not like a change that will both slow down their project for end users and add to the complexity of their stack. Even when it only causes perf issues for users on older browsers.

------

How authors will deal with the transition period is not the issue imho.
This is a solved problem.

Nesting is just syntactic sugar, so authors don't lose out on much by transpiling.

They will simply continue to transpile with existing tools and it will be rare for anyone to actually ship nested css. They will continue to do this for a long time because the benefits of transpiling will continue to outweigh the drawbacks.

This is not a bad thing.
There simply already is a trivial way for authors to write standard/native css and support the older browser version that their project requires.

-- 
GitHub Notification of comment by romainmenke
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8249#issuecomment-1501773116 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 10 April 2023 12:44:20 UTC