Skip to content

Commit 16d99f5

Browse files
Merge branch 'master' into patch-1
2 parents af2a905 + 9aa9675 commit 16d99f5

Some content is hidden

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

84 files changed

+1294
-353
lines changed

.github/FUNDING.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
open_collective: webpack
2+

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ _describe your changes..._
77

88

99
[1]: https://cla.js.foundation/webpack/webpack.js.org
10-
[2]: https://webpack.js.org/writers-guide/
10+
[2]: https://webpack.js.org/contribute/writers-guide/

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ npm-debug.log
99
yarn-error.log
1010
package-lock.json
1111
.cache
12-
internal-links.tap
12+
internal-links.tap
13+
stats.json
14+
printable.md

README.md

+29-31
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,59 @@
11
# webpack.js.org
22

3-
[![Build Status][13]][10]
4-
[![Standard Version][12]][11]
3+
[![Build Status][build-status]][build-status-url]
4+
[![Standard Version][release]][release-url]
5+
[![chat on gitter][chat]][chat-url]
56

67
Guides, documentation, and all things webpack.
78

8-
99
## Content Progress
1010

1111
Now that we've covered much of the backlog of _missing documentation_, we are
1212
starting to heavily review each section of the site's content to sort and
1313
structure it appropriately. The following issues should provide a pretty good
1414
idea of where things are, and where they are going:
1515

16-
- [Guides - Review and Simplify][1]
17-
- [Concepts - Review and Organize][2]
18-
- [API - v4 Rewrite][8]
16+
- [Guides - Review and Simplify][guides-url]
17+
- [Concepts - Review and Organize][concepts-url]
18+
- [API - v4 Rewrite][api-url]
1919

2020
We haven't created issues for the other sections yet, but they will be coming
21-
soon. For dev-related work please see [General - Updates & Fixes][3].
22-
21+
soon. For dev-related work please see [General - Updates & Fixes][general-url].
2322

2423
## Translation
2524

26-
To help translate this documentation please jump to the [translate branch][4].
27-
25+
To help translate this documentation please jump to the [translation branch][translate-url].
2826

2927
## Contributing
3028

