Skip to content

[bpk-react-utils] Migrate deprecated.js to TypeScript#4766

Open
Gert-Jan Vercauteren (gert-janvercauteren) wants to merge 6 commits into
mainfrom
ts-migration/bpk-react-utils
Open

[bpk-react-utils] Migrate deprecated.js to TypeScript#4766
Gert-Jan Vercauteren (gert-janvercauteren) wants to merge 6 commits into
mainfrom
ts-migration/bpk-react-utils

Conversation

@gert-janvercauteren

Copy link
Copy Markdown
Contributor

Summary

  • Migrates bpk-react-utils from JavaScript to TypeScript
  • Replaces prop-types with TypeScript interfaces
  • Converts defaultProps to ES6 destructure defaults
  • Removes Flow type annotations
  • Renames .js source/test/story files to .tsx/.ts

Closes #4753

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
Copilot AI review requested due to automatic review settings June 26, 2026 09:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-types type import, introducing an explicit PropType function type instead.
  • Updates deprecated to be typed as returning a PropType validator.
  • Removes a @ts-expect-error suppression on the deprecated import in index.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';
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

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>
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Non breaking change ts-conversion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bpk-react-utils] Migrate deprecated.js to TypeScript

2 participants