Skip to content

Commit fa59039

Browse files
Matthew Sweeneytimothyis
authored andcommitted
Revert "Automatic prerendering (#1232)" (#1256)
This reverts commit f0ea0ea.
1 parent f0ea0ea commit fa59039

File tree

25 files changed

+309
-1309
lines changed

25 files changed

+309
-1309
lines changed

components/code/inline-code.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const literal = '`'
2-
31
const InlineCode = ({ children, noWrap, color }) => (
42
<code className={noWrap && 'no-wrap'}>
53
{children}
@@ -19,11 +17,11 @@ const InlineCode = ({ children, noWrap, color }) => (
1917
}
2018
2119
code::before {
22-
content: '${literal}';
20+
content: '\`';
2321
}
2422
2523
code::after {
26-
content: '${literal}';
24+
content: '\`';
2725
}
2826
`}
2927
</style>

components/feedback-input/header-feedback.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ class HeaderFeedback extends Component {
232232
const { focused } = this.state
233233
delete props.onFeedback
234234
delete props.textAreaStyle
235-
delete props.hideHeader
236235

237236
return (
238237
<ClickOutside

components/footer/index.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@ const Footer = ({ className }) => {
1515
<ul className="navigation">
1616
<li className="links-title">Company</li>
1717
<li className="home">
18-
<Link href="/" as="/home">
18+
<Link prefetch href="/" as="/home">
1919
<a>Home</a>
2020
</Link>
2121
</li>
2222
<li className="about">
23-
<Link href="/about">
23+
<Link prefetch href="/about">
2424
<a>About</a>
2525
</Link>
2626
</li>
2727
<li className="careers">
28-
<Link href="/careers">
28+
<Link prefetch href="/careers">
2929
<a>Careers</a>
3030
</Link>
3131
</li>
3232
<li className="blog">
33-
<Link href="/blog">
33+
<Link prefetch href="/blog">
3434
<a>Blog</a>
3535
</Link>
3636
</li>
3737
<li className="day">
38-
<Link href="/day">
38+
<Link prefetch href="/day">
3939
<a>ZEIT Day</a>
4040
</Link>
4141
</li>
@@ -46,31 +46,31 @@ const Footer = ({ className }) => {
4646
<a href="/download">Download</a>
4747
</li>
4848
<li className="pricing">
49-
<Link href="/pricing">
49+
<Link prefetch href="/pricing">
5050
<a>Pricing</a>
5151
</Link>
5252
<span>{'/'}</span>
53-
<Link href="/pricing/calculator">
53+
<Link prefetch href="/pricing/calculator">
5454
<a>Calculator</a>
5555
</Link>
5656
</li>
5757
<li className="now-for-github">
58-
<Link href="/github">
58+
<Link prefetch href="/github">
5959
<a>Now for GitHub</a>
6060
</Link>
6161
</li>
6262
<li className="now-for-gitlab">
63-
<Link href="/gitlab">
63+
<Link prefetch href="/gitlab">
6464
<a>Now for GitLab</a>
6565
</Link>
6666
</li>
6767
<li>
68-
<Link href="/smart-cdn">
68+
<Link prefetch href="/smart-cdn">
6969
<a>Smart CDN</a>
7070
</Link>
7171
</li>
7272
<li>
73-
<Link href="/integrations">
73+
<Link prefetch href="/integrations">
7474
<a>Integrations Marketplace</a>
7575
</Link>
7676
</li>
@@ -90,31 +90,31 @@ const Footer = ({ className }) => {
9090
<a href="/examples">Examples</a>
9191
</li>
9292
<li className="tv">
93-
<Link href="/tv">
93+
<Link prefetch href="/tv">
9494
<a>TV</a>
9595
</Link>
9696
</li>
9797
</ul>
9898
<ul className="navigation">
9999
<li className="links-title">More</li>
100100
<li className="oss">
101-
<Link href="/oss">
101+
<Link prefetch href="/oss">
102102
<a>Open Source Software</a>
103103
</Link>
104104
</li>
105105
<li className="design">
106-
<Link href="/design">
106+
<Link prefetch href="/design">
107107
<a>Design Assets</a>
108108
</Link>
109109
</li>
110110

111111
<li className="security">
112-
<Link href="/security">
112+
<Link prefetch href="/security">
113113
<a>Security</a>
114114
</Link>
115115
</li>
116116
<li className="support">
117-
<Link href="/support">
117+
<Link prefetch href="/support">
118118
<a>Support</a>
119119
</Link>
120120
</li>
@@ -124,12 +124,12 @@ const Footer = ({ className }) => {
124124
<li className="links-title" />
125125

126126
<li className="privacy">
127-
<Link href="/privacy">
127+
<Link prefetch href="/privacy">
128128
<a>Privacy Policy</a>
129129
</Link>
130130
</li>
131131
<li className="terms">
132-
<Link href="/terms">
132+
<Link prefetch href="/terms">
133133
<a>Terms of Service</a>
134134
</Link>
135135
</li>

components/layout/docs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,21 @@ class withDoc extends React.Component {
168168
!router.pathname.startsWith('/docs/api')
169169
}
170170
>
171-
<Link href="/docs">
171+
<Link prefetch href="/docs">
172172
<a onClick={this.handleIndexClick}>Docs</a>
173173
</Link>
174174
</ToggleItem>
175175
<ToggleItem
176176
active={router.pathname.startsWith('/docs/api')}
177177
>
178-
<Link href="/docs/api">
178+
<Link prefetch href="/docs/api">
179179
<a onClick={this.handleIndexClick}>API Reference</a>
180180
</Link>
181181
</ToggleItem>
182182
<ToggleItem
183183
active={router.pathname.startsWith('/examples')}
184184
>
185-
<Link href="/examples">
185+
<Link prefetch href="/examples">
186186
<a onClick={this.handleIndexClick}>Examples</a>
187187
</Link>
188188
</ToggleItem>

components/layout/index/entry-index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class EntryIndex extends Component {
6565
{entry.title}
6666
</a>
6767
) : (
68-
<Link href={href} as={as}>
68+
<Link href={href} as={as} prefetch>
6969
<a
7070
className={cns({ active: isEntryActive(this.props) })}
7171
onClick={this.handleClick}

components/layout/index/section-index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class SectionIndex extends Component {
8383
{section.title}
8484
</a>
8585
) : (
86-
<Link href={href} as={as}>
86+
<Link href={href} as={as} prefetch>
8787
<a
8888
className={cns('title', { active })}
8989
onClick={this.handleClick}

components/layout/navbar/desktop.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState, useEffect } from 'react'
2-
import Link from 'next/link'
32
import cn from 'classnames'
3+
import { LinkWithHoverPrefetch } from '~/components/text/link'
44
import qs from 'querystring'
55
import { parse } from 'url'
66
import _scrollIntoViewIfNeeded from 'scroll-into-view-if-needed'
@@ -311,9 +311,13 @@ export class NavLink extends React.Component {
311311
{info.name}
312312
</a>
313313
) : (
314-
<Link href={info.href} as={info.as || info.href}>
315-
<a onClick={onClick}>{info.name}</a>
316-
</Link>
314+
<LinkWithHoverPrefetch
315+
href={info.href}
316+
as={info.as || info.href}
317+
onClick={onClick}
318+
>
319+
{info.name}
320+
</LinkWithHoverPrefetch>
317321
)}
318322
<style jsx>{`
319323
div.selected {

components/layout/navbar/toggle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Link from 'next/link'
44

55
const ActivePageButton = withRouter(({ children, router, href }) => {
66
return (
7-
<Link href={href}>
7+
<Link href={href} prefetch>
88
<span className="active-button">
99
{children}
1010
<style jsx>{`

components/search/autocomplete.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class AutoComplete extends Component {
8080
href={`${hit.url}?query=${encodeURIComponent(this.state.value)}${
8181
hit.anchor ? `${hit.anchor}` : ''
8282
}`}
83+
prefetch
8384
>
8485
<a>
8586
<span className="suggestion__title">

components/text/code.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ Code.contextTypes = {
5757
darkBg: PropTypes.bool
5858
}
5959

60-
const literal = '`'
61-
6260
export const InlineCode = ({ children, noWrap, color }) => (
6361
<code className={noWrap && 'no-wrap'}>
6462
{children}
@@ -78,11 +76,11 @@ export const InlineCode = ({ children, noWrap, color }) => (
7876
}
7977
8078
code::before {
81-
content: '${literal}';
79+
content: '\`';
8280
}
8381
8482
code::after {
85-
content: '${literal}';
83+
content: '\`';
8684
}
8785
`}
8886
</style>

0 commit comments

Comments
 (0)