Skip to content

Commit 0a1810b

Browse files
authored
Merge branch 'master' into issues/3094
2 parents 1fa0cc7 + 21d04b5 commit 0a1810b

36 files changed

+351
-83
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ yarn-error.log
1010
package-lock.json
1111
.cache
1212
internal-links.tap
13-
stats.json
13+
stats.json
14+
printable.md

package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +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/",
33-
"bundle-analyze": "run-s clean fetch content && cross-env NODE_ENV=production webpack --config webpack.ssg.js && cross-env NODE_ENV=production webpack --config webpack.prod.js --profile --json > stats.json && webpack-bundle-analyzer stats.json",
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",
3435
"fetch": "run-p fetch:*",
3536
"fetch:readmes": "node src/utilities/fetch-package-readmes.js",
3637
"fetch:supporters": "node src/utilities/fetch-supporters.js",
3738
"fetch:starter-kits": "node src/utilities/fetch-starter-kits.js",
3839
"prebuild": "npm run clean",
39-
"build": "run-s fetch content && cross-env NODE_ENV=production webpack --config webpack.ssg.js && cross-env NODE_ENV=production webpack --config webpack.prod.js",
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",
4041
"postbuild": "bundlesize && npm run sitemap",
42+
"build-test": "npm run build && http-server dist/",
4143
"test": "npm run lint",
4244
"lint": "run-s lint:*",
4345
"lint:js": "eslint src --ext .js,.jsx,.md --cache true --cache-location .cache/.eslintcache",
4446
"lint:markdown": "markdownlint --rules markdownlint-rule-emphasis-style --config ./.markdownlint.json *.md ./src/content/**/*.md --ignore './src/content/**/_*.md'",
4547
"lint:social": "alex . -q",
4648
"lint:prose": "cp .proselintrc ~/ && proselint src/content",
47-
"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",
4850
"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",
49-
"sitemap": "cd dist && sitemap-static --pretty --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",
5052
"serve": "npm run build && sirv start ./dist --port 4000",
51-
"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"
5256
},
5357
"husky": {
5458
"hooks": {

sitemap-ignore.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"app-shell/index.html",
3+
"appcache/manifest.html"
4+
]

src/assets/icon-print.svg

Lines changed: 1 addition & 0 deletions
Loading

src/components/Contributors/Contributors.scss

Lines changed: 6 additions & 0 deletions
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

Lines changed: 8 additions & 14 deletions
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
@include break {
1111
right: 1.5em;
1212
}
13+
14+
@media print {
15+
display: none;
16+
}
1317
}
1418

1519
.gitter__button {

src/components/NotificationBar/NotificationBar.scss

Lines changed: 4 additions & 0 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 8 additions & 1 deletion
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
}

0 commit comments

Comments
 (0)