This repository has been archived by the owner on Dec 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server-side rendering): Add API features for server-side rendering
+ guide + examples
- Loading branch information
Showing
43 changed files
with
1,246 additions
and
23 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
extends archetypes/content-with-menu.pug | ||
|
||
include mixins/nav.pug | ||
|
||
block navigation | ||
+nav(navPath, navigation, mainTitle || title, withHeadings && headings || []) | ||
|
||
block content | ||
h2#description Description | ||
a.anchor(href=`${navPath}#description`) | ||
div!=h.markdown(description) | ||
h2#proptypes Params | ||
a.anchor(href=`${navPath}#proptypes`) | ||
if params | ||
table.api.params | ||
tbody | ||
each type in params | ||
tr.api-entry-values | ||
td.api-entry-name | ||
div.api-entry(id=`default-props-entry-${name}-${type.name}`) | ||
=`${type.name}${type.isRequired ? '*' : ''}` | ||
a.anchor(href=`${navPath}#default-props-entry-${name}-${type.name}`) | ||
td.api-entry-type | ||
span type: | ||
= ' ' | ||
code=type.type.names | ||
td.api-entry-default-value | ||
if type.defaultValue | ||
span default: | ||
= ' ' | ||
code=type.defaultValue | ||
else | ||
span | ||
tr.api-entry-description | ||
td(colspan=3)!=h.markdown(type.description) | ||
else | ||
p This function has no params. | ||
h2#proptypes Returns | ||
a.anchor(href=`${navPath}#proptypes`) | ||
if returns | ||
table.api.returns | ||
tbody | ||
each type in returns | ||
tr.api-entry-values | ||
td.api-entry-type | ||
span type: | ||
= ' ' | ||
code=type.type.names | ||
tr.api-entry-description | ||
td(colspan=3)!=h.markdown(type.description) | ||
else | ||
p This function returns nothing. | ||
if requirements | ||
h2#requirements Requirements | ||
a.anchor(href=`${navPath}#requirements`) | ||
div!=h.markdown(requirements) | ||
if operations | ||
h2#operations Operations | ||
a.anchor(href=`${navPath}#operations`) | ||
div!=h.markdown(operations) | ||
if examples | ||
h2#example Example usage | ||
a.anchor(href=`${navPath}#example`) | ||
each example in examples | ||
p!=h.highlight(example, {lang: 'jsx'}) | ||
|
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
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: Server Side Rendering | ||
layout: main.pug | ||
category: server-side-rendering | ||
showInNav: false | ||
--- | ||
|
||
|
||
When using server side rendering, instead of having your browser download a minimal HTML page that JavaScript will fill, the initial content is generated on the server. Then, the browser will download a page with the HTML content already in place. | ||
|
||
Usually server side rendering is considered to improve SEO and performances. | ||
|
||
The [Server-side rendering guide](guide/Server-side_rendering.html) explains in details how you can use Server Side Rendering with React InstantSearch. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
/dist | ||
/.next | ||
|
||
# misc | ||
.DS_Store | ||
.env | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
This example shows how to do server side rendering with next.js and React InstantSearch | ||
|
||
To start the example: | ||
|
||
```sh | ||
yarn install --no-lockfile | ||
yarn run dev | ||
``` | ||
|
||
Read more about `react-instantsearch` [in our documentation](https://community.algolia.com/react-instantsearch/). |
Oops, something went wrong.