-
Notifications
You must be signed in to change notification settings - Fork 96
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
sass: / is deprecated for division #4096
Comments
We're still using |
Unfortunately adding
For this reason we've opted not to replace We want to support |
We're looking to switch to Dart Sass in the Cockpit project as well and are hit by this too. After looking at this a bit, I have some ideas. PatternFly sideOne idea I had: Changing all division to multiplication instead:
And so on. But it's a bunch of busywork (but some of these easier cases should be scriptable)... and what happens to something like In most cases, the division could be replace with a in-browser So switching to multiplication for the easy cases and wrapping the rest in Project sideFor the time being, from Cockpit's perspective, we're wondering if we should:
This way, we could use Dart Sass and PatternFly while we wait for a future-Dart-Sass-friendlier PatternFly. Once PF is ready for Dart 2.x, we could then also remove our lock and switch to Dart 2.x. We're looking into this. Other teams might want to as well... and we're happy to share the outcome, especially if this works. Ideally, the Sass team would add sass::math with math.div() to LibSass for ease porting pain, so we wouldn't be in this mess. But they haven't, and there aren't any indications (and I'm aware of) that they will. |
Sass team lead here! I wanted to pop in and say, first of all, that we're very sorry for the friction here. We really wanted this transition to be smoother: we actually accepted the proposal for the /-as-division deprecation two years ago, and filed a P1 issue with LibSass to support it around the same time. We held off landing it in Dart Sass for so long because of how much easier warning-free support for both Dart Sass and LibSass would have been if it were possible to support both platforms. Unfortunately, the LibSass team (which works basically independently of the rest of the Sass team) has been steadily losing bandwidth over the past five years, and they just don't have the ability to add new features anymore. This is why we eventually declared LibSass deprecated and, six months afterwards, started the process of releasing the /-as-division deprecation in LibSass. I think you're on the right track by encouraging your users to migrate to Dart Sass ASAP. It's likely that staying on LibSass will continue to produce more and more pain, between incompatibilities with changes to the Sass language on one hand and lack of support for new CSS features on the other. But I also understand not wanting to break your existing users if you can help it. To that end, here's a workaround you can use to continue supporting both Dart Sass and LibSass for the time being while also silencing these warnings: // _div.import.scss
@forward "sass:math" show div; // _div.scss
@function div($number1, $number2) {
@return $number1/$number2;
} If you include both these files in your library, you can write // _div.import.scss
@use "sass:map";
@use "sass:math";
@use "sass:meta";
$-use-math-div: map.has-key(meta.module-functions("math"), "div");
@function div($number1, $number2) {
@return if($-use-math-div, math.div($number1, $number2), $number1/$number2);
} I wouldn't recommend either of these as long-term solutions, but they can at least get you unpinned from earlier Dart Sass versions until we land support for the silencing dependency warnings in JS. |
This partially reverts commit 4063e3d, dropping our custom loader to call the sassc commandline tool, and bringing back sass-loader, and then makes further changes. We are now using Dart Sass (which we already had in our package.json for some reason). Pin the version to strictly less than 1.33 to avoid an annoying warning about division (which we don't have a lot of control over, since most cases of its are coming from PatternFly, who are currently deciding what to do about this issue, themselves). See patternfly/patternfly#4096 for some more discussion.
This partially reverts commit 4063e3d, dropping our custom loader to call the sassc commandline tool, and bringing back sass-loader, and then makes further changes. We are now using Dart Sass (which we already had in our package.json for some reason). Pin the version to strictly less than 1.33 to avoid an annoying warning about division (which we don't have a lot of control over, since most cases of its are coming from PatternFly, who are currently deciding what to do about this issue, themselves). See patternfly/patternfly#4096 for some more discussion.
This partially reverts commit 4063e3d, dropping our custom loader to call the sassc commandline tool, and bringing back sass-loader, and then makes further changes. We are now using Dart Sass (which we already had in our package.json for some reason). Pin the version to strictly less than 1.33 to avoid an annoying warning about division (which we don't have a lot of control over, since most cases of its are coming from PatternFly, who are currently deciding what to do about this issue, themselves). See patternfly/patternfly#4096 for some more discussion.
🎉 This issue has been resolved in version 4.115.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
https://github.com/sass/dart-sass/releases/tag/1.33.0
https://sass-lang.com/documentation/breaking-changes/slash-div
If
sass
version 1.33.0 or newer is installed, the console is absolutely flooded by "/ is deprecated for division" errors when patternfly builds.The text was updated successfully, but these errors were encountered: