Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
As a developer, my regular usage pattern of Polaris is:
/
to open the searchBut it can be more efficient, and we don't need to reinvent the wheel. You can go to google.com/search?q=Shopify. In Chrome, you can even type google.com + tab and write your search directly on the bar.
This PR Implements the route
https://polaris.shopify.com/search?q={searchTerm}
intended to be used as a search-ready URL, now (and using the chrome site search config) the search experience can be:Demo
Screen.Recording.2024-07-01.at.11.55.30.p.m.mov
WHAT is this pull request doing?
1. Fix a useThrottle hook's race condition that prevents the first event from being fire.
This is testable by going to polaris.com, opening the search and type one key; the result is the search non being fired
2. Create the search route
<GlobalSearch/>
component, watch for the route and search term to open and fill the search.How to 🎩
cd polaris.shopify.com && pnpm dev
localhost:3000/search&q=Any Search term
🎩 checklist
README.md
with documentation changes