diff --git a/README.md b/README.md index 2589c44af..021b2dc54 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Before proceeding, please make sure you have the following: ### How to run the apps -To init and install dependancies please use : +To init and install dependencies please use : pnpm install @@ -62,4 +62,5 @@ The Boilerplate is highly scalable, and customizable. It is made with ReactInsta By following the steps described in this documentation you will be able to build your own Algolia application in matter of minutes. Happy Coding! + # boilerplate-demo-with-neural diff --git a/apps/boilerplate-documentation/docs/02-Getting Started/structure.md b/apps/boilerplate-documentation/docs/02-Getting Started/structure.md index bb0be0f10..061f4bab0 100644 --- a/apps/boilerplate-documentation/docs/02-Getting Started/structure.md +++ b/apps/boilerplate-documentation/docs/02-Getting Started/structure.md @@ -19,7 +19,7 @@ sidebar_position: 2 - called by Index.jsx - calls Main.jsx - Wraps child components in Algolia Instantsearch - - [Algolia instantsearch](https://github.com/algolia/react-instantsearch) + - [Algolia React InstantSearch](https://github.com/algolia/instantsearch) ### Main.jsx diff --git a/apps/boilerplate-front-end/README.md b/apps/boilerplate-front-end/README.md index 718bc4780..b73c92f53 100755 --- a/apps/boilerplate-front-end/README.md +++ b/apps/boilerplate-front-end/README.md @@ -90,7 +90,7 @@ App.jsx - called by Index.jsx - calls Main.jsx - Wraps child components in Algolia Instantsearch - - [Algolia instantsearch](https://github.com/algolia/react-instantsearch) + - [Algolia React InstantSearch](https://github.com/algolia/instantsearch) Main.jsx @@ -848,7 +848,7 @@ Scan through our [existing issues](https://github.com/algolia/algolia-react-boil - Using the command line: - [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository) so that you can make your changes without affecting the original project until you're ready to merge them. -2. Install or update all the needed dependancies. You can do so by following our [Getting started Section](#️-get-started) +2. Install or update all the needed dependencies. You can do so by following our [Getting started Section](#️-get-started) 3. Create a working branch and start with your changes! @@ -895,19 +895,19 @@ nvm use 14 ### pnpm version -Your pnpm version should higher than 8.0.0 to avoid any dependancy issue with InstantSearch Hooks package. +Your pnpm version should higher than 8.0.0 to avoid any dependency issue with InstantSearch Hooks package. If you still get any issue using pnpm you can try using `yarn` or `npm`. You might also want to try with `npm install --force` ### package issue -If you encounter an issue with the package react-instantsearch-hooks-web please try to install the dependancies with npm or yarn as mentionned above. +If you encounter an issue with the package react-instantsearch please try to install the dependencies with npm or yarn as mentioned above. If you encounter an issue with turbo-darwin-64 please install the package in the front-end folder with your package manager of choice. ### Sass - Scss compiler -If you are unable to install sass library or you simply don't want to use it whithin the app, we are providing in each folder in a `compiled CSS` subfolder the compiled and the minified CSS of our Scss files. +If you are unable to install sass library or you simply don't want to use it within the app, we are providing in each folder in a `compiled CSS` subfolder the compiled and the minified CSS of our Scss files. Feel free to use it. diff --git a/apps/boilerplate-front-end/package.json b/apps/boilerplate-front-end/package.json index 13bb8e24e..302178bc8 100755 --- a/apps/boilerplate-front-end/package.json +++ b/apps/boilerplate-front-end/package.json @@ -46,7 +46,7 @@ "algoliasearch": "4.14.2", "framer-motion": "^7.0.0", "i18next": "^21.8.11", - "instantsearch.js": "^4.49.2", + "instantsearch.js": "^4.60.0", "lodash": "^4.17.21", "lodash.debounce": "^4.0.8", "npm": "^8.5.5", @@ -57,7 +57,7 @@ "react-dom": "^18.2.0", "react-i18next": "^11.17.4", "react-icons": "^4.8.0", - "react-instantsearch-hooks-web": "^6.42.2", + "react-instantsearch": "^7.3.0", "react-router-dom": "6.3.0", "recoil": "^0.7.4", "sass": "^1.49.0", diff --git a/apps/boilerplate-front-end/src/App.jsx b/apps/boilerplate-front-end/src/App.jsx index 2f54469b2..97f174659 100755 --- a/apps/boilerplate-front-end/src/App.jsx +++ b/apps/boilerplate-front-end/src/App.jsx @@ -8,7 +8,7 @@ import { mainIndex } from '@/config/algoliaEnvConfig' import { searchClient } from './config/algoliaEnvConfig' // Algolia Instantsearch components -import { InstantSearch } from 'react-instantsearch-hooks-web' +import { InstantSearch } from 'react-instantsearch' // Import Components import Main from './Main' diff --git a/apps/boilerplate-front-end/src/Main.jsx b/apps/boilerplate-front-end/src/Main.jsx index 1521e3c1e..f12b3179b 100755 --- a/apps/boilerplate-front-end/src/Main.jsx +++ b/apps/boilerplate-front-end/src/Main.jsx @@ -8,7 +8,7 @@ import { Configure, useInstantSearch, useSearchBox, -} from 'react-instantsearch-hooks-web' +} from 'react-instantsearch' // Algolia Insights import { InsightsMiddleware } from './config/algoliaInsightEvents' diff --git a/apps/boilerplate-front-end/src/components/algoliaExplain/appliedRules/AppliedRules.jsx b/apps/boilerplate-front-end/src/components/algoliaExplain/appliedRules/AppliedRules.jsx index f87f927a1..e99dfaf30 100755 --- a/apps/boilerplate-front-end/src/components/algoliaExplain/appliedRules/AppliedRules.jsx +++ b/apps/boilerplate-front-end/src/components/algoliaExplain/appliedRules/AppliedRules.jsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' -import { useInstantSearch } from 'react-instantsearch-hooks-web' +import { useInstantSearch } from 'react-instantsearch' import { useRecoilState, useRecoilValue } from 'recoil' diff --git a/apps/boilerplate-front-end/src/components/banners/Banner.jsx b/apps/boilerplate-front-end/src/components/banners/Banner.jsx index d88ed2b39..065e303b4 100755 --- a/apps/boilerplate-front-end/src/components/banners/Banner.jsx +++ b/apps/boilerplate-front-end/src/components/banners/Banner.jsx @@ -2,7 +2,7 @@ // The queryRuleCustomData widget displays custom data from Rules. // You use this widget to display banners or recommendations returned by Rules, and that match search parameters. -import { useQueryRules } from 'react-instantsearch-hooks-web' +import { useQueryRules } from 'react-instantsearch' //SCSS import import './SCSS/banner.scss' diff --git a/apps/boilerplate-front-end/src/components/banners/HomeBanners.jsx b/apps/boilerplate-front-end/src/components/banners/HomeBanners.jsx index 1fe04ea3f..ca28efdb3 100755 --- a/apps/boilerplate-front-end/src/components/banners/HomeBanners.jsx +++ b/apps/boilerplate-front-end/src/components/banners/HomeBanners.jsx @@ -5,7 +5,7 @@ import { useEffect, useState } from 'react' import { useRecoilValue } from 'recoil' // This component will be wrapped in connectQueryRules (https://www.algolia.com/doc/api-reference/widgets/query-rule-custom-data/react/#connector) -import { useQueryRules } from 'react-instantsearch-hooks-web' +import { useQueryRules } from 'react-instantsearch' // Imports from router import { Link } from 'react-router-dom' diff --git a/apps/boilerplate-front-end/src/components/carousels/HomeCarousel.jsx b/apps/boilerplate-front-end/src/components/carousels/HomeCarousel.jsx index 08f5e3abf..2bbe8c34f 100755 --- a/apps/boilerplate-front-end/src/components/carousels/HomeCarousel.jsx +++ b/apps/boilerplate-front-end/src/components/carousels/HomeCarousel.jsx @@ -1,7 +1,7 @@ import { useEffect, useRef, useState } from 'react' import { motion } from 'framer-motion' -import { Configure, Index, useHits } from 'react-instantsearch-hooks-web' +import { Configure, Index, useHits } from 'react-instantsearch' // Recoil import { useRecoilValue, useSetRecoilState } from 'recoil' diff --git a/apps/boilerplate-front-end/src/components/cart/CartModal.jsx b/apps/boilerplate-front-end/src/components/cart/CartModal.jsx index f158a537d..d873db205 100755 --- a/apps/boilerplate-front-end/src/components/cart/CartModal.jsx +++ b/apps/boilerplate-front-end/src/components/cart/CartModal.jsx @@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from 'react' import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' // Algolia imports -import { useHits } from 'react-instantsearch-hooks-web' +import { useHits } from 'react-instantsearch' //Use Translation import { useTranslation } from 'react-i18next' diff --git a/apps/boilerplate-front-end/src/components/facets/Facets.jsx b/apps/boilerplate-front-end/src/components/facets/Facets.jsx index 03ee954a5..24ebad279 100755 --- a/apps/boilerplate-front-end/src/components/facets/Facets.jsx +++ b/apps/boilerplate-front-end/src/components/facets/Facets.jsx @@ -5,7 +5,7 @@ import { DynamicWidgets, useRefinementList, useInstantSearch, -} from 'react-instantsearch-hooks-web' +} from 'react-instantsearch' // Import magnifying glass svg, and price slider component import { ChevronDown, ChevronUp, Glass } from '@/assets/svg/SvgIndex' diff --git a/apps/boilerplate-front-end/src/components/facets/components/ClearRefinement.jsx b/apps/boilerplate-front-end/src/components/facets/components/ClearRefinement.jsx index bea8f517b..bb8a87db6 100755 --- a/apps/boilerplate-front-end/src/components/facets/components/ClearRefinement.jsx +++ b/apps/boilerplate-front-end/src/components/facets/components/ClearRefinement.jsx @@ -2,7 +2,7 @@ import { navigationStateAtom } from '@/config/navigationConfig' import { useEffect } from 'react' -import { useClearRefinements } from 'react-instantsearch-hooks-web' +import { useClearRefinements } from 'react-instantsearch' import { useSearchParams } from 'react-router-dom' import { useRecoilState } from 'recoil' diff --git a/apps/boilerplate-front-end/src/components/facets/components/CurrentRefinement.jsx b/apps/boilerplate-front-end/src/components/facets/components/CurrentRefinement.jsx index ff1532b77..08a77d835 100755 --- a/apps/boilerplate-front-end/src/components/facets/components/CurrentRefinement.jsx +++ b/apps/boilerplate-front-end/src/components/facets/components/CurrentRefinement.jsx @@ -1,5 +1,5 @@ // Component that renders the Current Refinements (icons above the products) -import { useCurrentRefinements } from 'react-instantsearch-hooks-web' +import { useCurrentRefinements } from 'react-instantsearch' // Recoil State import { useRecoilState } from 'recoil' // import config file for state of facets diff --git a/apps/boilerplate-front-end/src/components/facets/components/Hierarchical.jsx b/apps/boilerplate-front-end/src/components/facets/components/Hierarchical.jsx index 51ee11aaf..6050412bf 100755 --- a/apps/boilerplate-front-end/src/components/facets/components/Hierarchical.jsx +++ b/apps/boilerplate-front-end/src/components/facets/components/Hierarchical.jsx @@ -1,5 +1,5 @@ // Renders the Hierarchical facets -import { useHierarchicalMenu } from 'react-instantsearch-hooks-web' +import { useHierarchicalMenu } from 'react-instantsearch' //Use Translation import { useTranslation } from 'react-i18next' diff --git a/apps/boilerplate-front-end/src/components/facets/components/PriceSlider.jsx b/apps/boilerplate-front-end/src/components/facets/components/PriceSlider.jsx index 7afb2fcbc..3843973d8 100755 --- a/apps/boilerplate-front-end/src/components/facets/components/PriceSlider.jsx +++ b/apps/boilerplate-front-end/src/components/facets/components/PriceSlider.jsx @@ -7,7 +7,7 @@ import { useRecoilState } from 'recoil' import Slider from 'rc-slider' import 'rc-slider/assets/index.css' // Import the range function from IS hook -import { useRange } from 'react-instantsearch-hooks-web' +import { useRange } from 'react-instantsearch' // import Currency from recoil import { currencySymbolAtom } from '@/config/currencyConfig' import { showNetworkErorrs } from '@/config/demoGuideConfig' diff --git a/apps/boilerplate-front-end/src/components/federatedSearch/FederatedSearch.jsx b/apps/boilerplate-front-end/src/components/federatedSearch/FederatedSearch.jsx index 612cba705..01275741a 100755 --- a/apps/boilerplate-front-end/src/components/federatedSearch/FederatedSearch.jsx +++ b/apps/boilerplate-front-end/src/components/federatedSearch/FederatedSearch.jsx @@ -1,7 +1,7 @@ import { memo, useEffect, useState } from 'react' // Algolias's import -import { Configure, Index } from 'react-instantsearch-hooks-web' +import { Configure, Index } from 'react-instantsearch' // framer motion import { motion } from 'framer-motion' @@ -60,7 +60,7 @@ import RecentSearches from './components/RecentSearches' //Import scope SCSS import './SCSS/federatedSearch.scss' -import { useSearchBox } from 'react-instantsearch-hooks-web' +import { useSearchBox } from 'react-instantsearch' import QueryCat from './components/QueryCat' const FederatedSearch = ({ query, refine, results }) => { diff --git a/apps/boilerplate-front-end/src/components/federatedSearch/components/BlogPost.jsx b/apps/boilerplate-front-end/src/components/federatedSearch/components/BlogPost.jsx index c2d6c3969..b37a0e4e1 100755 --- a/apps/boilerplate-front-end/src/components/federatedSearch/components/BlogPost.jsx +++ b/apps/boilerplate-front-end/src/components/federatedSearch/components/BlogPost.jsx @@ -2,7 +2,7 @@ import { memo } from 'react' // Algolia -import { useHits } from 'react-instantsearch-hooks-web' +import { useHits } from 'react-instantsearch' import { useRecoilValue } from 'recoil' diff --git a/apps/boilerplate-front-end/src/components/federatedSearch/components/Category.jsx b/apps/boilerplate-front-end/src/components/federatedSearch/components/Category.jsx index 3702460f9..f6b58fc73 100755 --- a/apps/boilerplate-front-end/src/components/federatedSearch/components/Category.jsx +++ b/apps/boilerplate-front-end/src/components/federatedSearch/components/Category.jsx @@ -4,7 +4,7 @@ import { memo } from 'react' import { useNavigate } from 'react-router-dom' // Algolia's imports -import { useRefinementList } from 'react-instantsearch-hooks-web' +import { useRefinementList } from 'react-instantsearch' // component import import { ChevronRight } from '@/assets/svg/SvgIndex' diff --git a/apps/boilerplate-front-end/src/components/federatedSearch/components/Products.jsx b/apps/boilerplate-front-end/src/components/federatedSearch/components/Products.jsx index 522d87aed..62a35e7a0 100755 --- a/apps/boilerplate-front-end/src/components/federatedSearch/components/Products.jsx +++ b/apps/boilerplate-front-end/src/components/federatedSearch/components/Products.jsx @@ -1,7 +1,7 @@ import { memo } from 'react' // Algolia's imports -import { Highlight, useHits } from 'react-instantsearch-hooks-web' +import { Highlight, useHits } from 'react-instantsearch' // Component import import { ChevronRight } from '@/assets/svg/SvgIndex' diff --git a/apps/boilerplate-front-end/src/components/federatedSearch/components/QuerySuggestions.jsx b/apps/boilerplate-front-end/src/components/federatedSearch/components/QuerySuggestions.jsx index 27bf1063e..ef587ba5e 100755 --- a/apps/boilerplate-front-end/src/components/federatedSearch/components/QuerySuggestions.jsx +++ b/apps/boilerplate-front-end/src/components/federatedSearch/components/QuerySuggestions.jsx @@ -4,7 +4,7 @@ import { memo, useMemo } from 'react' import { debounce } from 'lodash' // Algolia's imports -import { Highlight, useHits } from 'react-instantsearch-hooks-web' +import { Highlight, useHits } from 'react-instantsearch' // components import import { ChevronRight } from '@/assets/svg/SvgIndex' diff --git a/apps/boilerplate-front-end/src/components/header/components/HeaderMobile.jsx b/apps/boilerplate-front-end/src/components/header/components/HeaderMobile.jsx index 7a8ad3384..78de01a6b 100755 --- a/apps/boilerplate-front-end/src/components/header/components/HeaderMobile.jsx +++ b/apps/boilerplate-front-end/src/components/header/components/HeaderMobile.jsx @@ -40,7 +40,7 @@ import { } from '@/config/featuresConfig' import useOutsideClick from '@/hooks/useOutsideClick' import usePreventScrolling from '@/hooks/usePreventScrolling' -import { useSearchBox } from 'react-instantsearch-hooks-web' +import { useSearchBox } from 'react-instantsearch' const HeaderMobile = ({ mobile, tablet }) => { const { query, refine } = useSearchBox() diff --git a/apps/boilerplate-front-end/src/components/header/components/Navigation.jsx b/apps/boilerplate-front-end/src/components/header/components/Navigation.jsx index c34eae0b9..22fc25094 100755 --- a/apps/boilerplate-front-end/src/components/header/components/Navigation.jsx +++ b/apps/boilerplate-front-end/src/components/header/components/Navigation.jsx @@ -23,7 +23,7 @@ import { useHierarchicalMenu, useRefinementList, useSearchBox, -} from 'react-instantsearch-hooks-web' +} from 'react-instantsearch' import { localSearchQueryAtom } from '@/config/searchboxConfig' import ConditionalWrapper from '@/utils/ConditionalWrapper' diff --git a/apps/boilerplate-front-end/src/components/hits/Hit.jsx b/apps/boilerplate-front-end/src/components/hits/Hit.jsx index 368ba6802..e3076e76c 100755 --- a/apps/boilerplate-front-end/src/components/hits/Hit.jsx +++ b/apps/boilerplate-front-end/src/components/hits/Hit.jsx @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react' // Import framer-motion for animation on hits import { AnimatePresence, motion } from 'framer-motion' -import { Highlight } from 'react-instantsearch-hooks-web' +import { Highlight } from 'react-instantsearch' // Import SVGs import { CartPicto, Heart, InfoPicto } from '@/assets/svg/SvgIndex' import RankingIcon from './components/RankingIcon' diff --git a/apps/boilerplate-front-end/src/components/hits/components/injected-hits/InjectedHits.jsx b/apps/boilerplate-front-end/src/components/hits/components/injected-hits/InjectedHits.jsx index abeff7fb7..ec2bd75c1 100755 --- a/apps/boilerplate-front-end/src/components/hits/components/injected-hits/InjectedHits.jsx +++ b/apps/boilerplate-front-end/src/components/hits/components/injected-hits/InjectedHits.jsx @@ -11,7 +11,7 @@ import { useInstantSearch, useQueryRules, useSearchBox, -} from 'react-instantsearch-hooks-web' +} from 'react-instantsearch' // Components import CustomSkeleton from '@/components/skeletons/CustomSkeleton' diff --git a/apps/boilerplate-front-end/src/components/landingPage/LandingPageHeader.jsx b/apps/boilerplate-front-end/src/components/landingPage/LandingPageHeader.jsx index 4ca38f69e..9719d4173 100755 --- a/apps/boilerplate-front-end/src/components/landingPage/LandingPageHeader.jsx +++ b/apps/boilerplate-front-end/src/components/landingPage/LandingPageHeader.jsx @@ -3,7 +3,7 @@ // The queryRuleCustomData widget displays custom data from Rules. // You use this widget to display banners or recommendations returned by Rules, and that match search parameters. // You can find the expected rule response by looking at Landing Pages in the Readme -import { useQueryRules } from 'react-instantsearch-hooks-web' +import { useQueryRules } from 'react-instantsearch' // SCSS import import './SCSS/landing-page-header.scss' diff --git a/apps/boilerplate-front-end/src/components/noResults/noResults.jsx b/apps/boilerplate-front-end/src/components/noResults/noResults.jsx index 3dab080e9..53788c0a7 100755 --- a/apps/boilerplate-front-end/src/components/noResults/noResults.jsx +++ b/apps/boilerplate-front-end/src/components/noResults/noResults.jsx @@ -1,5 +1,5 @@ // import IS hook -import { Configure, Index, useSearchBox } from 'react-instantsearch-hooks-web' +import { Configure, Index, useSearchBox } from 'react-instantsearch' // Import recoil function import { useRecoilValue } from 'recoil' diff --git a/apps/boilerplate-front-end/src/components/recommend/fbtItems/FbtProducts.jsx b/apps/boilerplate-front-end/src/components/recommend/fbtItems/FbtProducts.jsx index 87b206d4c..2bd766c6b 100755 --- a/apps/boilerplate-front-end/src/components/recommend/fbtItems/FbtProducts.jsx +++ b/apps/boilerplate-front-end/src/components/recommend/fbtItems/FbtProducts.jsx @@ -4,7 +4,7 @@ import { hitsConfig } from '@/config/hitsConfig' // Import highlight widget from InstantSearch library -import { Highlight } from 'react-instantsearch-hooks-web' +import { Highlight } from 'react-instantsearch' // Import heart svg import { CartPicto, Heart, PlusPicto } from '@/assets/svg/SvgIndex' diff --git a/apps/boilerplate-front-end/src/components/recommend/relatedItems/RelatedProducts.jsx b/apps/boilerplate-front-end/src/components/recommend/relatedItems/RelatedProducts.jsx index bac8157c2..d98c32de2 100755 --- a/apps/boilerplate-front-end/src/components/recommend/relatedItems/RelatedProducts.jsx +++ b/apps/boilerplate-front-end/src/components/recommend/relatedItems/RelatedProducts.jsx @@ -4,7 +4,7 @@ import { hitsConfig } from '@/config/hitsConfig' // Import highlight widget from InstantSearch library -import { Highlight } from 'react-instantsearch-hooks-web' +import { Highlight } from 'react-instantsearch' // Import heart svg import { CartPicto, Heart } from '@/assets/svg/SvgIndex' diff --git a/apps/boilerplate-front-end/src/components/recommend/trending/TrendingFacetValues.jsx b/apps/boilerplate-front-end/src/components/recommend/trending/TrendingFacetValues.jsx index 471ead836..1218bb67f 100755 --- a/apps/boilerplate-front-end/src/components/recommend/trending/TrendingFacetValues.jsx +++ b/apps/boilerplate-front-end/src/components/recommend/trending/TrendingFacetValues.jsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react' import { useTrendingFacets } from '@algolia/recommend-react' -import { useRefinementList } from 'react-instantsearch-hooks-web' +import { useRefinementList } from 'react-instantsearch' import { useRecoilState, useRecoilValue } from 'recoil' diff --git a/apps/boilerplate-front-end/src/components/redirects/Redirect.jsx b/apps/boilerplate-front-end/src/components/redirects/Redirect.jsx index df4464a30..0f6f5e552 100755 --- a/apps/boilerplate-front-end/src/components/redirects/Redirect.jsx +++ b/apps/boilerplate-front-end/src/components/redirects/Redirect.jsx @@ -1,7 +1,7 @@ import { memo, useEffect, useState } from 'react' //Algolia's import -import { useQueryRules } from 'react-instantsearch-hooks-web' +import { useQueryRules } from 'react-instantsearch' // Import Recoil import { useRecoilState } from 'recoil' diff --git a/apps/boilerplate-front-end/src/components/searchbox/SearchBox.jsx b/apps/boilerplate-front-end/src/components/searchbox/SearchBox.jsx index 9a3b08d29..3bcb1b2ed 100755 --- a/apps/boilerplate-front-end/src/components/searchbox/SearchBox.jsx +++ b/apps/boilerplate-front-end/src/components/searchbox/SearchBox.jsx @@ -34,7 +34,7 @@ import useStoreQueryToLocalStorage from '@/hooks/useStoreStringToLocalStorage' //Import scope SCSS import './SCSS/searchbox.scss' -import { useSearchBox } from 'react-instantsearch-hooks-web' +import { useSearchBox } from 'react-instantsearch' import { useSearchParams } from 'react-router-dom' diff --git a/apps/boilerplate-front-end/src/components/searchbox/components/SearchInCategory.jsx b/apps/boilerplate-front-end/src/components/searchbox/components/SearchInCategory.jsx index ae22efe06..69267ec78 100755 --- a/apps/boilerplate-front-end/src/components/searchbox/components/SearchInCategory.jsx +++ b/apps/boilerplate-front-end/src/components/searchbox/components/SearchInCategory.jsx @@ -14,7 +14,7 @@ import { useRecoilState } from 'recoil' import { useHierarchicalMenu, useRefinementList, -} from 'react-instantsearch-hooks-web' +} from 'react-instantsearch' // React router import { useSearchParams } from 'react-router-dom' diff --git a/apps/boilerplate-front-end/src/components/sortBy/SortBy.jsx b/apps/boilerplate-front-end/src/components/sortBy/SortBy.jsx index 227700c97..223b80f26 100755 --- a/apps/boilerplate-front-end/src/components/sortBy/SortBy.jsx +++ b/apps/boilerplate-front-end/src/components/sortBy/SortBy.jsx @@ -1,5 +1,5 @@ // This is for displaying the SortBy widget, eg Price asc/desc -import { useSortBy } from 'react-instantsearch-hooks-web' +import { useSortBy } from 'react-instantsearch' import './sortby.scss' function CustomSortBy(props) { diff --git a/apps/boilerplate-front-end/src/components/stats/Stats.jsx b/apps/boilerplate-front-end/src/components/stats/Stats.jsx index c4147bdef..5101b49cf 100755 --- a/apps/boilerplate-front-end/src/components/stats/Stats.jsx +++ b/apps/boilerplate-front-end/src/components/stats/Stats.jsx @@ -1,6 +1,6 @@ // This is for building the stats info that is displayed above the items in the search results page import connectStats from 'instantsearch.js/es/connectors/stats/connectStats' -import { useConnector } from 'react-instantsearch-hooks-web' +import { useConnector } from 'react-instantsearch' //Use Translation import { useTranslation } from 'react-i18next' diff --git a/apps/boilerplate-front-end/src/components/voicesearch/VoiceSearch.jsx b/apps/boilerplate-front-end/src/components/voicesearch/VoiceSearch.jsx index 4ab119d23..a0fd4f2d2 100755 --- a/apps/boilerplate-front-end/src/components/voicesearch/VoiceSearch.jsx +++ b/apps/boilerplate-front-end/src/components/voicesearch/VoiceSearch.jsx @@ -5,7 +5,7 @@ import { createSearchParams, useLocation, useNavigate } from 'react-router-dom' import { useSetRecoilState } from 'recoil' import connectVoiceSearch from 'instantsearch.js/es/connectors/voice-search/connectVoiceSearch' -import { useConnector, useSearchBox } from 'react-instantsearch-hooks-web' +import { useConnector, useSearchBox } from 'react-instantsearch' // Import searchbox Config import { searchBoxIsActive } from '@/config/searchboxConfig' diff --git a/apps/boilerplate-front-end/src/config/algoliaInsightEvents.js b/apps/boilerplate-front-end/src/config/algoliaInsightEvents.js index 54c64adf2..5f46cf70a 100755 --- a/apps/boilerplate-front-end/src/config/algoliaInsightEvents.js +++ b/apps/boilerplate-front-end/src/config/algoliaInsightEvents.js @@ -4,10 +4,10 @@ import { personaObjectSelectedAtom } from './personaConfig' import aa from 'search-insights' import { createInsightsMiddleware } from 'instantsearch.js/es/middlewares' import { useLayoutEffect } from 'react' -import { useInstantSearch } from 'react-instantsearch-hooks-web' +import { useInstantSearch } from 'react-instantsearch' export function InsightsMiddleware() { - const { use } = useInstantSearch() + const { addMiddlewares } = useInstantSearch() const persona = useRecoilValue(personaObjectSelectedAtom) useLayoutEffect(() => { @@ -22,8 +22,8 @@ export function InsightsMiddleware() { // and attaches the `userToken` to search calls onwards. aa('setUserToken', userToken) - return use(middleware) - }, [use]) + return addMiddlewares(middleware) + }, [addMiddlewares]) return null } diff --git a/apps/boilerplate-front-end/src/pages/searchResultsPage/SearchResultsPage.jsx b/apps/boilerplate-front-end/src/pages/searchResultsPage/SearchResultsPage.jsx index a405b2ecc..6f6c1c86a 100755 --- a/apps/boilerplate-front-end/src/pages/searchResultsPage/SearchResultsPage.jsx +++ b/apps/boilerplate-front-end/src/pages/searchResultsPage/SearchResultsPage.jsx @@ -9,7 +9,7 @@ import { useInstantSearch, useHierarchicalMenu, useRefinementList, -} from 'react-instantsearch-hooks-web' +} from 'react-instantsearch' //import react router import { useSearchParams } from 'react-router-dom' diff --git a/apps/boilerplate-front-end/src/utils/ErrorHandler.jsx b/apps/boilerplate-front-end/src/utils/ErrorHandler.jsx index 156fede07..d7c7448fd 100755 --- a/apps/boilerplate-front-end/src/utils/ErrorHandler.jsx +++ b/apps/boilerplate-front-end/src/utils/ErrorHandler.jsx @@ -1,10 +1,10 @@ import React, { useEffect, useState } from 'react' import CustomModal from '@/components/modals/CustomModal' -import { useInstantSearch } from 'react-instantsearch-hooks-web' +import { useInstantSearch } from 'react-instantsearch' // This component listens for instantSearch API errors and logs them in a modal function SearchErrorToast() { - const { use } = useInstantSearch() + const { addMiddlewares } = useInstantSearch() const [error, setError] = useState(null) const [modalActive, setModalActive] = useState(false) @@ -24,8 +24,8 @@ function SearchErrorToast() { } } - return use(middleware) - }, [use]) + return addMiddlewares(middleware) + }, [addMiddlewares]) useEffect(() => { ;(function (open) {