[bpk-react-utils] Migrate deprecated.js to TypeScript#4766
[bpk-react-utils] Migrate deprecated.js to TypeScript#4766Gert-Jan Vercauteren (gert-janvercauteren) wants to merge 6 commits into
Conversation
Migrates bpk-react-utils from JavaScript to TypeScript as described in #4753. - Replaced prop-types with TypeScript interfaces - Converted defaultProps to ES6 destructure defaults - Renamed .js source/test/story files to .tsx/.ts - Removed Flow type annotations - Preserved Apache 2.0 license headers Closes #4753
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Migrates the deprecated prop-type helper toward TypeScript by replacing Flow/prop-types typing with a TS type signature, and updates exports to treat the helper as typed.
Changes:
- Removes Flow typing and
prop-typestype import, introducing an explicitPropTypefunction type instead. - Updates
deprecatedto be typed as returning aPropTypevalidator. - Removes a
@ts-expect-errorsuppression on thedeprecatedimport inindex.ts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/backpack-web/src/bpk-react-utils/src/deprecated.js | Replaces Flow/prop-types type usage with an inline function type intended for TS. |
| packages/backpack-web/src/bpk-react-utils/index.ts | Removes TS suppression for importing deprecated. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import TransitionInitialMount from './src/TransitionInitialMount'; | ||
| import cssModules from './src/cssModules'; | ||
| // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`. | ||
| import deprecated from './src/deprecated'; |
|
Visit https://backpack.github.io/storybook-prs/4766 to see this build running in a browser. |
…ressions.md Replace @ts-ignore with @ts-expect-error for untyped imports. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Visit https://backpack.github.io/storybook-prs/4766 to see this build running in a browser. |
Must precede the 'from' clause to suppress the module-level import error. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Summary
bpk-react-utilsfrom JavaScript to TypeScriptprop-typeswith TypeScript interfacesdefaultPropsto ES6 destructure defaults.jssource/test/story files to.tsx/.tsCloses #4753