refactor(bpk-component-list): migrate to TypeScript#4196
Conversation
- Convert BpkList.js to BpkList.tsx - Replace Flow types with TypeScript types - Remove PropTypes in favor of TypeScript Props type - Export Props type for consumers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Convert BpkListItem.js to BpkListItem.tsx - Replace Flow types with TypeScript types - Remove PropTypes in favor of TypeScript Props type - Export Props type for consumers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Convert test files from .js to .tsx - Remove Flow type annotations - Update snapshot file names Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Convert index.js to index.ts - Add type exports for BpkListProps and BpkListItemProps Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the bpk-component-list package from JavaScript/Flow to TypeScript, modernizing the type system while maintaining functionality and test coverage.
Changes:
- Converted component files from Flow to TypeScript with proper type definitions
- Exported component Props types for consumer usage
- Removed Flow annotations from all test files
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
index.ts |
Added TypeScript type exports for BpkListProps and BpkListItemProps |
BpkList.tsx |
Converted from Flow to TypeScript, removed PropTypes, improved variable naming |
BpkListItem.tsx |
Converted from Flow to TypeScript, removed PropTypes validation |
BpkList-test.tsx |
Removed Flow annotation |
BpkListItem-test.tsx |
Removed Flow annotation |
accessibility-test.tsx |
Removed Flow annotation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Visit https://backpack.github.io/storybook-prs/4196 to see this build running in a browser. |
- Make ordered prop optional (has default value) - Change ariaLabel, ariaLabelledby, title to string | undefined (compatible with HTML attribute types) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Visit https://backpack.github.io/storybook-prs/4196 to see this build running in a browser. |
| import BpkList from './src/BpkList'; | ||
| import BpkListItem from './src/BpkListItem'; | ||
|
|
||
| export type { Props as BpkListProps } from './src/BpkList'; |
There was a problem hiding this comment.
Maybe there could be export type BpkListProps directly if the name Props is changed to BpkListProps in BpkList.tsx, but it's not an issue
7daec19
into
main
Summary
bpk-component-listpackage from JavaScript/Flow to TypeScriptBpkListandBpkListItemcomponents to TypeScriptBpkListProps,BpkListItemProps)Changes
index.js→index.tsBpkList.js→BpkList.tsxBpkListItem.js→BpkListItem.tsx.tsx, removed Flow annotationsTest plan
npm run jest -- packages/bpk-component-list)🤖 Generated with Claude Code