-
Notifications
You must be signed in to change notification settings - Fork 657
Mark useResponsiveValue as deprecated #7760
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@primer/react': minor | ||
| --- | ||
|
|
||
| Deprecate the `useResponsiveValue` hook. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --- | ||
| name: deprecations | ||
| description: 'Use when: deprecating Primer React components or hooks. Covers source annotations, docs metadata, changesets, docs page updates, and validation for deprecations.' | ||
| --- | ||
|
|
||
| # Deprecating components and hooks in Primer React | ||
|
|
||
| Use this skill when a task involves marking a public Primer React API as deprecated. | ||
|
|
||
| ## What to update | ||
|
|
||
| ### Source code | ||
|
|
||
| - Add a JSDoc `@deprecated` annotation to the exported component, hook, prop, or type following existing patterns nearby. | ||
| - Keep runtime behavior unchanged unless the task explicitly requires more than deprecation signaling. | ||
|
|
||
| ### Docs metadata | ||
|
|
||
| - For components, mark the relevant `*.docs.json` file with `"status": "deprecated"`. | ||
| - For hooks, mark the relevant `*.hookDocs.json` file with `"status": "deprecated"`. | ||
| - If schema or build tooling does not yet support the docs metadata you need, update the corresponding schema/build files in `packages/react/script/*-json/`. | ||
|
|
||
| ### Documentation content | ||
|
|
||
| - If the deprecated component has a docs page or JSON-backed docs content that supports deprecation guidance, add or update the deprecation guidance and recommended alternative. | ||
| - Follow `contributor-docs/deprecating-components.md`. | ||
|
|
||
| ### Versioning | ||
|
|
||
| - Add a changeset for public API deprecations. | ||
| - Use the versioning guidance in `contributor-docs/versioning.md` to choose the correct bump. | ||
|
|
||
| ## Validation | ||
|
|
||
| Prefer targeted validation first, then broader validation if needed: | ||
|
|
||
| - Format changed files with `npx prettier --write <paths>` | ||
| - Lint changed TypeScript files with `npx eslint --fix <paths>` | ||
| - Rebuild generated docs metadata when related schema or docs JSON changes: | ||
|
|
||
| ```bash | ||
| npm run build:hooks.json -w @primer/react | ||
| ``` | ||
|
|
||
| ```bash | ||
| npm run build:components.json -w @primer/react | ||
| ``` | ||
|
|
||
| - Run targeted tests for the affected API when available | ||
| - Run broader repository validation before finalizing if the change touches shared build tooling | ||
|
|
||
| ## Common files | ||
|
|
||
| - `packages/react/src/**/*.docs.json` | ||
| - `packages/react/src/**/*.hookDocs.json` | ||
| - `packages/react/script/components-json/*` | ||
| - `packages/react/script/hooks-json/*` | ||
| - `contributor-docs/deprecating-components.md` | ||
| - `.changeset/*.md` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,11 @@ | |
| "type": "string", | ||
| "description": "The name of the hook." | ||
| }, | ||
| "status": { | ||
| "type": "string", | ||
| "enum": ["ready", "deprecated"], | ||
| "description": "The status of the hook." | ||
| }, | ||
|
Comment on lines
+81
to
+85
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only valid value is deprecated? 🤔
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes... because there was no status field so far. Made it |
||
| "importPath": { | ||
| "type": "string", | ||
| "description": "The path to import the hook from. i.e. '@primer/react/experimental'" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this link does not exist?
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.
My bad, that link was already there. Replaced with a link for a recent deprecated component