31-
Read through the [writer's guide][7] if you're interested in editing the
32-
content on this site. See the [contributors page][5] to learn how to set up and
29+
Read through the [writer's guide][writer-guide-url] if you're interested in editing the
30+
content on this site. See the [contributors page][contributing-url] to learn how to set up and
3331
start working on the site locally.
3432

35-
3633
## License
3734

38-
The content is available under the [Creative Commons BY 4.0][6] license.
39-
35+
The content is available under the [Creative Commons BY 4.0][license-url] license.
4036

4137
## Special Thanks
4238

4339
_BrowserStack_ has graciously allowed us to do cross-browser and cross-os
4440
testing of the site at no cost...
4541

46-
[![BrowserStackLogo](./browserstack-logo.png)][9]
47-
48-
49-
[1]: https://github.com/webpack/webpack.js.org/issues/1258
50-
[2]: https://github.com/webpack/webpack.js.org/issues/1386
51-
[3]: https://github.com/webpack/webpack.js.org/issues/1525
52-
[4]: https://github.com/webpack/webpack.js.org/tree/translation
53-
[5]: https://github.com/webpack/webpack.js.org/blob/master/.github/CONTRIBUTING.md
54-
[6]: https://creativecommons.org/licenses/by/4.0/
55-
[7]: https://webpack.js.org/writers-guide
56-
[8]: https://github.com/webpack/webpack.js.org/pull/1754
57-
[9]: http://browserstack.com/
58-
[10]: http://travis-ci.org/webpack/webpack.js.org
59-
[11]: https://github.com/conventional-changelog/standard-version
60-
[12]: https://img.shields.io/badge/release-standard%20version-brightgreen.svg
61-
[13]: https://secure.travis-ci.org/webpack/webpack.js.org.svg
42+
[![BrowserStackLogo][browserstack]][browserstack-url]
43+
44+
[api-url]: https://github.com/webpack/webpack.js.org/pull/1754
45+
[build-status]: https://secure.travis-ci.org/webpack/webpack.js.org.svg
46+
[build-status-url]: http://travis-ci.org/webpack/webpack.js.org
47+
[browserstack]: ./browserstack-logo.png
48+
[browserstack-url]: http://browserstack.com/
49+
[chat]: https://badges.gitter.im/webpack/webpack.svg
50+
[chat-url]: https://gitter.im/webpack/webpack
51+
[concepts-url]: https://github.com/webpack/webpack.js.org/issues/1386
52+
[contributing-url]: https://github.com/webpack/webpack.js.org/blob/master/.github/CONTRIBUTING.md
53+
[general-url]: https://github.com/webpack/webpack.js.org/issues/1525
54+
[guides-url]: https://github.com/webpack/webpack.js.org/issues/1258
55+
[license-url]: https://creativecommons.org/licenses/by/4.0/
56+
[release]: https://img.shields.io/badge/release-standard%20version-brightgreen.svg
57+
[release-url]: https://github.com/conventional-changelog/standard-version
58+
[translate-url]: https://github.com/webpack/webpack.js.org/tree/translation
59+
[writer-guide-url]: https://webpack.js.org/contribute/writers-guide

package.json

+22-8
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,34 @@
2525
},
2626
"scripts": {
2727
"clean-dist": "rimraf ./dist",
28-
"clean": "npm run clean-dist && rimraf src/content/**/_*.md src/**/_*.json",
28+
"clean-printable": "rimraf src/content/**/printable.md",
29+
"preclean": "run-s clean-dist clean-printable",
30+
"clean": "rimraf src/content/**/_*.md src/**/_*.json",
2931
"start": "npm run clean-dist && cross-env NODE_ENV=development webpack-dev-server --config webpack.dev.js --env.dev",
3032
"update-repos": "node src/utilities/fetch-package-repos.js",
3133
"content": "node src/scripts/build-content-tree.js ./src/content ./src/_content.json",
32-
"build-test": "npm run build && http-server dist/",
34+
"bundle-analyze": "run-s clean fetch printable content && cross-env NODE_ENV=production webpack --config webpack.ssg.js && run-s clean-printable content && cross-env NODE_ENV=production webpack --config webpack.prod.js --profile --json > stats.json && webpack-bundle-analyzer stats.json",
3335
"fetch": "run-p fetch:*",
3436
"fetch:readmes": "node src/utilities/fetch-package-readmes.js",
3537
"fetch:supporters": "node src/utilities/fetch-supporters.js",
3638
"fetch:starter-kits": "node src/utilities/fetch-starter-kits.js",
3739
"prebuild": "npm run clean",
38-
"build": "run-s fetch content && cross-env NODE_ENV=production webpack --config webpack.prod.js",
39-
"postbuild": "npm run sitemap",
40+
"build": "run-s fetch printable content && cross-env NODE_ENV=production webpack --config webpack.ssg.js && run-s clean-printable content && cross-env NODE_ENV=production webpack --config webpack.prod.js",
41+
"postbuild": "bundlesize && npm run sitemap",
42+
"build-test": "npm run build && http-server dist/",
4043
"test": "npm run lint",
4144
"lint": "run-s lint:*",
4245
"lint:js": "eslint src --ext .js,.jsx,.md --cache true --cache-location .cache/.eslintcache",
4346
"lint:markdown": "markdownlint --rules markdownlint-rule-emphasis-style --config ./.markdownlint.json *.md ./src/content/**/*.md --ignore './src/content/**/_*.md'",
4447
"lint:social": "alex . -q",
4548
"lint:prose": "cp .proselintrc ~/ && proselint src/content",
46-
"lint:links": "hyperlink -r dist/index.html --canonicalroot https://webpack.js.org/ -i --todo https://img.shields.io --todo https://codecov.io/gh --todo 'content-type-mismatch https://travis-ci.org' --todo 'Asset is used as both Html and Image' | tee internal-links.tap | tap-spot",
49+
"lint:links": "hyperlink -c 8 -r dist/index.html --canonicalroot https://webpack.js.org/ -i --todo https://img.shields.io --todo https://codecov.io/gh --todo 'content-type-mismatch https://travis-ci.org' --todo 'Asset is used as both Html and Image' | tee internal-links.tap | tap-spot",
4750
"linkcheck": "hyperlink -r dist/index.html --canonicalroot https://webpack.js.org/ --skip support__ --skip sidecar.gitter.im --skip vimdoc.sourceforge.net --skip img.shields.io --skip npmjs.com/package/ --skip opencollective.com/webpack --todo external-redirect | tee external-links.tap | tap-spot",
48-
"sitemap": "cd dist && sitemap-static --prefix=https://webpack.js.org/ > sitemap.xml",
51+
"sitemap": "cd dist && sitemap-static --ignore-file=../sitemap-ignore.json --pretty --prefix=https://webpack.js.org/ > sitemap.xml",
4952
"serve": "npm run build && sirv start ./dist --port 4000",
50-
"deploy": "gh-pages -d dist"
53+
"deploy": "gh-pages -d dist",
54+
"preprintable": "npm run clean-printable",
55+
"printable": "node ./src/scripts/concatenate-docs.js"
5156
},
5257
"husky": {
5358
"hooks": {
@@ -62,10 +67,16 @@
6267
"npm run lint:markdown"
6368
]
6469
},
70+
"bundlesize": [
71+
{
72+
"path": "./dist/index.bundle.js",
73+
"maxSize": "200 kB"
74+
}
75+
],
6576
"devDependencies": {
6677
"@mdx-js/loader": "0.15.7",
6778
"@mdx-js/mdx": "0.15.7",
68-
"@octokit/rest": "^15.9.4",
79+
"@octokit/rest": "^16.27.1",
6980
"alex": "^5.1.0",
7081
"autoprefixer": "^7.2.3",
7182
"babel-core": "^6.26.0",
@@ -76,6 +87,7 @@
7687
"babel-plugin-transform-object-rest-spread": "^6.26.0",
7788
"babel-preset-env": "^1.6.0",
7889
"babel-preset-react": "^6.24.1",
90+
"bundlesize": "^0.17.1",
7991
"copy-webpack-plugin": "4.5.2",
8092
"cross-env": "5.2.0",
8193
"css-loader": "^0.28.10",
@@ -109,6 +121,7 @@
109121
"modularscale-sass": "^3.0.3",
110122
"node-sass": "^4.5.3",
111123
"npm-run-all": "^4.1.1",
124+
"offline-plugin": "^5.0.7",
112125
"optimize-css-assets-webpack-plugin": "^5.0.1",
113126
"postcss-loader": "^2.1.3",
114127
"redirect-webpack-plugin": "^0.1.1",
@@ -134,6 +147,7 @@
134147
"through2": "^2.0.3",
135148
"uglifyjs-webpack-plugin": "^1.1.6",
136149
"webpack": "^4.30.0",
150+
"webpack-bundle-analyzer": "^3.3.2",
137151
"webpack-cli": "^3.2.3",
138152
"webpack-dev-server": "^3.2.1",
139153
"webpack-merge": "^4.1.0"

repositories/plugins.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[
22
"webpack-contrib/i18n-webpack-plugin",
3-
"webpack-contrib/component-webpack-plugin",
43
"webpack-contrib/compression-webpack-plugin",
54
"webpack-contrib/extract-text-webpack-plugin",
65
"webpack-contrib/copy-webpack-plugin",

sitemap-ignore.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"app-shell/index.html",
3+
"appcache/manifest.html"
4+
]
-5.79 KB
Loading
-6.44 KB
Loading
-7.07 KB
Loading
-9.37 KB
Loading
-17 KB
Loading
-28.5 KB
Loading
-2.81 KB
Loading
-4.12 KB
Loading

src/assets/PWA/manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "Webpack Documentation",
3-
"short_name": "Webpack",
2+
"name": "webpack Documentation",
3+
"short_name": "webpack",
44
"theme_color": "#2b3a42",
55
"background_color": "#2b3a42",
66
"display": "fullscreen",
@@ -49,4 +49,4 @@
4949
}
5050
],
5151
"splash_pages": null
52-
}
52+
}

