Skip to content

Conversation

@im3dabasia
Copy link
Contributor

What?

Part of: #67691
Migrating the redux-routine package to Typescript.

Why?

Type safety.

Testing Instructions

Type check and unit tests

@t-hamano t-hamano mentioned this pull request Jul 11, 2025
40 tasks
@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Package] Redux Routine /packages/redux-routine labels Jul 11, 2025
@im3dabasia im3dabasia marked this pull request as ready for review July 11, 2025 07:17
@im3dabasia im3dabasia requested a review from nerrad as a code owner July 11, 2025 07:17
@github-actions
Copy link

github-actions bot commented Jul 11, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

*
* @return Whether object is an action.
*/
export function isAction( object: any ): object is AnyAction {
Copy link
Member

Choose a reason for hiding this comment

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

Let us use unknown instead of any here.

Suggested change
export function isAction( object: any ): object is AnyAction {
export function isAction( object: unknown ): object is Action {

We may need to add this to a types.ts file in the same directory

/**
 * Add type guard for isPlainObject until the below PR gets merged:
 *
 * @see https://github.com/jonschlinkert/is-plain-object/pull/29
 */

declare module 'is-plain-object' {
	export function isPlainObject(
		value: unknown
	): value is Record< PropertyKey, unknown >;
}

Copy link
Member

@manzoorwanijk manzoorwanijk left a comment

Choose a reason for hiding this comment

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

This looks good now. Thank you for making the changes.

@manzoorwanijk manzoorwanijk enabled auto-merge (squash) July 22, 2025 14:23
@manzoorwanijk manzoorwanijk merged commit 280494f into WordPress:trunk Jul 22, 2025
68 of 69 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.3 milestone Jul 22, 2025
USERSATOSHI pushed a commit to USERSATOSHI/gutenberg that referenced this pull request Jul 23, 2025
Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Redux Routine /packages/redux-routine [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants