Skip to content
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

Proposal: add $deprecated property #255

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Proposal: add $deprecated property #255

merged 3 commits into from
Nov 27, 2024

Conversation

drwpow
Copy link
Contributor

@drwpow drwpow commented Oct 24, 2024

Summary

This adds a new $deprecated property for both tokens and groups as suggested by @romainmenke.

Reasoning

This PR basically accepts #118 as-proposed (the original proposal), while taking into account feedback from followup comments.

Pros

  • This mirrors prior art like JSDoc deprecation that is well-known and well-used
  • Style dictionary also has this concept and it makes sense to codify in the spec
  • This seemed to have fairly-universal support (only disagreements were minor syntax differences, but that also spawned a separate proposal that can be evaluated independently)

Cons

  • Expanding $deprecated in the future would be a breaking change
  • What constitutes “deprecation” is a little ambiguous in the spec as-written. But the hope is that it’s no more ambiguous than using this exact term elsewhere.
  • What “deprecation” means is up to tools to decide (e.g. whether or not to generate output from those tokens, and/or throw warnings/errors)

Alternatives

  • Adding a pair property (e.g. $deprecated / $deprecatedMessage) isn’t a design pattern that currently exists in the spec. Pair properties can also be antipatterns as they introduce validation complexity (e.g. what if $deprecatedMessage is set but $deprecated isn’t—is that valid or invalid? and if valid, what behavior is inferred?)
  • The object syntax (e.g. $deprecated.deprecated / $deprecated.message) wasn’t proposed here because it adds unnecessary boilerplate.
  • A more complex status object would be a separate proposal because that encroaches on opinionated versioning (and versioning won’t map 1:1 to existing tokens)
    • This proposal assumes that any implementation of status/versioning won’t conflict with $deprecated. Or in areas where they potentially overlap, will be complementary rather than conflicting.
    • In other words, acceptance of this does NOT mean refusal of the Status Object proposal

Notes

  • This assumes aliases may be deprecated too (even if the tokens they point to don’t). Should this be outlined explicitly?
  • It is the author’s opinion that deprecation is not directly related to versioning. Versioning is a more complex opinion on what constitutes “breaking changes” from non-, e.g. semver. Though versioning may include deprecation and/or removal of tokens, it’s so much more. Conversely, the act of deprecation is common enough it affects every design system, even those that may not have defined versioning strategies. So whether or not this spec defines an opinionated versioning strategy, shouldn’t affect this proposal.

@drwpow drwpow requested a review from c1rrus October 24, 2024 20:07
Copy link

netlify bot commented Oct 24, 2024

Deploy Preview for dtcg-tr ready!

Name Link
🔨 Latest commit b60ae03
🔍 Latest deploy log https://app.netlify.com/sites/dtcg-tr/deploys/6746bc471b5cbe0008518c61
😎 Deploy Preview https://deploy-preview-255--dtcg-tr.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

## More token properties TBC
### Deprecated

The optional **`$deprecated`** property is a boolean or string where tooks MAY specify deprecated tokens. A token MAY be marked deprecated in any of the following scenarios:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @c1rrus any nitpicking of language here would be greatly appreciated 🙏. Happy to rephrase this to match the existing language (or if you wanted to do a pass on it that would be fine, too!)

@drwpow drwpow mentioned this pull request Oct 24, 2024
Copy link
Contributor

@romainmenke romainmenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. LGTM 👍

Copy link
Member

@c1rrus c1rrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotted a couple of teeny typos. But otherwise this looks good. Happy to approve once they get fixed.

technical-reports/format/design-token.md Outdated Show resolved Hide resolved
technical-reports/format/groups.md Outdated Show resolved Hide resolved
@drwpow drwpow force-pushed the drwpow/deprecated-property branch from 9f24807 to ef61320 Compare October 24, 2024 23:00
Copy link
Member

@c1rrus c1rrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one. Thanks for doing this @drwpow!

@drwpow
Copy link
Contributor Author

drwpow commented Oct 25, 2024

Thanks! Will give other editors a chance to review and leave feedback over the next week or 2. If there’s no objection, we’ll merge!

But also, based on the other recent proposals, generally the editors express the same opinions found in the comments, so the fact it’s being proposed in the first place is usually positive 🙂

@nesquarx
Copy link

nesquarx commented Nov 1, 2024 via email

@lukasoppermann
Copy link
Contributor

@drwpow good to merge?

@drwpow
Copy link
Contributor Author

drwpow commented Nov 21, 2024

@drwpow good to merge?

Almost! We had been waiting to see if one group had feedback. Will ping them again and if not, will merge!

@drwpow drwpow force-pushed the drwpow/deprecated-property branch from 3fd459b to c132b49 Compare November 27, 2024 06:14
@drwpow
Copy link
Contributor Author

drwpow commented Nov 27, 2024

To confirm, there is neither a necessity nor a spec-defined way to confirm or extract an alternate token suggestion inside the deprecated tag, toolmakers can make their own assumptions on if and how to programmatically determine it?

Correct. Updated the wording per @kaelig’s suggestion to describe this a bit more. By default we don’t have aliases in the examples anymore outside the section that describes “it’s up to tools to determine how they do/don’t handle parsing the $deprecated string.

@drwpow
Copy link
Contributor Author

drwpow commented Nov 27, 2024

We’ve waited for additional parties to give input / feedback but haven’t gotten any pushback or corrections. Merging!

@drwpow drwpow merged commit af7e799 into main Nov 27, 2024
6 checks passed
@drwpow drwpow deleted the drwpow/deprecated-property branch November 27, 2024 06:31
github-actions bot added a commit that referenced this pull request Nov 27, 2024
SHA: af7e799
Reason: push, by drwpow

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants