Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

New deprecations in Sass 1.79 #40849

Open
3 tasks done
mbabker opened this issue Sep 18, 2024 · 5 comments
Open
3 tasks done

New deprecations in Sass 1.79 #40849

mbabker opened this issue Sep 18, 2024 · 5 comments
Labels

Comments

@mbabker
Copy link

mbabker commented Sep 18, 2024

Prerequisites

Describe the issue

In Sass 1.79, a number of color-related functions are deprecated, to include color.red(), color.green(), and color.blue(), with the suggested replacement being the new color.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

@julien-deramond
Copy link
Member

julien-deramond commented Sep 18, 2024

Hey @mbabker
Yeah, saw that today in our Bootstrap fork at work. Let's keep this issue open for when we'll bump the sass dependency in our repo. In the meantime, I'll try to analyze how to fix the issue. Hopefully, it will be possible. Don't hesitate if there's still no PR yet and you have ideas (/cc @twbs/css-review)

In the meantime, folks having these warnings have different options:

Edit with really quick analysis: Using sass:color won't probably be possible as Bootstrap 5 still needs to support node-sass. Based on that, several scenarios are possible that need to be discussed. Let's try first to check if it would be possible to fix that without using sass:*. If not, we'll need to decide what and how to do next.

@klunker
Copy link

klunker commented Sep 20, 2024

Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
More info: https://sass-lang.com/d/legacy-js-api

Deprecation Warning: red() is deprecated. Suggestion:
color.channel($color, red, $space: rgb)
More info: https://sass-lang.com/d/color-functions

When we can wait for update?

thet added a commit to thet/bootstrap that referenced this issue Sep 21, 2024
Fixing deprecation warnings for usage of red, green and blue functions and using color.channel instead.

Fixes: twbs#40849
@thet
Copy link

thet commented Sep 21, 2024

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:
https://sass-lang.com/documentation/breaking-changes/legacy-js-api/#silencing-warnings

@ghiscoding
Copy link

ghiscoding commented Sep 23, 2024

Edit with really quick analysis: Using sass:color won't probably be possible as Bootstrap 5 still needs to support node-sass.

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?

@julien-deramond
Copy link
Member

julien-deramond commented Sep 23, 2024

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 node-sass support in v6 because it's a breaking change for some users. And yes, v6 is clearly not coming anytime soon, as development hasn't really started yet.

I haven't fully thought through all the options, but here are the ones I'm considering:

  1. Fix the issue with a workaround, since we can't currently use sass:color. This could involve re-implementing an equivalent for the deprecated functions. Of course, there's always a risk that future changes in Sass will render node-sass unusable on our side. And clearly, they have perfectly the right to do so, as node-sass is EOL, and announced a long time ago.
  2. Delay the fix until the problem is resolved in Bootstrap (whatever the version). Meanwhile, users would need to either pin their Sass dependency or ignore warning messages. This approach also gives us several options for when to drop node-sass:
    2.1. Drop node-sass support in a v5.3.x release. This would be unfair to some users still relying on it, and frankly, I’m not a big fan of this option.
    2.2. Drop node-sass support in v5.4. While it would be a breaking change, clear communication could help. However, this also means that any fixes for the v5.3.x series would need to be addressed before removing node-sass.
    2.3. Stick with the original plan to drop node-sass in v6. This has always been the long-term goal, but with v6 far off, it's worth considering if we need a more immediate solution.

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)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
Status: To analyze
Development

Successfully merging a pull request may close this issue.

5 participants