-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
New deprecations in Sass 1.79 #40849
Comments
Hey @mbabker In the meantime, folks having these warnings have different options:
Edit with really quick analysis: Using |
Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. Deprecation Warning: red() is deprecated. Suggestion: When we can wait for update? |
Fixing deprecation warnings for usage of red, green and blue functions and using color.channel instead. Fixes: twbs#40849
I've stumbled over this issue too and started a PR - however the tests do not yet pass and any help is wanted. Meanwhile, I will just silence the deprecation warnings as described here: |
I was quite surprised to see that Bootstrap still support node-sass when it's been tagged as EOL and the repo is now archived, even if the EOL did happen this year, it was however announced a long time ago. Will that be removed only in Bootstrap 6? I don't see any mention of that in the BS6 project. I'm also assuming BS6 probably won't come for another couple years, so will node-sass really be supported that long even though it's EOL? |
That's the question indeed. The original plan was to drop I haven't fully thought through all the options, but here are the ones I'm considering:
For now, I’m inclined to try option 1. If that doesn’t work, we'll need to weigh our alternatives carefully. (/cc @twbs/css-review) |
Hey there, I tried my best finding a workaround with Sass but the only one I found was to introduce some new functions in Bootstrap overriding the ones from Sass itself. The solution is available in #40925. It's only a draft to see the impacts so I put not so much efforts in testing and documentation. That said, I still don't think it's a good solution to do it this way because:
Definitely not a big fan too. I can't decide if we should rather drop |
Thanks a lot, @louismaximepiton, for the research that confirms my initial thoughts: it doesn't seem possible to fix this in v5.3.x solely on our side. My two cents on this. I don't think it makes sense to release a v6 just to remove Node Sass. If that's part of v6, we'll be waiting a long time for the fix. Plus, there's no guarantee Sass won't release a v2 in the meantime, leaving us stuck on v1.78 for ages, just to support something that's been deprecated for quite a while. I understand that removing Node Sass would be a breaking change, even in a minor version, so we'd need to finalize all pending patches—especially those related to color modes—within v5.3.x. After that, we could roll out a v5.4, merging everything that's ready, including dropping Node Sass support. Then, I imagine the next focus would shift to v6. This way, Node Sass users wouldn’t lose significant features and still benefit from the v5 entirely, as they'd remain on v5.3.x instead of moving to v5.4, which likely wouldn't include any critical changes anyway, or big new features or improvements. Thoughts @twbs/css-review, @mdo, folks, Node Sass users? |
@louismaximepiton @julien-deramond Below was the Angular-Material polyfill for the old SASS @use 'sass:math';
@use 'sass:meta';
@use 'sass:list';
// Private polyfill for the `math.div` function from Sass to be used until we can update the
// minimum required Sass version to 1.34.0 or above.
// TODO(crisbeto): replace with `math.div` eventually.
@function private-div($a, $b) {
@if (meta.function-exists('div', 'math')) {
@return math.div($a, $b);
}
@else {
@return $a / $b;
}
}
// Private polyfill for the `list.slash` function from Sass to be used until we can update the
// minimum required Sass version to 1.34.0 or above.
// TODO(crisbeto): replace with `list.slash` eventually.
@function private-slash($a, $b) {
@if (meta.function-exists('slash', 'list')) {
@return list.slash($a, $b);
}
@else {
@return #{$a}#{' / '}#{$b};
}
} Side note, I also just checked if node-sass actually has the |
Hello, thanks for your contribution to the topic. We've been trying this feature and it sounds like an unsolvable issue. We are only human, so maybe we've been missing something in here. Here are all our findings: For Angular it worked because they were likely supporting 2 different versions of Dart Sass which is different and unfortunately not applicable to our issue. |
@louismaximepiton well ahh at least you tried :) |
for webpack-dev-server, you can ignore warnings with the following configuration: const devServerOptions = {
hot: true,
// host: '0.0.0.0',
host: 'localhost',
port: 3000,
compress: true,
historyApiFallback: true,
allowedHosts: 'all',
client: {
overlay: {
errors: true,
runtimeErrors: true,
warnings: false
},
progress: true,
},
headers: {
'Access-Control-Allow-Origin': '*',
},
static: {
directory: path.join(_myDirName, 'frontend', 'src', 'assets'),
},
} the important parts are in the |
In good news, dart-saas 1.80 also has options to silence these new deprecations, see https://sass-lang.com/blog/import-is-deprecated/#controlling-deprecation-warnings for more on that. |
For everyone using Gulp who wants to temporarily hide these warnings, the is silenceDeprecations option for this:
|
Prerequisites
Describe the issue
In Sass 1.79, a number of color-related functions are deprecated, to include
color.red()
,color.green()
, andcolor.blue()
, with the suggested replacement being the newcolor.channel()
function.Reduced test cases
Compile Bootstrap's SCSS with Sass 1.79
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
v5.3.3
The text was updated successfully, but these errors were encountered: