JS: Solve react/require-default-props warnings#22381
Conversation
Pull Request Test Coverage Report for Build 7298f0f80b1d60d3dbcb5477f140308e8d87adbeWarning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
5ed6f7a to
b317abd
Compare
|
Note Force pushed a rebase on |
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
b317abd to
46a96d0
Compare
|
Note Force pushed a rebase on |
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
46a96d0 to
d30a23c
Compare
|
Note Force pushed a rebase on |
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
* remove unused WorkoutUpsell * add JSDoc in preperation for removing the propTypes * change func type to React.ReactNode (more specific) * change WPElement to JSX.Element
Since this is a legacy fallback component, let's not adjust it
Ignoring the GoogleDocsAddonUpsell as it is being worked on elsewhere # Conflicts: # packages/js/src/shared-admin/components/ai-generate-titles-and-descriptions-upsell.js # Conflicts: # packages/js/src/shared-admin/components/ai-optimize-upsell.js
# Conflicts: # packages/js/src/general/components/sidebar-layout.js
* fix the prop type of SuffixHeroIcon, leading to the SidebarButton
* AddonInstallation: add useCallback around render functions -- saves re-renders and fixes no-bind * AdvancedSettings/CollapsibleCornerstone: change empty lamda calls to Lodash' noop -- might save re-renders * SEMrushRelatedKeyphrasesModalContent: - remove default from required prop "countryCode" - fix missing prop declarations - remove unused passed prop "lastRequestKeyphrase" * SchemaTab: add back the header that was missing since 20.5 (5771ae6) * TaxonomyPicker: change some props to be required, as we only use it in one place
* Remove WincherSEOPerformance from editor-modules as it is not used in our add-ons * WincherRequest: fix JSDoc type => "int" to "number" * WincherTableRow/WincherPostPublish: change empty lamda calls to Lodash' noop -- might save re-renders * WincherSEOPerformance: a lot of missing prop types - looked at the container and added actual props - remove unused prop "historyDaysLimit" as it is retrieved from the history?? - WincherPeriodPicker: added default to "selected" prop - TableContent: took over the defaults of WincherSEOPerformance * WincherPerformanceReport - Row: fix type for "websiteId" from "number" to "string" - Cell/Row/WincherSEOPerformanceTable: change some props to be required as they are always passed anyway * WincherKeyphrasesTable - Add "null" default to "trackedKeyphrases" and "startAt" -- same as the code using them
# Conflicts: # packages/js/package.json
d30a23c to
a9062a3
Compare
|
Note Force pushed a rebase on |
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
1117fe4 to
2cf0e8f
Compare
…require-default-props-warnings
2cf0e8f to
14ad111
Compare
Context
Summary
This PR can be summarized in the following changelog entry:
defaultPropsto bedefaultArgumentsinstead.Relevant technical choices:
Note
I used ESLint as source to detect all the functional
defaultProps.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
yarn workspace @yoast/wordpress-seo eslint src --rule "{react/require-default-props: error}"-- this runs ESLint in thepackages/jsscope, changing the severity of the default props rule.defaultPropsthat are left should all be components (I ignored one on astyled-componentssomething)Smoke test the files.
Keep in mind, these are mostly just refactoring the default values of the components. While we might not even hit these defaults in the way we use the components.
That said, here is everything that is touched, divided in some categories:
Editor
scoreValuethere... not sure how to specifically check as I did have an "OK" in the SEO score.Get related keyphrasesunder the focus keyphrase field opens this in a modalwp.data.dispatch("yoast-seo-premium/editor").setLoadMorphologyDataError(["test"])Modal.lastRequestKeyphrase, not sure how to checkWincher features
Basically, all the Track SEO performance things.
trunkwp.data.dispatch("yoast-seo/editor").setWincherSetKeyphraseLimitReached(0)$data = [];WincherPerformanceReportcomponent (you can filter on it)401gave the reconnect warningKeyphrases tracked: 1998/2000or however many at the top of both dashboard and editor contenthistoryDaysLimitprop, not sure how to checkeditor-modules, effectively removing it from our add-ons/public API -- I gave it a search in our github organizationGeneral page
Alert center
Enable post types & taxonomies.which will add a notificationFirst time configuration
feedback.isVisibleto truewindow.yoast.indexing.preIndexingActions.terms = function() { throw new Error("hi"); }(presuming the terms need indexation)Indexation
returnof therun_indexation_action, see code:throw Error('boo');-- this will make it errorSettings page
onDismissedprop and passing it -- already done via the prop spread. Easy way to get errors is in the site representation, the other profiles of an organization. Fill in non-urls and savealtshould still default to an empty stringWorkouts page
Integrations page
Local SEO
Unreachable/untestable code
Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
UI changes
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.Documentation
Quality assurance
Innovation
innovationlabel.Fixes https://github.com/Yoast/reserved-tasks/issues/581