src/assets/icon-print.svg

+1
Loading

src/components/Contributors/Contributors.scss

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
@import 'functions';
22
@import 'mixins';
33

4+
.contributors__section {
5+
@media print {
6+
display: none;
7+
}
8+
}
9+
410
.contributors__list {
511
font-size: 14px;
612
margin-left: -0.5em;

src/components/Cube/Cube.jsx

+8-14
Original file line numberDiff line numberDiff line change
@@ -88,22 +88,16 @@ export default class Cube extends React.Component {
8888
let degrees = 0;
8989
let axis = 'y';
9090

91-
let lastTime = performance.now();
9291
let animation = () => {
93-
let nowTime = performance.now();
94-
let deltaTime = nowTime - lastTime;
95-
96-
if (repeatDelay <= deltaTime) {
97-
let obj = {};
98-
obj[axis] = degrees += 90;
92+
let obj = {};
93+
obj[axis] = degrees += 90;
94+
this.setState({ ...obj, iteration: (this.state.iteration + 1) % 4 });
95+
tick();
96+
};
9997

100-
this.setState({ ...obj, iteration: (this.state.iteration + 1) % 4 });
101-
lastTime = performance.now();
102-
}
98+
let tick = () => setTimeout(() => requestAnimationFrame(animation), repeatDelay);
10399

104-
this._requestAnimation = requestAnimationFrame(animation);
105-
};
106-
animation();
100+
this._timeout = tick();
107101
}
108102
}
109103

