Skip to content

Commit a5d027a

Browse files
Merge branch 'master' into concepts-loaders-1-followup
2 parents aa25ee9 + a498bcc commit a5d027a

File tree

15 files changed

+68
-60
lines changed

15 files changed

+68
-60
lines changed

src/components/Sidebar/Sidebar.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default ({
3232
group = page.group;
3333

3434
return (
35-
<React.Fragment key={`sidebar-item-${index}`}>
35+
<div key={page.url}>
3636
{displayGroup ? <h4 className="sidebar__group">{group}</h4> : null}
3737

3838
<SidebarItem
@@ -42,7 +42,7 @@ export default ({
4242
anchors={page.anchors}
4343
currentPage={currentPage}
4444
/>
45-
</React.Fragment>
45+
</div>
4646
);
4747
})}
4848
</div>

src/components/SidebarItem/SidebarItem.jsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,43 @@ export default class SidebarItem extends React.Component {
1010
};
1111

1212
render() {
13-
let { title, anchors = [] } = this.props;
13+
let {title, anchors = []} = this.props;
1414
let openMod = this.state.open ? `${block}--open` : '';
1515
let disabledMod = anchors.length == 0 ? `${block}--disabled` : '';
1616

1717
return (
18-
<div className={ `${block} ${openMod} ${disabledMod}` }>
19-
{ anchors.length > 0 ? (
18+
<div className={`${block} ${openMod} ${disabledMod}`}>
19+
{anchors.length > 0 ? (
2020
<i
21-
className={ `${block}__toggle icon-chevron-right` }
22-
onClick={ this._toggle.bind(this) } />
21+
className={`${block}__toggle icon-chevron-right`}
22+
onClick={this._toggle.bind(this)} />
2323
) : (
24-
<i className={ `${block}__toggle icon-vertical-bar` } />
24+
<i className={`${block}__toggle icon-vertical-bar`} />
2525
)}
2626

2727
<Link
28-
className={ `${block}__title` }
29-
to={ this.props.url }>
30-
{ title }
28+
key={this.props.url}
29+
className={`${block}__title`}
30+
to={this.props.url}>
31+
{title}
3132
</Link>
3233

33-
{ anchors.length > 0 ? (
34-
<ul className={ `${block}__anchors` }>
34+
{anchors.length > 0 ? (
35+
<ul className={`${block}__anchors`}>
3536
{
3637
anchors.map((anchor, i) => (
3738
<li
38-
key={ `anchor-${title}-${i}` }
39-
className={ `${block}__anchor` }
40-
title={ anchor.title }>
41-
<a href={ this._generateAnchorURL(anchor) }>
42-
{ anchor.title }
39+
key={this._generateAnchorURL(anchor)}
40+
className={`${block}__anchor`}
41+
title={anchor.title}>
42+
<a href={this._generateAnchorURL(anchor)}>
43+
{anchor.title}
4344
</a>
4445
</li>
4546
))
4647
}
4748
</ul>
48-
) : null }
49+
) : null}
4950
</div>
5051
);
5152
}

src/components/SidebarMobile/SidebarMobile.jsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@ export default class SidebarMobile extends React.Component {
99
_lastTouchPosition = {}
1010

1111
render() {
12-
let { isOpen, toggle } = this.props;
12+
let {isOpen, toggle} = this.props;
1313
let openMod = isOpen ? ' sidebar-mobile--visible' : '';
1414

1515
this._toggleBodyListener(isOpen);
1616

1717
return (
1818
<nav
19-
className={ `sidebar-mobile${openMod}` }
20-
ref={ ref => this._container = ref }
21-
onTouchStart={ this._handleTouchStart }
22-
onTouchMove={ this._handleTouchMove }
23-
onTouchEnd={ this._handleTouchEnd }>
19+
className={`sidebar-mobile${openMod}`}
20+
ref={ref => this._container = ref}
21+
onTouchStart={this._handleTouchStart}
22+
onTouchMove={this._handleTouchMove}
23+
onTouchEnd={this._handleTouchEnd}>
2424

2525
<div
2626
className="sidebar-mobile__toggle"
27-
onTouchStart={ this._handleTouchStart }
28-
onTouchMove={ this._handleOpenerTouchMove }
29-
onTouchEnd={ this._handleTouchEnd } />
27+
onTouchStart={this._handleTouchStart}
28+
onTouchMove={this._handleOpenerTouchMove}
29+
onTouchEnd={this._handleTouchEnd} />
3030

3131
<div className="sidebar-mobile__content">
3232
<i
3333
className="sidebar-mobile__close icon-cross"
34-
onClick={ toggle.bind(null, false) } />
34+
onClick={toggle.bind(null, false)} />
3535

36-
{ this._getSections() }
36+
{this._getSections()}
3737
</div>
3838
</nav>
3939
);
@@ -62,17 +62,17 @@ export default class SidebarMobile extends React.Component {
6262

6363
return (
6464
<div
65-
className={ `sidebar-mobile__section ${active ? 'sidebar-mobile__section--active' : ''}` }
66-
key={ section.url }>
65+
className={`sidebar-mobile__section ${active ? 'sidebar-mobile__section--active' : ''}`}
66+
key={section.url}>
6767
<Link
6868
className="sidebar-mobile__section-header"
69-
key={ section.url }
70-
to={ section.url }
71-
onClick={ this.props.toggle.bind(null, false) }>
72-
<h3>{ section.title || section.url }</h3>
69+
key={section.url}
70+
to={section.url}
71+
onClick={this.props.toggle.bind(null, false)}>
72+
<h3>{section.title || section.url}</h3>
7373
</Link>
7474

75-
{ this._getPages(section.children) }
75+
{this._getPages(section.children)}
7676
</div>
7777
);
7878
});
@@ -97,11 +97,11 @@ export default class SidebarMobile extends React.Component {
9797

9898
return (
9999
<Link
100-
key={ url }
101-
className={ `sidebar-mobile__page sidebar-mobile__section-child ${active ? 'sidebar-mobile__page--active' : ''}` }
102-
to={ url }
103-
onClick={ this.props.toggle.bind(null, false) }>
104-
{ page.title }
100+
key={url}
101+
className={`sidebar-mobile__page sidebar-mobile__section-child ${active ? 'sidebar-mobile__page--active' : ''}`}
102+
to={url}
103+
onClick={this.props.toggle.bind(null, false)}>
104+
{page.title}
105105
</Link>
106106
);
107107
});
@@ -113,7 +113,7 @@ export default class SidebarMobile extends React.Component {
113113
* @param {object} e - Native click event
114114
*/
115115
_handleBodyClick = e => {
116-
const { isOpen, toggle } = this.props;
116+
const {isOpen, toggle} = this.props;
117117
if (isOpen && !this._container.contains(e.target)) {
118118
toggle(false);
119119
}
@@ -156,7 +156,7 @@ export default class SidebarMobile extends React.Component {
156156
}
157157

158158
_handleTouchEnd = e => {
159-
const { isOpen } = this.props;
159+
const {isOpen} = this.props;
160160
const threshold = 20;
161161

162162
// Free up all the inline styling

src/content/api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Introduction
3-
sort: 0
3+
sort: -1
44
contributors:
55
- tbroadley
66
---

src/content/concepts/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Concepts
3-
sort: 0
3+
sort: -1
44
contributors:
55
- TheLarkInn
66
- jhnns

src/content/concepts/loaders.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ This uses the `jade-loader` for `.jade` files, and the [`style-loader`](/loaders
140140
- Plugins can give loaders more features.
141141
- Loaders can emit additional arbitrary files.
142142

143-
Loaders allow more power in the JavaScript ecosystem through preprocessing
144-
functions (loaders). Users now have more flexibility to include fine-grained logic such as compression, packaging, language translations and [more](/loaders).
143+
Loaders provide a way to customize the output through their preprocessing functions. Users now have more flexibility to include fine-grained logic such as compression, packaging, language translations and [more](/loaders).
145144

146145

147146
## Resolving Loaders

src/content/concepts/output.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ contributors:
66
- chyipin
77
- rouzbeh84
88
- byzyk
9+
- EugeneHlushko
910
---
1011

1112
Configuring the `output` configuration options tells webpack how to write the compiled files to disk. Note that, while there can be multiple `entry` points, only one `output` configuration is specified.
1213

1314

1415
## Usage
1516

16-
The minimum requirement for the `output` property in your webpack config is to set its value to an object including the following property:
17-
18-
- A `filename` to use for the output file(s).
17+
The minimum requirement for the `output` property in your webpack configuration is to set its value to an object and provide an [`output.filename`](/configuration/output/#outputfilename) to use for the output file(s):
1918

2019
__webpack.config.js__
2120

src/content/contribute/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Contribute
3-
sort: 0
3+
sort: -1
44
contributors:
55
- rouzbeh84
66
- scottdj92

src/content/guides/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Guides
3-
sort: 0
3+
sort: -1
44
contributors:
55
- skipjack
66
- EugeneHlushko

src/content/guides/scaffolding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: Scaffolding
3+
sort: 14
34
contributors:
45
- evenstensberg
56
- pranshuchittora
67
- EugeneHlushko
7-
sort: 14
88
---
99

1010
It can be hard to set up a complex webpack configuration for the first time. Writing advanced configurations to optimize performance is quite hard. The `init` feature is designed to support people that want to create their own configuration or initializing projects that other people create.

0 commit comments

Comments
 (0)