From 67b501c7c851ec580b6698ff44cb9d6fdf19b2d9 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Sat, 26 Oct 2024 14:38:05 -0400 Subject: [PATCH] Clean up some workarounds for old upstream bugs * We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. --- .github/files/renovate-post-upgrade.sh | 4 +--- .../update-cleanup-some-old-workarounds | 5 +++++ .../action-button/stories/index.stories.jsx | 5 ++--- .../pricing-card/stories/index.stories.tsx | 1 - .../update-cleanup-some-old-workarounds | 4 ++++ .../confirmation-form/index.tsx | 9 ++++++-- .../update-cleanup-some-old-workarounds | 4 ++++ .../social-logos/src/react/example.tsx | 22 ++++++++++++++----- .../update-cleanup-some-old-workarounds | 5 +++++ .../update-cleanup-some-old-workarounds#2 | 4 ++++ .../js-packages/storybook/storybook/main.js | 5 ++--- .../update-cleanup-some-old-workarounds | 5 +++++ .../forms/src/contact-form/class-admin.php | 3 +-- .../update-cleanup-some-old-workarounds | 4 ++++ .../update-cleanup-some-old-workarounds#2 | 4 ++++ .../src/components/EmailForm/index.tsx | 12 +++++----- .../src/recommended-tags-modal/form-label.tsx | 4 ++-- tools/js-tools/jest/jest-resolver.js | 2 -- 18 files changed, 72 insertions(+), 30 deletions(-) create mode 100644 projects/js-packages/components/changelog/update-cleanup-some-old-workarounds create mode 100644 projects/js-packages/publicize-components/changelog/update-cleanup-some-old-workarounds create mode 100644 projects/js-packages/social-logos/changelog/update-cleanup-some-old-workarounds create mode 100644 projects/js-packages/storybook/changelog/update-cleanup-some-old-workarounds create mode 100644 projects/js-packages/storybook/changelog/update-cleanup-some-old-workarounds#2 create mode 100644 projects/packages/forms/changelog/update-cleanup-some-old-workarounds create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/update-cleanup-some-old-workarounds create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/update-cleanup-some-old-workarounds#2 diff --git a/.github/files/renovate-post-upgrade.sh b/.github/files/renovate-post-upgrade.sh index 6f6aaef839d24..9c72060afd04d 100755 --- a/.github/files/renovate-post-upgrade.sh +++ b/.github/files/renovate-post-upgrade.sh @@ -19,9 +19,7 @@ function die { # Renovate has a bug where they modify `.npmrc` and don't clean up after themselves, # resulting in those modifications being included in the diff. -# https://github.com/renovatebot/renovate/issues/23528 -# Further, it seems they're reluctant to even admit this is actually a bug, and would -# rather cast aspersions than collaborate on a fix. +# https://github.com/renovatebot/renovate/discussions/23489 # So work around it by manually reverting the file. git restore .npmrc diff --git a/projects/js-packages/components/changelog/update-cleanup-some-old-workarounds b/projects/js-packages/components/changelog/update-cleanup-some-old-workarounds new file mode 100644 index 0000000000000..929341656a01b --- /dev/null +++ b/projects/js-packages/components/changelog/update-cleanup-some-old-workarounds @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: https://github.com/storybookjs/storybook/issues/7215 was fixed a while back, remove TODOs. And fix a wrong prop in one story. + + diff --git a/projects/js-packages/components/components/action-button/stories/index.stories.jsx b/projects/js-packages/components/components/action-button/stories/index.stories.jsx index 191798f5ea6b4..6446569935ac8 100644 --- a/projects/js-packages/components/components/action-button/stories/index.stories.jsx +++ b/projects/js-packages/components/components/action-button/stories/index.stories.jsx @@ -5,9 +5,8 @@ import ActionButton from '../index.jsx'; export default { title: 'JS Packages/Components/Action Button', component: ActionButton, - // TODO: Storybook Actions are not working. See https://github.com/storybookjs/storybook/issues/7215 argTypes: { - onButtonClick: { action: 'clicked' }, + onClick: { action: 'clicked' }, }, }; @@ -15,7 +14,7 @@ export default { const Template = args => ; const DefaultArgs = { - onButtonClick: action( 'onButtonClick' ), + onClick: action( 'onButtonClick' ), displayError: false, isLoading: false, label: 'Action!', diff --git a/projects/js-packages/components/components/pricing-card/stories/index.stories.tsx b/projects/js-packages/components/components/pricing-card/stories/index.stories.tsx index e63df12ee9196..ccd27093ac072 100644 --- a/projects/js-packages/components/components/pricing-card/stories/index.stories.tsx +++ b/projects/js-packages/components/components/pricing-card/stories/index.stories.tsx @@ -5,7 +5,6 @@ import type { StoryFn, Meta } from '@storybook/react'; export default { title: 'JS Packages/Components/Pricing Card', component: PricingCard, - // TODO: Storybook Actions are not working. See https://github.com/storybookjs/storybook/issues/7215 argTypes: { onCtaClick: { action: 'clicked' }, }, diff --git a/projects/js-packages/publicize-components/changelog/update-cleanup-some-old-workarounds b/projects/js-packages/publicize-components/changelog/update-cleanup-some-old-workarounds new file mode 100644 index 0000000000000..36b6ed4380dff --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/update-cleanup-some-old-workarounds @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Add missing ids to radio buttons in the confirmation form. diff --git a/projects/js-packages/publicize-components/src/components/manage-connections-modal/confirmation-form/index.tsx b/projects/js-packages/publicize-components/src/components/manage-connections-modal/confirmation-form/index.tsx index 6ffc93c8ca59b..4851a7c073162 100644 --- a/projects/js-packages/publicize-components/src/components/manage-connections-modal/confirmation-form/index.tsx +++ b/projects/js-packages/publicize-components/src/components/manage-connections-modal/confirmation-form/index.tsx @@ -220,10 +220,15 @@ export function ConfirmationForm( { keyringResult, onComplete, isAdmin }: Confir : index === 0; return ( - // eslint-disable-next-line jsx-a11y/label-has-associated-control -- https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/869 -