Skip to content

Commit 7790aa5

Browse files
authored
Merge pull request webpack#1 from webpack-china/cn
update from the origin
2 parents 5953c70 + 47a8cdd commit 7790aa5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2637
-1212
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ node_js:
88
script:
99
- bash ./scripts/deploy.sh
1010
sudo: required
11+
cache: yarn
1112
install:
12-
- npm install
13+
- npm i yarn -g
14+
- yarn
1315
- sudo pip install proselint

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Issue the PR to the [master](https://github.com/webpack/webpack.js.org/tree/mast
4040
4141
## Contribution Recognition
4242

43-
Any document that you edit, you can choose to add your GitHub username at the top of the document for recognition:
43+
You can choose to add your GitHub username for recognition at the top of any markdown document you edit:
4444

4545
**example.md**
4646

@@ -59,7 +59,7 @@ contributors:
5959

6060
```
6161

62-
This will add your name and GitHub profile photo to the document in production. This is a great way to own the awesome work that you do and encourage that you remember to do this in your PR's.
62+
This will add your name and GitHub profile photo to the document in production. It's a great way to own the awesome work that you do and we encourage you to do this in your PRs.
6363

6464

6565
## Thank you

PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
1. [Read and sign the CLA](https://cla.js.foundation/webpack/webpack.js.org). This needs to be done only once. PRs that haven't signed it won't be accepted.
22
2. Make sure your PR complies with [the writer's guide](https://webpack.js.org/writers-guide/).
33
3. Read through the PR diff carefully as sometimes this can reveal issues. The work will be reviewed, but this can save some effort.
4+
4. Remove these instructions from your PR as they are for your eyes only.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# webpack 中文文档
22

3+
> https://doc.webpack-china.org webpack 中文文档
34
> https://webpack-china.org webpack 中文社区
45
56
- [webpack 2 翻译任务认领说明 - 入口目录](https://github.com/webpack-china/webpack.js.org/issues/17)

antwar.config.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ module.exports = {
7171
}
7272
),
7373

74+
development: section(
75+
'开发',
76+
function() {
77+
return require.context(
78+
'json-loader!yaml-frontmatter-loader!./content/development',
79+
true,
80+
/^\.\/.*\.md$/
81+
);
82+
}
83+
),
84+
7485
configuration: section(
7586
'配置',
7687
function() {
@@ -137,7 +148,7 @@ module.exports = {
137148
return combineContexts(content, generated);
138149
}
139150
),
140-
151+
141152
vote: {
142153
path() {
143154
return require('./components/vote/list.jsx').default
@@ -166,7 +177,7 @@ module.exports = {
166177

167178
function root(contentCb) {
168179
return {
169-
title: 'Webpack',
180+
title: 'webpack',
170181
path: function() { // Load path content
171182
return contentCb();
172183
},
@@ -235,7 +246,7 @@ function combineContexts(context1, context2) {
235246

236247
let keys1 = context1.keys();
237248
let keys2 = context2.keys();
238-
return _.chain(keys1).concat(keys2).uniq().value();
249+
return _.chain(keys1).concat(keys2).sortBy().uniq().value();
239250
};
240251
return webpackContext;
241252
}

assets/icon-square-small-slack.png

14.5 KB
Loading

components/cube/cube.jsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,22 @@ export default class Cube extends React.Component {
7878
let degrees = 0;
7979
let axis = 'y';
8080

81-
this._interval = setInterval(() => {
82-
let obj = {};
83-
obj[axis] = degrees += 90;
84-
85-
this.setState({ ...obj, iteration: (this.state.iteration + 1) % 4 });
86-
}, repeatDelay);
81+
let lastTime = performance.now();
82+
let animation = () => {
83+
let nowTime = performance.now();
84+
let deltaTime = nowTime - lastTime;
85+
86+
if (repeatDelay <= deltaTime) {
87+
let obj = {};
88+
obj[axis] = degrees += 90;
89+
90+
this.setState({ ...obj, iteration: (this.state.iteration + 1) % 4 });
91+
lastTime = performance.now();
92+
}
93+
94+
this._requestAnimation = requestAnimationFrame(animation);
95+
};
96+
animation();
8797
}
8898
}
8999

@@ -95,7 +105,7 @@ export default class Cube extends React.Component {
95105
this.container.removeEventListener('mouseleave', this.listeners.reset);
96106

97107
} else if (continuous) {
98-
clearInterval(this._interval);
108+
cancelAnimationFrame(this._requestAnimation);
99109
}
100110
}
101111

components/navigation/navigation.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,26 @@ let Sections = [
1919
children: [
2020
{ title: 'API', url: 'api' },
2121
{ title: '配置', url: 'configuration' },
22-
{ title: '加载器', url: 'loaders' },
23-
{ title: '插件', url: 'plugins' }
22+
{ title: 'LOADER', url: 'loaders' },
23+
{ title: '插件', url: 'plugins' },
24+
{ title: '开发', url: 'development' }
2425
]
2526
},
2627
{
2728
title: '捐赠',
2829
url: '//opencollective.com/webpack'
30+
},
31+
{
32+
title: 'Blog',
33+
url: '//medium.com/webpack'
2934
}
3035
];
3136

3237
// TODO: Move back to using state once we can handle algolia on our own
3338
export default class Navigation extends React.Component {
3439
render() {
3540
let { pageUrl = '' } = this.props;
36-
41+
3742
return (
3843
<header className="navigation">
3944
<Container className="navigation__inner">

components/organization/projects.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{
1616
"repo": "webpack/loader-utils",
1717
"npm": "loader-utils",
18-
"description": "Webpack loader utilities.",
18+
"description": "webpack loader utilities.",
1919
"maintainer": "sokra"
2020
},
2121
{
@@ -289,4 +289,3 @@
289289
"maintainer": "thelarkinn"
290290
}
291291
]
292-

components/site/site.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export default props => {
2828
}))
2929
}));
3030

31-
// Rename the root section ("Webpack" => "Other") and push it to the end
32-
let rootIndex = sections.findIndex(section => section.title === 'Webpack');
31+
// Rename the root section ("webpack" => "Other") and push it to the end
32+
let rootIndex = sections.findIndex(section => section.title === 'webpack');
3333
let rootSection = sections.splice(rootIndex, 1)[0];
3434
rootSection.title = '其他';
3535
sections.push(rootSection);

components/splash/splash-style.scss

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44
.splash {
55
&__section {
66
position:relative;
7-
padding:5em 1em;
87
text-align:center;
98

10-
&:last-child {
11-
padding-top: 0;
9+
&__dark {
10+
background-color:#f3f3f3;
1211
}
1312

14-
@include break {
15-
padding:8em 1.5em;
13+
.container {
14+
padding:5em 1em;
15+
16+
@include break {
17+
padding-left:1.5em;
18+
padding-right:1.5em;
19+
}
1620
}
1721

18-
pre {
19-
text-align:left;
22+
pre {
23+
text-align:left;
2024
}
2125

2226
.icon-link {

components/splash/splash.jsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,27 @@ export default props => {
1717
id="components/splash-viz/splash-viz.jsx"
1818
component={ SplashViz } />
1919

20-
<Container className="splash__section">
21-
<h1>{ page.title }</h1>
22-
<div dangerouslySetInnerHTML={{
23-
__html: page.content
24-
}} />
25-
</Container>
20+
<div className="splash__section splash__section__dark">
21+
<Container>
22+
<div dangerouslySetInnerHTML={{
23+
__html: page.content
24+
}} />
25+
</Container>
26+
</div>
2627

27-
<Container className="splash__section">
28-
<h1>支持团队</h1>
28+
<div className="splash__section">
29+
<Container>
30+
<h1>支持团队</h1>
2931

30-
<p>通过你的贡献、捐款或者赞助,webpack 将获得繁荣发展。你的捐助直接用于支持我们付出工作、持续改进,最加重要的是有助于我们提供优秀的文档和资料!</p>
32+
<p>通过你的贡献、捐款或者赞助,webpack 将获得繁荣发展。你的捐助直接用于支持我们付出工作、持续改进,最加重要的是有助于我们提供优秀的文档和资料!</p>
3133

32-
<h2>赞助商</h2>
33-
<Support number={ 40 } type="sponsor" />
34+
<h2>赞助商</h2>
35+
<Support number={ 40 } type="sponsor" />
3436

35-
<h2>赞助支持</h2>
36-
<Support number={ 130 } type="backer" />
37-
</Container>
37+
<h2>赞助支持</h2>
38+
<Support number={ 130 } type="backer" />
39+
</Container>
40+
</div>
3841
</div>
3942
);
4043
};

components/vote/app-style.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@
136136
&__item-card {
137137
display: flex;
138138
flex-direction: column;
139+
margin-top: 30px;
140+
margin-bottom: 30px;
139141

140142
@include break(medium){
141143
flex-direction: row;
@@ -215,4 +217,4 @@
215217
width: 100%;
216218
}
217219
}
218-
}
220+
}

content/api/cli.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ These options allow webpack to display various stats and style them differently
234234

235235
### Shortcuts
236236

237-
| Shortcut | Replaces |
238-
|----------|-------------------------------------------------------------------------------------------|
239-
| -d | --debug --devtool eval-cheap-module-source-map --output-pathinfo |
240-
| -p | --optimize-minimize --define,process.env.NODE_ENV="production" --optimize-occurence-order |
237+
| Shortcut | Replaces |
238+
|----------|------------------------------------------------------------------|
239+
| -d | --debug --devtool eval-cheap-module-source-map --output-pathinfo |
240+
| -p | --optimize-minimize --define process.env.NODE_ENV="production" |
241241

242242
### Profiling
243243

content/api/loaders.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ A data object shared between the pitch and the normal phase.
125125
cacheable(flag = true: boolean)
126126
```
127127

128-
Make this loader result cacheable. By default it's not cacheable.
128+
By default, loader results are cacheable. Call this method passing `false` to make the loader's result not cacheable.
129129

130130
A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed. This means the loader shouldn't have other dependencies than specified with `this.addDependency`. Most loaders are deterministic and cacheable.
131131

0 commit comments

Comments
 (0)