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

use command/commandfor over custom data-(show|close|submit)-dialog-id #3331

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

keithamus
Copy link
Member

@keithamus keithamus commented Feb 13, 2025

Authors: Please fill out this form carefully and completely.

Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.

What are you trying to accomplish?

I want to deprecate data-show-dialog-id and data-close-dialog-id. Doing this allows us to:

  • Reduce the amount of JS code required for primer functionality.
  • Reduce the bespoke API surface of PVC; relying instead on web-platform features.
  • Rely more on the web-platform for mitigiating bugs an accessibility issues.

Integration

No updates to production, but production will also want to migrate.

List the issues that this change affects.

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.
  • Medium risk changes that are isolated, reduced in scope or could impact few users. The change will not impact library availability.
  • High risk changes are those that could impact customers and SLOs, low or no test coverage, low observability, or slow to rollback.

What approach did you choose and why?

Anything you want to highlight for special attention from reviewers?

Accessibility

  • Fixes axe scan violation - This change fixes an existing axe scan violation.
  • No new axe scan violation - This change does not introduce any new axe scan violations.
  • New axe violation - This change introduces a new axe scan violation. Please describe why the violation cannot be resolved below.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Lookbook)
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

Copy link

changeset-bot bot commented Feb 13, 2025

🦋 Changeset detected

Latest commit: d2df131

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

This PR includes changesets to release 1 package
Name Type
@primer/view-components 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

@keithamus keithamus force-pushed the use-command-commandfor-over-custom-data-show-close-submit-dialog-id branch from 61c60c5 to 54b75e9 Compare February 13, 2025 18:46
@keithamus keithamus force-pushed the use-command-commandfor-over-custom-data-show-close-submit-dialog-id branch from 212cf7f to 384b991 Compare February 13, 2025 19:04
@keithamus keithamus force-pushed the use-command-commandfor-over-custom-data-show-close-submit-dialog-id branch from 384b991 to 653e82a Compare February 13, 2025 19:18
@keithamus keithamus force-pushed the use-command-commandfor-over-custom-data-show-close-submit-dialog-id branch from 653e82a to 2fda90d Compare February 13, 2025 21:08
@keithamus keithamus force-pushed the use-command-commandfor-over-custom-data-show-close-submit-dialog-id branch from 2fda90d to 434e56e Compare February 13, 2025 21:13
@keithamus keithamus force-pushed the use-command-commandfor-over-custom-data-show-close-submit-dialog-id branch from 434e56e to 4ea9902 Compare February 13, 2025 21:16
@keithamus keithamus force-pushed the use-command-commandfor-over-custom-data-show-close-submit-dialog-id branch from 4ea9902 to 53270ba Compare February 13, 2025 21:21
@keithamus keithamus marked this pull request as ready for review February 13, 2025 21:24
@keithamus keithamus requested a review from a team as a code owner February 13, 2025 21:25
Copy link
Contributor

@camertron camertron left a comment

Choose a reason for hiding this comment

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

This seems generally great to me, thanks! I do however find myself wondering what the dotcom impact will be. Do we know how many times dotcom code targets the data-{open,close}-dialog-id attributes? I would hope never, but experience has taught me otherwise 😓

@keithamus
Copy link
Member Author

https://github.com/search?q=repo%3Agithub%2Fgithub%20%2Fdata-(show%7Cclose%7Csubmit)-dialog-id%2F&type=code

about 100 or so, hence soft-deprecating with a warning. When this PR gets integrated the polyfill will be deployed and I can go ahead and clean up all the callsites in the monolith. Once that's done I'll come back here and sweep up the deprecated code.

@francinelucca francinelucca removed their request for review February 14, 2025 01:21
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.

2 participants