@@ -115,7 +109,7 @@ export default class Cube extends React.Component {
115109
this.container.removeEventListener('mouseleave', this._reset);
116110

117111
} else if (continuous) {
118-
cancelAnimationFrame(this._requestAnimation);
112+
clearTimeout(this._timeout);
119113
}
120114
}
121115

src/components/Gitter/Gitter.scss

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@
44

55
.gitter {
66
position: fixed;
7-
right: 1.5em;
7+
right: 1em;
88
bottom: 3em;
9+
10+
@include break {
11+
right: 1.5em;
12+
}
13+
14+
@media print {
15+
display: none;
16+
}
917
}
1018

1119
.gitter__button {

src/components/NotificationBar/NotificationBar.scss

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
color: getColor(white);
66
background: getColor(emperor);
77

8+
@media print {
9+
display: none;
10+
}
11+
812
a {
913
color: getColor(malibu);
1014

src/components/Page/Page.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React from 'react';
55
import PageLinks from '../PageLinks/PageLinks';
66
import Markdown from '../Markdown/Markdown';
77
import Contributors from '../Contributors/Contributors';
8-
import Placeholder from '../Placeholder/Placeholder';
8+
import {PlaceholderString} from '../Placeholder/Placeholder';
99
import Configuration from '../Configuration/Configuration';
1010

1111
// Load Styling
@@ -19,7 +19,7 @@ class Page extends React.Component {
1919
const isDynamicContent = content instanceof Promise;
2020

2121
this.state = {
22-
content: isDynamicContent ? Placeholder() : content.default || content,
22+
content: isDynamicContent ? PlaceholderString() : content.default || content,
2323
contentLoaded: isDynamicContent ? false : true
2424
};
2525
}
@@ -77,7 +77,7 @@ class Page extends React.Component {
7777
{contentRender}
7878

7979
{loadRelated && (
80-
<div>
80+
<div className="related__section">
8181
<hr />
8282
<h3>Further Reading</h3>
8383
<ul>
@@ -91,7 +91,7 @@ class Page extends React.Component {
9191
)}
9292

9393
{loadContributors && (
94-
<div>
94+
<div className="contributors__section">
9595
<hr />
9696
<h3>Contributors</h3>
9797
<Contributors contributors={contributors} />

src/components/Page/Page.scss

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99

1010
@include break {
1111
flex: 3;
12-
padding: 1.5em;
12+
// page links not fitting in 768+ resolutions with long headings
13+
padding: 2em 1.5em 1.5em;
14+
}
15+
16+
.related__section {
17+
@media print {
18+
display: none;
19+
}
1320
}
1421
}

src/components/PageLinks/PageLinks.jsx

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import Url from 'url';
33
import './PageLinks.scss';
4+
import icon from '../../assets/icon-print.svg';
45

56
const baseURL = 'https://github.com/webpack/webpack.js.org/edit/master/';
67

@@ -27,6 +28,16 @@ export default ({
2728
Edit Document
2829
<i className="page-links__icon icon-edit" />
2930
</a>
31+
<span className="page-links__gap">|</span>
32+
<a className="page-links__link page-links__print" onClick={_handlePrintClick} title="Print this page">
33+
Print Document
34+
<img src={icon} />
35+
</a>
3036
</div>
3137
);
3238
};
39+
40+
function _handlePrintClick (e) {
41+
e.preventDefault();
42+
window.print();
43+
}

0 commit comments

Comments
 (0)