Skip to content

Commit

Permalink
docs(examples): update react examples (#1260)
Browse files Browse the repository at this point in the history
* docs(examples): update react examples

- react instantsearch hooks -> react instantsearch (changed dependency, used react 18)
- react 18 -> react
- react -> react 17

* update ignore

* fix urls
  • Loading branch information
Haroenv authored Jun 27, 2024
1 parent d0b3b27 commit 0bbaf6c
Show file tree
Hide file tree
Showing 61 changed files with 133 additions and 698 deletions.
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ dist
node_modules
examples/twitter-compose-with-typeahead
examples/slack-with-emojis-and-commands
examples/react-instantsearch-hooks
examples/react-instantsearch
examples/vue-instantsearch
examples/react-18
examples/react
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ dist/

# Environment files
.env

!examples/*/.env
File renamed without changes.
1 change: 1 addition & 0 deletions examples/react-17/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/autocomplete-example-react-renderer",
"description": "Autocomplete example with React Renderer",
"name": "@algolia/autocomplete-example-react-17",
"description": "Autocomplete example with React 17",
"version": "1.17.2",
"private": true,
"dependencies": {
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

<title>React Renderer | Autocomplete</title>
<title>React 17 | Autocomplete</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 0 additions & 34 deletions examples/react-instantsearch-hooks/README.md

This file was deleted.

Binary file removed examples/react-instantsearch-hooks/capture.png
Binary file not shown.
22 changes: 0 additions & 22 deletions examples/react-instantsearch-hooks/index.html

This file was deleted.

34 changes: 0 additions & 34 deletions examples/react-instantsearch-hooks/package.json

This file was deleted.

113 changes: 0 additions & 113 deletions examples/react-instantsearch-hooks/src/App.css

This file was deleted.

11 changes: 0 additions & 11 deletions examples/react-instantsearch-hooks/src/main.tsx

This file was deleted.

File renamed without changes.
8 changes: 4 additions & 4 deletions examples/react-instantsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ git clone [email protected]:algolia/autocomplete.git

```sh
yarn
yarn workspace @algolia/autocomplete-example-react-instantsearch start
yarn workspace @algolia/autocomplete-example-react-instantsearch-hooks dev
```

Alternatively, you may use npm:

```sh
cd examples/react-instantsearch
cd examples/react-instantsearch-hooks
npm install
npm start
npm run dev
```

Open <http://localhost:1234> to see your app.
Open <http://localhost:3000> to see your app.
25 changes: 10 additions & 15 deletions examples/react-instantsearch/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />

<link rel="shortcut icon" href="favicon.png" />
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" type="image/x-icon" href="/src/favicon.png" />
<title>React InstantSearch | Autocomplete</title>
<!--
Do not use @7 in production, use a complete version like x.x.x, see website for latest version:
https://www.algolia.com/doc/guides/building-search-ui/installation/react/#load-the-style
-->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/satellite-min.css"
/>

<title>Autocomplete with React InstantSearch</title>
</head>

<body>
<noscript> You need to enable JavaScript to run this app. </noscript>

<div id="root"></div>

<script type="module" src="./src/index.js"></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
26 changes: 17 additions & 9 deletions examples/react-instantsearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,30 @@
"private": true,
"license": "MIT",
"scripts": {
"build": "parcel build index.html",
"start": "parcel index.html"
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@algolia/autocomplete-js": "1.17.2",
"@algolia/autocomplete-plugin-query-suggestions": "1.17.2",
"@algolia/autocomplete-plugin-recent-searches": "1.17.2",
"@algolia/autocomplete-theme-classic": "1.17.2",
"algoliasearch": "4.16.0",
"qs": "6.11.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-instantsearch-dom": "6.39.1"
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-instantsearch": "7.11.3"
},
"devDependencies": {
"@babel/core": "7.21.4",
"parcel": "2.8.3"
}
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@vitejs/plugin-react": "1.0.7",
"typescript": "4.5.4",
"vite": "2.8.0"
},
"keywords": [
"algolia",
"autocomplete",
"react"
]
}
Loading

0 comments on commit 0bbaf6c

Please sign in to comment.