-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(docs): Update "Adding Search with Algolia" guide #29460
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added memoization to example to avoid re-creating the Algolia search client unnecessarily, which impacts performance
gatsbot
bot
added
the
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
label
Feb 11, 2021
vladar
added
type: documentation
An issue or pull request for improving or updating Gatsby's documentation
and removed
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
labels
Feb 12, 2021
LekoArts
changed the title
Updated "Adding Search with Algolia" guide
chore(docs): Update "Adding Search with Algolia" guide
May 6, 2021
LekoArts
approved these changes
May 6, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
moonmeister
added a commit
to moonmeister/gatsby
that referenced
this pull request
May 7, 2021
* master: (45 commits) chore(release): Publish next pre-minor fix(gatsby-source-shopify): fix linting (gatsbyjs#31291) fix(deps): update minor and patch for gatsby-plugin-preact (gatsbyjs#31169) chore: add gatsby-plugin-gatsby-cloud to renovate chore: update renovatebot config to support more packages (gatsbyjs#31289) chore(deps): update dependency @types/semver to ^7.3.5 (gatsbyjs#31148) fix(deps): update minor and patch for gatsby-plugin-manifest (gatsbyjs#31160) fix(deps): update minor and patch for gatsby-remark-copy-linked-files (gatsbyjs#31163) fix(deps): update dependency mini-css-extract-plugin to v1.6.0 (gatsbyjs#31158) chore(deps): update dependency @testing-library/react to ^11.2.6 (gatsbyjs#31168) docs(gatsby-source-shopify): Updates Shopify README with new plugin info (gatsbyjs#31287) chore: run yarn deduplicate (gatsbyjs#31285) docs(gatsby-plugin-image): Add docs for customizing default options (gatsbyjs#30344) fix(gatsby-plugin-image): print error details (gatsbyjs#30417) chore(docs): Update "Adding Search with Algolia" guide (gatsbyjs#29460) chore(docs): Update MDX frontmatter for programmatic pages (gatsbyjs#29798) docs: Add image plugin architecture doc (gatsbyjs#31096) perf(gatsby): use fastq instead of better-queue + refactor (gatsbyjs#31269) feat(gatsby-plugin-image): Export ImageDataLike type (gatsbyjs#30590) fix(gatsby): update plugin api types (gatsbyjs#30819) ...
axe312ger
pushed a commit
that referenced
this pull request
May 20, 2021
Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
This was referenced Mar 13, 2022
This was referenced Mar 14, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
type: documentation
An issue or pull request for improving or updating Gatsby's documentation
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.
Added memoization to example to avoid re-creating the Algolia search client unnecessarily, which impacts performance
Description
In the existing example, it will recreate the Algolia search client every time the user types in the search box (as the query changes, causing the Search component to be re-rendered, which creates a new instance of the search client). This change adds memoization to the example, so that the search client is not re-created on every re-render. This is important for performance, as with the existing implementation, you would notice that every keystroke would cause two requests to be sent to Algolia, and any caching is destroyed by the fact that the client is constantly re-created. Since performance is important to Gatsby, this change to the example ensures that the search performs well when following this guide.