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

FocusableIframe: refactor to TypeScript #53979

Merged
merged 4 commits into from
Sep 5, 2023

Conversation

margolisj
Copy link
Contributor

What?

Why?

How?

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

@margolisj margolisj requested a review from ajitbohra as a code owner August 28, 2023 05:50
/**
* Internal dependencies
*/
import type { FocusableIframeProps } from './types';

/**
* @param {Object} props
Copy link
Contributor Author

@margolisj margolisj Aug 28, 2023

Choose a reason for hiding this comment

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

* @param {Object} props should be some variant of ComponentPropsWithoutRef< 'iframe' > to match my change? Idk enough about JSDoc types for an opinion. There are a few other good ways to do this: https://mortenbarklund.com/blog/react-typescript-props-spread/ that I could switch to.

Copy link
Contributor

Choose a reason for hiding this comment

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

We usually remove the types entirely from JSDocs when using TypeScript types. In this case, since the JSDoc comment was just there for adding type information, I'd argue that we can just simply delete it altogether.

@margolisj
Copy link
Contributor Author

@mirka @ciampo Small one for #35744. Let me know if you'd like me to change the JSDoc type from object to something more specific. Cheers.

@mirka mirka added [Type] Code Quality Issues or PRs that relate to code quality [Package] Components /packages/components labels Aug 28, 2023
@mirka mirka requested review from mirka and ciampo August 28, 2023 14:32
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

Thank you for working on this! This PR is good to go after deleting the JSDoc comment block as discussed in https://github.com/WordPress/gutenberg/pull/53979/files#r1306938378

/**
* Internal dependencies
*/
import type { FocusableIframeProps } from './types';

/**
* @param {Object} props
Copy link
Contributor

Choose a reason for hiding this comment

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

We usually remove the types entirely from JSDocs when using TypeScript types. In this case, since the JSDoc comment was just there for adding type information, I'd argue that we can just simply delete it altogether.

@margolisj
Copy link
Contributor Author

@ciampo Removed JSDocs and rebased to make sure the changelog was happy with both of these branches making internal sections.

Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Thank you!

@ciampo ciampo enabled auto-merge (squash) September 5, 2023 14:29
@ciampo ciampo merged commit b5a6f0b into WordPress:trunk Sep 5, 2023
@github-actions github-actions bot added this to the Gutenberg 16.7 milestone Sep 5, 2023
@margolisj margolisj deleted the FocusableIframe branch September 12, 2023 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [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