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

Updating deprecations.js file to be more straightforward #1581

Merged
merged 8 commits into from
Sep 10, 2021

Conversation

jonrohan
Copy link
Member

@jonrohan jonrohan commented Sep 10, 2021

This updates the deprecations.js file and process a bit simpler. I modeled this after the work @colebemis did in primer/primitives#202

The placement of the deprecated file hasn't changed but the structure has. The output dist/deprecations.json file is as follows: And documented here https://primer-css-82rx1coiw-primer.vercel.app/css/tools/deprecations

{
  "selectors": {...},
  "variables": {...},
  "mixins": {...}
}

Deprecated Selectors

These are deprecated selectors and should not be used. They include a replacement value, which can be an array or null.

  • 'deprecated-selector': 'replacement-selector' <-- Replace with this selector.
  • 'deprecated-selector': ['replacement-1', 'replacement-2'] <-- Replace with one of these selectors.
  • 'deprecated-selector': null <-- No option available, remove selector.

@changeset-bot
Copy link

changeset-bot bot commented Sep 10, 2021

🦋 Changeset detected

Latest commit: de3f8b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/css Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jonrohan jonrohan marked this pull request as ready for review September 10, 2021 01:54
@jonrohan jonrohan requested a review from a team as a code owner September 10, 2021 01:54
Copy link
Contributor

@simurai simurai left a comment

Choose a reason for hiding this comment

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

I think I like this. ❤️

I'm still wondering if there is benefit for keeping the version, but can't really think of any. I guess once something is deprecated it will stay that way "forever" unless we wanna re-use it at some point again.

@jonrohan
Copy link
Member Author

I'm still wondering if there is benefit for keeping the version, but can't really think of any. I guess once something is deprecated it will stay that way "forever" unless we wanna re-use it at some point again.

After looking at the code, I think the original intent was you could mark something to be deprecated such that you want it deprecated at a specific later version but not right now. I don't believe we ever really utilized this though.

@colebemis
Copy link
Contributor

colebemis commented Sep 10, 2021

Love this direction!

Is there a reason we couldn't make this a JSON file? With JSON, we could use JSON schema to validate the structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants