-
Notifications
You must be signed in to change notification settings - Fork 203
[BpkAutosuggest][CLOV-354]Make BpkAutosuggestV2 as default #4099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR transitions BpkAutosuggest to use V2 as the default implementation, making the previous version available as BpkAutosuggestLegacy. The change includes a comprehensive migration guide and updates to examples and documentation.
- Makes
BpkAutosuggestV2the default export - Renames the legacy implementation to
BpkAutosuggestLegacy - Adds a detailed migration guide from V1 to V2
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/bpk-component-autosuggest/index.js | Updates exports to make V2 the default and legacy a named export |
| packages/bpk-component-autosuggest/docs/migrating-from-v1-to-v2.md | Adds comprehensive migration guide with API mapping and code examples |
| packages/bpk-component-autosuggest/README.md | Updates README to document the new default export and legacy version |
| examples/bpk-component-fieldset/examples.tsx | Updates example to use V2 API patterns |
| examples/bpk-component-autosuggestV2/stories.tsx | Updates story imports to use new default export |
| examples/bpk-component-autosuggestV2/examples.tsx | Updates example imports to use new default export |
| examples/bpk-component-autosuggest/stories.js | Updates legacy story to use BpkAutosuggestLegacy |
| examples/bpk-component-autosuggest/examples.js | Updates legacy example to use BpkAutosuggestLegacy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| BpkAutosuggestV2, | ||
| BpkAutosuggestSuggestion, | ||
| } from '@skyscanner/backpack-web/bpk-component-autosuggest'; |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The migration guide incorrectly imports BpkAutosuggestV2 as a named export. Based on the changes in index.js, BpkAutosuggestV2 is now the default export and should be imported as import BpkAutosuggest from '@skyscanner/backpack-web/bpk-component-autosuggest' to align with the new API.
| return ( | ||
| <div> | ||
| <BpkLabel htmlFor="my-autosuggest">Office</BpkLabel> | ||
| <BpkAutosuggestV2<Office> |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The component name in the migration guide should be BpkAutosuggest instead of BpkAutosuggestV2 to match the new default export and avoid confusion for users following the guide.
| <BpkAutosuggestV2<Office> | |
| <BpkAutosuggest<Office> |
| **After (v2)** | ||
|
|
||
| ```ts | ||
| <BpkAutosuggestV2 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The component name should be BpkAutosuggest instead of BpkAutosuggestV2 to match the new default export.
| <BpkAutosuggestV2 | |
| <BpkAutosuggest |
| import { | ||
| BpkAutosuggestV2, | ||
| defaultTheme, | ||
| } from '@skyscanner/backpack-web/bpk-component-autosuggest'; | ||
|
|
||
| <BpkAutosuggestV2 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The theme migration example incorrectly imports and uses BpkAutosuggestV2 as a named export. It should use the default export BpkAutosuggest.
|
Visit https://backpack.github.io/storybook-prs/4099 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4099 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4099 to see this build running in a browser. |
As roll out BpkAutosuggestV2, we need to make auto sugggestV2 as default
Add migration BpkAutosuggest V1 to V2 doc
Remember to include the following changes:
[Clover-123][BpkButton] Updating the colourREADME.md(If you have created a new component)README.md