Conversation
|
Size Change: +16 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
mirka
left a comment
There was a problem hiding this comment.
Looking good! We also need a changelog before merge 🙏
| pages = | ||
| Children.map( children, ( child ) => ( { |
There was a problem hiding this comment.
I wish we had a readonly for prop reassignment 😅
| import PageControl from './page-control'; | ||
| import type { GuideProps } from './types'; | ||
|
|
||
| export default function Guide( { |
There was a problem hiding this comment.
This function needs to be named before the default export statement for the Storybook docgen to kick in.
function Guide( {
/* ... */
}
export default Guide;This will make the type data show up in the props table in Storybook Docs view. And could we also add a main JSDoc to the component like the others?
|
Flaky tests detected in 35c3d5a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4314356626
|
843cc06 to
62f7bf1
Compare
There was a problem hiding this comment.
Hey @flootr , would you also mind updating the component's README so that it's in sync with the JSDocs from types.ts ? In particular:
- all props should be listed
- we should update prop types to be more precise, using TypeScript types where possible (e.g from
functionto( event?: KeyboardEvent< HTMLDivElement > | SyntheticEvent ) => void, fromarrayto{ content: ReactNode; image?: ReactNode; }[]etc..) - we should double check which props are marked as required and which optional
- we should double check that the default value is listed too
Thank you! 🙏
62f7bf1 to
82d2080
Compare
|
@ciampo I think all feedback should be addressed. Let me know if there's anything else :) |
ciampo
left a comment
There was a problem hiding this comment.
LGTM 🚀
The Storybook example definitely needs some love, but that's a task for another day / PR (and not very high priority).
Feel free to merge once the last minor comments are addressed !
packages/components/CHANGELOG.md
Outdated
There was a problem hiding this comment.
Looks like this needs to be moved again under the newer Unreleased section of the CHANGELOG
82d2080 to
bbf3264
Compare
Co-authored-by: Lena Morita <lena@jaguchi.com>
Co-authored-by: Lena Morita <lena@jaguchi.com>
bbf3264 to
35c3d5a
Compare
What?
Refactor the
Guidecomponent to TypeScriptPart of #35744
Why?
The refactor to TypeScript has many benefits (auto-generated docs, static linting and error prevention, better IDE experience). See #35744 for more details
How?
Followed the steps highlighted in the TypeScript migration guide.
Testing Instructions