-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add deprecation warnings for user-defined members #3634
Comments
One way around this would be to allow users to opt-in to the removal by placing these variables behind a This doesn't help us provide early warnings though like |
This is an interesting question. Your use-case is compelling; it's definitely a good idea for library authors to have a way to deprecate variables. I can see two broad avenues for supporting this:
I'm not sure there's a lot of value in option 2 outside of this, so I'm leaning towards option 1, but I don't have a great syntax in mind for it that supports a customizable message. |
Yeah, I agree a deprecation warning without a custom message instructing users how to fix the warning would be less than ideal. Option 1 would meet our use-case well enough though with the ability to provide that custom message. In our case, we're already using sassdoc |
Canonizing SassDoc comments is a very interesting concept here. We wouldn't want to do that for anything semantic, but if it's just for a deprecation warning I think we could probably get away with it. Another option could be to have a separate rule like We'd probably also need to find a way to suppress warning within the same package. If the |
Canonizing SassDoc could have another side benefit on our end of not having to update any of our code. We, and consumers of our libraries, would update to the latest sass version and automatically get deprecation warnings across all previous versions of our library (that used the SassDoc |
Yeah, I think that's probably the best way forward. |
@warn
for variables
Could
@warn
be updated to emit a warning message when variables are used?For the Carbon Design System we use Sass for all the styling we provide to users. We're in a situation where we have a lot of variables that are going to be removed in our next major. We'd like to provide deprecation warnings to developers when these variables are used, but unfortunately the
@warn
rule is scoped to only functions and mixins.Apologies if there's already another issue that encapsulates this idea more fully, I couldn't find one though.
The text was updated successfully, but these errors were encountered: