-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
SandBox: Convert to TypeScript #46478
Conversation
@@ -1,4 +1,4 @@ | |||
# Sandbox | |||
# SandBox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The public export is capitalized as "SandBox", so I've fixed up the capitalization inconsistencies.
Size Change: +57 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
@@ -83,6 +88,7 @@ const observeAndResizeJS = function () { | |||
window.addEventListener( 'resize', sendResize, true ); | |||
}; | |||
|
|||
// TODO: These styles shouldn't be coupled with WordPress. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮💨
const { contentDocument, ownerDocument } = ref.current; | ||
const { body } = contentDocument; | ||
const { contentDocument, ownerDocument } = | ||
ref.current as HTMLIFrameElement & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be explicit, we are sure that ref.current
is not undefined
because isFrameAccessible
acts as a typeguard
packages/components/CHANGELOG.md
Outdated
@@ -42,6 +42,7 @@ | |||
- NumberControl: refactor styles/tests/stories to TypeScript, replace fireEvent with user-event ([#45990](https://github.com/WordPress/gutenberg/pull/45990)). | |||
- `useBaseField`: Convert to TypeScript ([#45712](https://github.com/WordPress/gutenberg/pull/45712)). | |||
- `Dashicon`: Convert to TypeScript ([#45924](https://github.com/WordPress/gutenberg/pull/45924)). | |||
- `SandBox`: Convert to TypeScript ([#46478](https://github.com/WordPress/gutenberg/pull/46478)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line may need to be moved up after rebasing
The public export is capitalized as "SandBox"
Flaky tests detected in 6b3b3e2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3859426269
|
Part of #35744
What?
Add TypeScript types and documentation to the
SandBox
component.Why?
So we can ship TS data with the wp-components package.
Testing Instructions
npm run storybook:dev
SandBox
should look good, and the prop descriptions should match the README.md.