chore: update to beta of react-instantsearch-dom (#36843)

* chore: update to beta of react-instantsearch-dom

* feat: use .env variables for search keys
This commit is contained in:
Oliver Eyton-Williams
2019-10-04 18:03:20 +02:00
committed by GitHub
parent 203ca92a20
commit 1130a1c0df
5 changed files with 60 additions and 39 deletions

View File

@ -2135,6 +2135,11 @@
}
}
},
"@types/algoliasearch": {
"version": "3.34.2",
"resolved": "https://registry.npmjs.org/@types/algoliasearch/-/algoliasearch-3.34.2.tgz",
"integrity": "sha512-a+ztY3iL+Dpor7wYaF4CO6obUYcVEyXue1ppQklP1VCUP+VGZyzMcYiZodNs9DFV1HEOW5VCLTIqiZ4ikQpKzA=="
},
"@types/anymatch": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz",
@ -2759,13 +2764,11 @@
}
},
"algoliasearch-helper": {
"version": "2.28.0",
"resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-2.28.0.tgz",
"integrity": "sha512-ZWczpkns2tw9sAtFL+1Cn3XAGkaunYS+ckldBrHHHQZj1/vw9n8SOGUO7lwpjuKXG9+TWgzx6XP3ZsG3iM+6hw==",
"version": "0.0.0-27095c0",
"resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-0.0.0-27095c0.tgz",
"integrity": "sha512-d0wlSReMpnz7sT5ibojXucYsWHTigu83ge+qktQ9m0u+kG7bHqRErzBUOZ03BMr9zd1sWSNR1TMR9l6AHHrqow==",
"requires": {
"events": "^1.1.1",
"lodash": "^4.17.5",
"qs": "^6.5.1"
"events": "^1.1.1"
}
},
"alphanum-sort": {
@ -9723,9 +9726,9 @@
"integrity": "sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ=="
},
"handlebars": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz",
"integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.1.tgz",
"integrity": "sha512-c0HoNHzDiHpBt4Kqe99N8tdLPKAnGCQ73gYMPWtAYM4PwGnf7xl8PBUHJqh9ijlzt2uQKaSRxbXRt+rZ7M2/kA==",
"dev": true,
"requires": {
"neo-async": "^2.6.0",
@ -16609,57 +16612,64 @@
"integrity": "sha512-r+nCigLoQMffpf8gZo6l0we8RaRkgEIeRY6xS1vjp5ANxdTd3QwA2tjBTfmgf+4kFqYnaL2XvJH+iZ4mKqnb8Q=="
},
"react-instantsearch-core": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/react-instantsearch-core/-/react-instantsearch-core-5.7.0.tgz",
"integrity": "sha512-fjexlv+hR8OyZraAmjwM+GmiVcJFzLUnufIKPMLO7/L4Mg5h0pETSXNBT22cCXTnda6XML//+GqQmWJFf+PBrA==",
"version": "6.0.0-beta.0",
"resolved": "https://registry.npmjs.org/react-instantsearch-core/-/react-instantsearch-core-6.0.0-beta.0.tgz",
"integrity": "sha512-Fp8x564WJaTvC4e6JiueHRIVTCyCO7l+5F3RhHxmn9UKjzGhgWEok5159jEV3LlrtfINYUMAiLWslPw5o7u9Hg==",
"requires": {
"@babel/runtime": "^7.1.2",
"algoliasearch-helper": "^2.26.0",
"lodash": "^4.17.4",
"@types/algoliasearch": "^3.30.16",
"algoliasearch-helper": "0.0.0-6ac260d",
"fast-deep-equal": "^2.0.1",
"prop-types": "^15.5.10"
},
"dependencies": {
"@babel/runtime": {
"version": "7.4.5",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz",
"integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==",
"version": "7.6.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.6.2.tgz",
"integrity": "sha512-EXxN64agfUqqIGeEjI5dL5z0Sw0ZwWo1mLTi4mQowCZ42O59b7DRpZAnTC6OqdF28wMBMFKNb/4uFGrVaigSpg==",
"requires": {
"regenerator-runtime": "^0.13.2"
}
},
"algoliasearch-helper": {
"version": "0.0.0-6ac260d",
"resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-0.0.0-6ac260d.tgz",
"integrity": "sha512-wG1oVPEq4bXmNUeF2voio+0UpNRtDLTG7+OPCvTxMDIQvD2Exc0s2UsWl5fh6/Dc7O++b8Ic2g+YSVo5l+nBFg==",
"requires": {
"events": "^1.1.1"
}
},
"regenerator-runtime": {
"version": "0.13.2",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz",
"integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA=="
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz",
"integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw=="
}
}
},
"react-instantsearch-dom": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/react-instantsearch-dom/-/react-instantsearch-dom-5.7.0.tgz",
"integrity": "sha512-FwFZZXwgaYtLrXD9KJNlrPVkfw8JOqVgpDBvra547udF4zbacZUuX7/qTyMHjVW/Lz59t5T25vCGLzmQiO89YA==",
"version": "6.0.0-beta.0",
"resolved": "https://registry.npmjs.org/react-instantsearch-dom/-/react-instantsearch-dom-6.0.0-beta.0.tgz",
"integrity": "sha512-jOHYTHTOc+QWMhC8XPDjR0tKw9uySSMvkeo0hOAUvZihals6pk+b34cBKE08btfxZzwpxkidrWSUJMlrbV9geQ==",
"requires": {
"@babel/runtime": "^7.1.2",
"algoliasearch": "^3.27.1",
"algoliasearch-helper": "^2.26.0",
"algoliasearch-helper": "0.0.0-27095c0",
"classnames": "^2.2.5",
"lodash": "^4.17.4",
"prop-types": "^15.5.10",
"react-instantsearch-core": "^5.7.0"
"react-instantsearch-core": "^6.0.0-beta.0"
},
"dependencies": {
"@babel/runtime": {
"version": "7.4.5",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz",
"integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==",
"version": "7.6.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.6.2.tgz",
"integrity": "sha512-EXxN64agfUqqIGeEjI5dL5z0Sw0ZwWo1mLTi4mQowCZ42O59b7DRpZAnTC6OqdF28wMBMFKNb/4uFGrVaigSpg==",
"requires": {
"regenerator-runtime": "^0.13.2"
}
},
"regenerator-runtime": {
"version": "0.13.2",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz",
"integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA=="
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz",
"integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw=="
}
}
},

