Remove @wordpress/{components,plugins,date,dom,notices,keycodes,rich-text,redux-routine,block-serialization-default-parser,deprecated} types due to bundled definitions in packages#69133
Conversation
|
@rafaucau Thank you for submitting this PR! This is a live comment which I will keep updated. This PR touches some part of DefinitelyTyped infrastructure, so a DT maintainer will need to review it. This is rare — did you mean to do this? 13 packages in this PR (and infra files)
Code ReviewsBecause this PR edits multiple packages, it can be merged once it's reviewed by a DT maintainer. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 69133,
"author": "rafaucau",
"headCommitOid": "ec36d389668c9f2878c2ba071f5014290aac3229",
"mergeBaseOid": "e1386bb7838c35504edfdb12876bf0d156d84a2a",
"lastPushDate": "2024-03-23T13:51:05.000Z",
"lastActivityDate": "2024-04-03T18:19:15.000Z",
"mergeOfferDate": "2024-04-03T18:14:31.000Z",
"mergeRequestDate": "2024-04-03T18:19:15.000Z",
"mergeRequestUser": "rafaucau",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": true,
"popularityLevel": "Well-liked by everyone",
"pkgInfo": [
{
"name": null,
"kind": "edit",
"files": [
{
"path": "notNeededPackages.json",
"kind": "infrastructure"
}
],
"owners": [],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical",
"isSafeInfrastructureEdit": false
},
{
"name": "wordpress__block-editor",
"kind": "edit",
"files": [
{
"path": "types/wordpress__block-editor/components/alignment-toolbar.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/block-controls.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/block-format-controls.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/block-icon.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/font-sizes.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/inserter.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/inspector-advanced-controls.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/inspector-controls.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/media-placeholder.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/navigable-toolbar.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/panel-color-settings.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/rich-text.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/components/url-popover.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-editor/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__block-editor/wordpress__block-editor-tests.tsx",
"kind": "test"
}
],
"owners": [
"dsifford",
"sirreal",
"dmsnell"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__block-serialization-default-parser",
"kind": "delete",
"files": [
{
"path": "types/wordpress__block-serialization-default-parser/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__block-serialization-default-parser/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__block-serialization-default-parser/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__block-serialization-default-parser/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__block-serialization-default-parser/wordpress__block-serialization-default-parser-tests.ts",
"kind": "test"
}
],
"owners": [
"dsifford"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__blocks",
"kind": "edit",
"files": [
{
"path": "types/wordpress__blocks/api/categories.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__blocks/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__blocks/package.json",
"kind": "package-meta-ok"
}
],
"owners": [
"dsifford",
"sirreal",
"dmsnell",
"tomasztunik",
"sunyatasattva",
"bastolen"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__components",
"kind": "delete",
"files": [
{
"path": "types/wordpress__components/.eslintrc.json",
"kind": "package-meta",
"suspect": "edited"
},
{
"path": "types/wordpress__components/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__components/angle-picker-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/animate/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/autocomplete/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/base-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/button-group/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/button/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/card/body/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/card/divider/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/card/footer/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/card/header/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/card/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/card/media/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/checkbox-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/clipboard-button/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/color-indicator/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/color-palette/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/color-picker/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/combobox-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/custom-select-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/dashicon/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/date-time/date.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/date-time/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/date-time/time.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/disabled/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/draggable/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/drop-zone/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/drop-zone/provider.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/dropdown-menu/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/dropdown/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/external-link/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/flex/block.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/flex/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/flex/item.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/focal-point-picker/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/focusable-iframe/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/font-size-picker/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/form-file-upload/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/form-toggle/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/form-token-field/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/guide/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/higher-order/navigate-regions/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/higher-order/with-constrained-tabbing/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/higher-order/with-fallback-styles/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/higher-order/with-filters/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/higher-order/with-focus-outside/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/higher-order/with-focus-return/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/higher-order/with-notices/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/higher-order/with-spoken-messages/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/icon-button/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/icon/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/isolated-event-container/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/keyboard-shortcuts/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/menu-group/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/menu-item/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/menu-items-choice/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/modal/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/navigable-container/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/navigable-container/menu.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/navigable-container/tabbable.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/notice/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/notice/list.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__components/panel/body.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/panel/header.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/panel/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/panel/row.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/placeholder/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/popover/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/primitives/block-quotation/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/primitives/horizontal-rule/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/primitives/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/primitives/svg/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/query-controls/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/radio-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/range-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/resizable-box/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/responsive-wrapper/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/sandbox/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/scroll-lock/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/select-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/shortcut/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/slot-fill/context.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/slot-fill/fill.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/slot-fill/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/slot-fill/slot.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/snackbar/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/snackbar/list.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/spinner/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/tab-panel/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/text-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/textarea-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/tip/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/toggle-control/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/toolbar-button/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/toolbar-group/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/toolbar/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/tooltip/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/tree-select/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__components/ui/context/wordpress-component.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/visually-hidden/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__components/wordpress__components-tests.tsx",
"kind": "test"
}
],
"owners": [
"dsifford",
"sirreal",
"p-jackson",
"sarayourfriend",
"michaelhthomas",
"manzoorwanijk",
"bastolen"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__date",
"kind": "delete",
"files": [
{
"path": "types/wordpress__date/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__date/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__date/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__date/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__date/wordpress__date-tests.ts",
"kind": "test"
}
],
"owners": [
"dsifford"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__deprecated",
"kind": "delete",
"files": [
{
"path": "types/wordpress__deprecated/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__deprecated/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__deprecated/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__deprecated/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__deprecated/wordpress__deprecated-tests.ts",
"kind": "test"
}
],
"owners": [
"dsifford"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__dom",
"kind": "delete",
"files": [
{
"path": "types/wordpress__dom/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__dom/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__dom/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__dom/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__dom/wordpress__dom-tests.ts",
"kind": "test"
}
],
"owners": [
"dsifford"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__editor",
"kind": "edit",
"files": [
{
"path": "types/wordpress__editor/components/autocompleters.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__editor/package.json",
"kind": "package-meta-ok"
}
],
"owners": [
"dsifford"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__keycodes",
"kind": "delete",
"files": [
{
"path": "types/wordpress__keycodes/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__keycodes/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__keycodes/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__keycodes/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__keycodes/wordpress__keycodes-tests.ts",
"kind": "test"
}
],
"owners": [
"dsifford"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__notices",
"kind": "delete",
"files": [
{
"path": "types/wordpress__notices/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__notices/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__notices/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__notices/store/actions.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__notices/store/selectors.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__notices/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__notices/wordpress__notices-tests.tsx",
"kind": "test"
}
],
"owners": [
"dsifford",
"chihsuan"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__plugins",
"kind": "delete",
"files": [
{
"path": "types/wordpress__plugins/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__plugins/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__plugins/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__plugins/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__plugins/wordpress__plugins-tests.tsx",
"kind": "test"
}
],
"owners": [
"dsifford"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__redux-routine",
"kind": "delete",
"files": [
{
"path": "types/wordpress__redux-routine/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__redux-routine/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__redux-routine/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__redux-routine/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__redux-routine/wordpress__redux-routine-tests.ts",
"kind": "test"
}
],
"owners": [
"dsifford"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "wordpress__rich-text",
"kind": "delete",
"files": [
{
"path": "types/wordpress__rich-text/.eslintrc.json",
"kind": "package-meta",
"suspect": "edited"
},
{
"path": "types/wordpress__rich-text/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__rich-text/component/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__rich-text/component/use-anchor-ref.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__rich-text/component/use-anchor.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__rich-text/create.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__rich-text/index.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__rich-text/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__rich-text/store/actions.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__rich-text/store/selectors.d.ts",
"kind": "definition"
},
{
"path": "types/wordpress__rich-text/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/wordpress__rich-text/wordpress__rich-text-tests.tsx",
"kind": "test"
}
],
"owners": [
"dsifford"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "RyanCavanaugh",
"date": "2024-04-03T18:13:25.000Z",
"isMaintainer": true
},
{
"type": "approved",
"reviewer": "mikeybinns",
"date": "2024-04-02T21:05:08.000Z",
"isMaintainer": false
},
{
"type": "approved",
"reviewer": "sarayourfriend",
"date": "2024-04-02T19:46:59.000Z",
"isMaintainer": false
},
{
"type": "stale",
"reviewer": "gziolo",
"date": "2024-03-26T12:06:26.000Z",
"abbrOid": "af6acf8"
}
],
"mainBotCommentID": 2016509634,
"ciResult": "pass"
} |
|
🔔 @dsifford @sirreal @dmsnell @tomasztunik @sunyatasattva @bastolen @p-jackson @sarayourfriend @michaelhthomas @manzoorwanijk @chihsuan — please review this PR in the next few days. Be sure to explicitly select |
@wordpress/{components,plugins,date,dom,notices,keycodes,rich-text,redux-routine,block-serialization-default-parser,deprecated} types due to bundled definitions in packages
|
@rafaucau The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review. |
@wordpress/{components,plugins,date,dom,notices,keycodes,rich-text,redux-routine,block-serialization-default-parser,deprecated} types due to bundled definitions in packages@wordpress/{components,plugins,date,dom,notices,keycodes,rich-text,redux-routine,block-serialization-default-parser,deprecated} types due to bundled definitions in packages
|
Overall, great effort to use all the exposed types from the updated WordPress packages. There might be still a few smaller packages that could natively offer types without too much hassle. |
|
It looks like the problem with component type detection (#69133 (comment)) is coming from my IDE. Last time I had looked, the problem was also in the VSC, but today it is ok. In that case, I'll be continuing this PR using VSC. |
|
Okay, great, so just to confirm, the plan is now to update your PR to remove the deep imports and instead use React.ComponentProps to get the props for each component? I saw you added me to your repo, were you looking for help with this @rafaucau? Or was that just for assistance with the bug you mentioned above? |
Initially with bug mentioned above. But this has already been solved. But there is one last challenge. Somehow the This is how I managed to extract the type of type Completer = React.ComponentProps<typeof Autocomplete>['completers'][number];I have no idea at this moment. Can you help? |
|
@sarayourfriend, @gziolo, @mikeybinns Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
I don't think it's possible to both extract a type from an array and modify it with a generic, so for that one, you might need to just use that deep import 🤷 This is made clearer if you imagine the type was given a generic in its implemenation. e.g. type ThingWithGeneric<T> = {test: T};
type ArrayType = ThingWithGeneric<string>[]
type Test = ArrayType[number] // ThingWithGeneric<string>, string has already been passed to it. |
|
I think it's a fine stop-gap to accept it will be import React from 'react'
type WPCompleter<T = any> = {
name: T
}
type Props<T> = {
completers: WPCompleter<T>[]
}
const Component = <T, >(props: Props<T>) => {
return <div />
}
type Completer<T> = React.ComponentProps<typeof Component<T>>['completers'][number]Here's the TS playground link to try it out I haven't worked with React in almost three years, so I don't know whether React with TypeScript works well with these generic prop types (I seem to recall them being finicky). |
|
@gziolo, @mikeybinns Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
I think they work okay, I haven't had issues on my end, it's just a bit of uncommon syntax. I have a separate PR trying to add something similar for SelectControl, so I could make a PR for this too. They may also make an exception for exporting the completer type, like they have done with IconType? I think best option may be submit an issue first explaining the issue and get their recommendation for their preferred fix :) |
| slug: string; | ||
| title: string; | ||
| icon?: JSX.Element | Dashicon.Icon | null | undefined; | ||
| icon?: JSX.Element | IconType | null | undefined; |
There was a problem hiding this comment.
IconType includes JSX.Element, so this can be simplified
|
2c: I'd suggest splitting this one into two (removals stays, amendments goes into new PR via branch rename). It looks like removals are non controversial. Just an opinion |
|
@gziolo Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
Ready to merge |
|
Good job @rafaucau 🥳 |
|
Thanks @rafaucau and @mikeybinns. I appreciate all the typing! |



This PR removes types that are already bundled in the packages.
Resolves: #64541