-
Notifications
You must be signed in to change notification settings - Fork 357
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
Deprecate @import and global builtins #2282
Conversation
Looks like we might need to disable the future deprecation tests temporarily until we have a future deprecation we can actually test. I think the embedded protocol tests also need to be updated to avoid |
Yeah, there are a lot of tests in js-api-spec that need to be updated. Working on them now |
The current situation is:
Given the frustrating community adoption of
|
I'll discuss these points with the team. It's definitely a lot to ask of users to migrate without consistent access to deprecation-silencing capabilities. To some degree I think it's just clear that frameworks will not proactively migrate without a sufficient volume of user complaints pushing them to, but I think at least for the modern API migration the recent declaration-order deprecation may have lit enough of a fire to get the ball rolling. I specifically don't want to tie the I agree that it may be time to end-of-life Node Sass, at least. LibSass has received commits and even a release in the past year, so I'm more hesitant to declare that end-of-life, but Node Sass hasn't been touched at all since May 2023. I've filed sass/node-sass#3424 and emailed the maintainers. If I don't hear back in a couple weeks and after a few pings, I'll look into doing it without their involvement. One major open question I'm interested in: are there widely-used frameworks other than Vite that still don't support the modern JS API? Or is it the only one? |
I just did a small research. Webpack seems to be the only one supporting new API, yet it still default to legacy API. I wasn't able to find anything that supports new API, all of the below are Legacy API only:
The problem here is that we now called it the legacy API, but never really had a deprecation process for it, nor throwing any warning to end users. So there is almost zero motivation for developers to support the new API, because legacy API gives them interchangeable compatibility between node-sass (libsass) and dart-sass, where switching to new API is additional work and a breaking change for them. |
It seems if we don't want to delay this too much, a reasonable solution is to port deprecation options to the legacy API? |
I had hoped that we wouldn't need to actually print warnings for the legacy API, since we're able to mark it as deprecated in the TSDoc, but apparently that's not sufficient. It's probably worth producing an official deprecation message. I agree that adding deprecation-control options to the legacy API is the most expedient path forward in the short term. I'm going to reach out to some major frameworks as well to sound them out on the timeline for deprecating |
|
This actually does not work, because in webpack the config looks like this: https://webpack.js.org/loaders/sass-loader/#api options: {
api: "modern",
sassOptions: {
// Your sass options
},
}, That the choice of api is passed outside of |
On a related note, shall we also mark As for migration paths: we have In my opinion, it might be the right time to mark @nex3 What do you think? |
I agree. I think @bolandrm is the maintainer of record. Ryan, what are your thoughts here? |
CHANGELOG.md
Outdated
@@ -1,11 +1,330 @@ | |||
## 1.78.0 | |||
## 1.80.0 | |||
|
|||
* `@import` is now officially deprecated, as are global built-in functions that | |||
are available within built-in modules. See [the Sass blog post] for more | |||
details on the deprecation process. | |||
|
|||
[the Sass blog]: https://sass-lang.com/blog/import-is-deprecated/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link reference does not match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Good catch!
lib/src/callable/async_built_in.dart
Outdated
'Global built-in functions are deprecated and ' | ||
'will be removed in Dart Sass 3.0.0.\n' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit: only split strings at newlines or just before you'd hit the 80 char limit.
@bolandrm We're planning to deprecate |
@ntkme If you don't hear back soon, @ me on that PR and I'll merge it. |
See sass/sass#3898.
See sass/sass-spec#2004.
[skip sass-embedded]