Skip to content

[bpk-component-phone-input] Migrate to TypeScript#4760

Open
Gert-Jan Vercauteren (gert-janvercauteren) wants to merge 10 commits into
mainfrom
ts-migration/bpk-component-phone-input
Open

[bpk-component-phone-input] Migrate to TypeScript#4760
Gert-Jan Vercauteren (gert-janvercauteren) wants to merge 10 commits into
mainfrom
ts-migration/bpk-component-phone-input

Conversation

@gert-janvercauteren

Copy link
Copy Markdown
Contributor

Summary

  • Migrates bpk-component-phone-input 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 #4747

Migrates bpk-component-phone-input from JavaScript to TypeScript as described in #4747.

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

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 bpk-component-phone-input from Flow/PropTypes-based JavaScript to TypeScript by introducing TS types for component props and updating tests/stories accordingly.

Changes:

  • Replaces Flow + prop-types with exported TypeScript types for BpkPhoneInput props and related structures.
  • Updates tests to type defaultProps and uses TS-style type assertions.
  • Updates Storybook story handlers with typed React ChangeEvents and removes TS suppression comments.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/backpack-web/src/bpk-component-phone-input/src/form-test.js Updates test imports/props to use TS type Props and adds a TS type assertion for FormData.
packages/backpack-web/src/bpk-component-phone-input/src/accessibility-test.js Types defaultProps using exported TS props type.
packages/backpack-web/src/bpk-component-phone-input/src/BpkPhoneInput.stories.tsx Adds typed ChangeEvent handlers and removes TS suppression comments.
packages/backpack-web/src/bpk-component-phone-input/src/BpkPhoneInput.js Replaces Flow/PropTypes with exported TS types and typed event handlers.
packages/backpack-web/src/bpk-component-phone-input/src/BpkPhoneInput-test.js Types defaultProps using exported TS props type.
packages/backpack-web/src/bpk-component-phone-input/index.js Removes Flow pragma but keeps type re-export/import pattern.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@skyscanner-backpack-bot

skyscanner-backpack-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Browser support

If this is a visual change, make sure you've tested it in multiple browsers.

Generated by 🚫 dangerJS against a789c52

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4760 to see this build running in a browser.

…ts-ts-suppressions.md

Replace @ts-ignore with @ts-expect-error for untyped imports.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
BpkPhoneInput is now TypeScript so the suppression is no longer needed.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…r/index.ts

Must precede the 'from' clause to suppress the module-level import error.

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/4760 to see this build running in a browser.

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-component-phone-input] Migrate to TypeScript

2 participants