Fix/remove root searchbox dead code - #558
Conversation
|
@sukiman is attempting to deploy a commit to the Sitecore JSS Team on Vercel. A member of the Team first needs to authorize it. |
sc-krishanthakumara
left a comment
There was a problem hiding this comment.
Thanks for catching and cleaning this up @sukiman!
Verified the claim: root SearchBox.tsx was introduced in commit 0c7193b as part of PR #366, which was a large 19-file change to kit-nextjs-product-listing. The root file appears to have been an accidental leftover - the canonical component at SearchBox.tsx was the intended target of that PR's changes.
Worth noting as extra signal - the root copy is also a slightly older build - it still uses new URL(..., window.location.origin) for URL construction, which can cause SSR hydration mismatches. The canonical version was correctly refactored away from that pattern in PR #366 itself, so the root file is both unreferenced and behind.
Confirmed no imports point to the root file - this is a safe deletion with zero functional impact.
* Upgrade starter sites to CSDK 2.1.1 (Sitecore#541) * feat: upgrade basic-nextjs, product-listing & skate-park to CSDK 2.1.0 (Sitecore#482) * Upgrade Solterra and Alaris to CSDK 2.1.0 (Sitecore#481) * upgrade solterra site * upgrade alaris site to csdk 2.1.0 * refactor: simplify proxy function signatures and remove unused searchParams in page components * chore(deps): update Next.js and various dependencies to latest versions * chore(deps): update @sitecore-content-sdk/content, @sitecore-content-sdk/nextjs to 2.1.1, and other dependencies across multiple examples --------- Co-authored-by: Naveen Hedalla Arachchi <nvhd@sitecore.net> * chore(deps): bump the npm_and_yarn group across 7 directories with 5 updates (Sitecore#547) Bumps the npm_and_yarn group with 1 update in the /examples/basic-nextjs directory: [tmp](https://github.com/raszi/node-tmp). Bumps the npm_and_yarn group with 1 update in the /examples/basic-nextjs-pages-router directory: [tmp](https://github.com/raszi/node-tmp). Bumps the npm_and_yarn group with 3 updates in the /examples/basic-spa/angular directory: [postcss](https://github.com/postcss/postcss), [ip-address](https://github.com/beaugunderson/ip-address) and [ws](https://github.com/websockets/ws). Bumps the npm_and_yarn group with 1 update in the /examples/kit-nextjs-article-starter directory: [tmp](https://github.com/raszi/node-tmp). Bumps the npm_and_yarn group with 2 updates in the /examples/kit-nextjs-location-finder directory: [next-intl](https://github.com/amannn/next-intl) and [tmp](https://github.com/raszi/node-tmp). Bumps the npm_and_yarn group with 1 update in the /examples/kit-nextjs-product-listing directory: [tmp](https://github.com/raszi/node-tmp). Bumps the npm_and_yarn group with 1 update in the /examples/kit-nextjs-skate-park directory: [tmp](https://github.com/raszi/node-tmp). Updates `tmp` from 0.2.5 to 0.2.7 - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](raszi/node-tmp@v0.2.5...v0.2.7) Updates `tmp` from 0.2.5 to 0.2.7 - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](raszi/node-tmp@v0.2.5...v0.2.7) Updates `postcss` from 8.5.6 to 8.5.15 - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.5.6...8.5.15) Updates `ip-address` from 10.1.0 to 10.2.0 - [Commits](beaugunderson/ip-address@v10.1.0...v10.2.0) Updates `ws` from 8.18.3 to 8.20.1 - [Release notes](https://github.com/websockets/ws/releases) - [Commits](websockets/ws@8.18.3...8.20.1) Updates `tmp` from 0.2.5 to 0.2.7 - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](raszi/node-tmp@v0.2.5...v0.2.7) Updates `next-intl` from 4.9.1 to 4.9.2 - [Release notes](https://github.com/amannn/next-intl/releases) - [Changelog](https://github.com/amannn/next-intl/blob/main/CHANGELOG.md) - [Commits](amannn/next-intl@v4.9.1...v4.9.2) Updates `tmp` from 0.2.5 to 0.2.7 - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](raszi/node-tmp@v0.2.5...v0.2.7) Updates `tmp` from 0.2.5 to 0.2.7 - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](raszi/node-tmp@v0.2.5...v0.2.7) Updates `tmp` from 0.2.5 to 0.2.7 - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](raszi/node-tmp@v0.2.5...v0.2.7) --- updated-dependencies: - dependency-name: tmp dependency-version: 0.2.7 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: tmp dependency-version: 0.2.7 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: postcss dependency-version: 8.5.15 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: ip-address dependency-version: 10.2.0 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: ws dependency-version: 8.20.1 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: tmp dependency-version: 0.2.7 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: next-intl dependency-version: 4.9.2 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: tmp dependency-version: 0.2.7 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: tmp dependency-version: 0.2.7 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: tmp dependency-version: 0.2.7 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump ws from 8.18.3 to 8.20.1 in /examples/basic-spa (Sitecore#538) Bumps [ws](https://github.com/websockets/ws) from 8.18.3 to 8.20.1. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](websockets/ws@8.18.3...8.20.1) --- updated-dependencies: - dependency-name: ws dependency-version: 8.20.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove MultiPromo Primary Button variant (no React implementation) (Sitecore#539) Co-authored-by: sc-sobiyasivakumar <sc-sobiyasivakumar@users.noreply.github.com> * chore: update several dependancy versions in package.json files and sync the lock files to use the newest versions (Sitecore#546) Co-authored-by: Pamodith Maduwantha <pamo@sitecore.net> * Vulnerabilities fix (Sitecore#552) * Update package-locks * Chore(deps): update package-lock.json and package.json to reflect dependency changes * chore(deps): update package-lock.json and package.json to reflect new versions of dependencies * chore(deps): update qs to version 6.15.2 and bump other dependencies in package.json and package-lock.json * chore(deps): update hono to version 4.12.18, brace-expansion to 5.0.6, and add uuid and webpack-dev-server dependencies in package.json and package-lock.json * SYNC: Cleanup unused patterns, and fix config issues (Sitecore#544) * fix(product-listing): removed font styles from layout, updated global styles, and TypeScript config * fix(search-experience): update class from 'search-indexing' to 'search-experience' * fix(theme): implement dark mode styles and update theme provider defaults * Revert theme fixes * Code refactor and improvements to `kit-nextjs-article-starter` (Sitecore#551) * refactor: simplify Providers component by removing unused props and context * refactor: remove SiteMetadata component and related props since they are dead code * refactor: update import paths to use absolute imports for better reliability * feat: enhance Sitecore configuration with API and default settings * refactor: clean up TypeScript configuration and update proxy matcher in kit-nextjs-article-starter (Sitecore#553) * refactor: simplify Sitecore configuration by removing unused API settings in kit-nextjs-article-starter (Sitecore#554) * Refactored location-finder code to follow the best practices (Sitecore#540) * Refactored location-finder code to follow the best practices * Standardize location-finder field shape access * Add guidance for using props sidecars in component structure --------- Co-authored-by: sc-esariupendri <236554266+sc-esariupendri@users.noreply.github.com> * Refactored product-listing code to follow the best practices (Sitecore#542) * Refactor search field handling to improve error management and support optional input * Refactored product-listing code to follow the best practices * Refactor next:dev script to include NODE_OPTIONS for debugging * Field shape inconcistency refactor * Resolved test failures * Refactor component props management: move props/interfaces to sidecar files and update Sitecore CLI config to exclude them from component-map generation. --------- Co-authored-by: sc-esariupendri <236554266+sc-esariupendri@users.noreply.github.com> * Refactored skate-park code to follow the best practices (Sitecore#550) * Skate park refactor * refactor: enhance compatibility of component props and improve field value retrieval --------- Co-authored-by: sc-esariupendri <236554266+sc-esariupendri@users.noreply.github.com> * fix: remove accidentally committed root SearchBox.tsx dead code (Sitecore#558) * fix(location-finder): fix minimatch override to use scoped version constraint (Sitecore#562) Co-authored-by: sc-krishanthakumara <sc-krishanthakumara@users.noreply.github.com> * revert: use dmz version of AlertBanner test file * fix: restore AlertBanner test as proper text file (dmz version) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Nipuna Abeywickrama <nipu@sitecore.net> Co-authored-by: Naveen Hedalla Arachchi <nvhd@sitecore.net> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sobiya Sivakumar <siva@sitecore.net> Co-authored-by: sc-sobiyasivakumar <sc-sobiyasivakumar@users.noreply.github.com> Co-authored-by: Shakya Wijerathne <shakya.wijerathne@sitecore.com> Co-authored-by: Pamodith Maduwantha <pamo@sitecore.net> Co-authored-by: Chathumika Alwis <ctlw@sitecore.net> Co-authored-by: Esari Upendri <upen@sitecore.net> Co-authored-by: sc-esariupendri <236554266+sc-esariupendri@users.noreply.github.com> Co-authored-by: sukiman <sukiman.hung@gmail.com> Co-authored-by: sc-krishanthakumara <sc-krishanthakumara@users.noreply.github.com>
* Refactored location-finder code to follow the best practices (Sitecore#540) * Refactored location-finder code to follow the best practices * Standardize location-finder field shape access * Add guidance for using props sidecars in component structure --------- Co-authored-by: sc-esariupendri <236554266+sc-esariupendri@users.noreply.github.com> * Refactored product-listing code to follow the best practices (Sitecore#542) * Refactor search field handling to improve error management and support optional input * Refactored product-listing code to follow the best practices * Refactor next:dev script to include NODE_OPTIONS for debugging * Field shape inconcistency refactor * Resolved test failures * Refactor component props management: move props/interfaces to sidecar files and update Sitecore CLI config to exclude them from component-map generation. --------- Co-authored-by: sc-esariupendri <236554266+sc-esariupendri@users.noreply.github.com> * Refactored skate-park code to follow the best practices (Sitecore#550) * Skate park refactor * refactor: enhance compatibility of component props and improve field value retrieval --------- Co-authored-by: sc-esariupendri <236554266+sc-esariupendri@users.noreply.github.com> * fix: remove accidentally committed root SearchBox.tsx dead code (Sitecore#558) * feat: implement zipcode storage utility and update components to use it --------- Co-authored-by: sc-esariupendri <236554266+sc-esariupendri@users.noreply.github.com> Co-authored-by: sukiman <sukiman.hung@gmail.com>
Summary
SearchBox.tsxaccidentally committed at the repo root in sync SEO and GEO improvements #366examples/kit-nextjs-product-listing/src/components/site-three/non-sitecore/SearchBox.tsxand is still used byHeaderST.tsxTest plan
SearchBox.tsxHeaderST.test.tsxpasses (30/30) inkit-nextjs-product-listing