View File

@ -55,7 +55,7 @@
"react-helmet": "^5.2.1",
"react-hotkeys": "^2.0.0",
"react-identicons": "^1.1.7",
"react-instantsearch-dom": "^5.7.0",
"react-instantsearch-dom": "^6.0.0-beta.0",
"react-monaco-editor": "^0.30.1",
"react-redux": "^5.0.7",
"react-reflex": "^3.0.16",

View File

@ -6,6 +6,7 @@ import { InstantSearch, Configure } from 'react-instantsearch-dom';
import qs from 'query-string';
import { navigate } from 'gatsby';
import Media from 'react-responsive';
import algoliasearch from 'algoliasearch/lite';
import {
isSearchDropdownEnabledSelector,
@ -13,11 +14,14 @@ import {
toggleSearchDropdown,
updateSearchQuery
} from './redux';
import { algoliaAppId, algoliaAPIKey } from '../../../config/env.json';
import { createSelector } from 'reselect';
const DEBOUNCE_TIME = 100;
const searchClient = algoliasearch(algoliaAppId, algoliaAPIKey);
const propTypes = {
children: PropTypes.any,
isDropdownEnabled: PropTypes.bool,
@ -120,10 +124,9 @@ class InstantSearchRoot extends Component {
const MAX_MOBILE_HEIGHT = 768;
return (
<InstantSearch
apiKey='4318af87aa3ce128708f1153556c6108'
appId='QMJYL5WYTI'
indexName='news'
onSearchStateChange={this.onSearchStateChange}
searchClient={searchClient}
searchState={{ query }}
>
{this.isSearchPage() ? (

View File

@ -11,7 +11,9 @@ const {
FORUM_LOCATION: forum,
NEWS_LOCATION: news,
LOCALE: locale,
STRIPE_PUBLIC: stripePublicKey
STRIPE_PUBLIC: stripePublicKey,
ALGOLIA_APP_ID: algoliaAppId,
ALGOLIA_API_KEY: algoliaAPIKey
} = process.env;
const locations = {
@ -21,4 +23,9 @@ const locations = {
newsLocation: news
};
module.exports = Object.assign(locations, { locale, stripePublicKey });
module.exports = Object.assign(locations, {
locale,
stripePublicKey,
algoliaAppId,
algoliaAPIKey
});

View File

@ -6,6 +6,7 @@ ROLLBAR_CLIENT_ID='post_client_id from rollbar dashboard'
ALGOLIA_ADMIN_KEY=123abc
ALGOLIA_APP_ID=ACDEFG
ALGOLIA_API_KEY=123abc
AUTH0_CLIENT_ID=stuff
AUTH0_CLIENT_SECRET=stuff