~I am not sure if this is a valid fix yet, but I was going to let CI run the tests for me. I'll close and look into it if the build fails.~
Let me know if this will cause issues, but I don't think it should. The React docs recommends moving `componentWillMount` logic into the constructor
This PR:
* Removes dublicate `className` in: `<meta charSet="utf-8" class="next-head"/>`
* Refactores head reducer
Special thanks to @udanpe for reporting and @geoffRGWilliams for bringing me on the right tack! 🙌Closes#4745, #4802
There's an edge case @timothyis is running into, this will show exactly what files are missing.
I currently can't reproduce, so this is a first step at providing better error messages
The current canary version shows the following warning in development mode:
```log
Warning: Each child in an array or iterator should have a unique "key" prop. See https://fb.me/react-warning-keys for more information.
in script
in NextScript
in body
in html
in Document
```
This PR adds proper keys to the devFiles on the server.
Related https://github.com/zeit/next.js/pull/4954
As reported by @ranyitz the links in the documentation about ['What syntactic features are transpiled? How do I change them?'](https://github.com/zeit/next.js#faq) are broken.
I updated the links and the text to reflect the latest changes.
Closes#4974
Related eb74ff4bf9
Running the [with-jest](https://github.com/zeit/next.js/tree/canary/examples/with-jest) example results in the following error:
```log
FAIL __tests__/index.test.js
● Test suite failed to run
SecurityError: localStorage is not available for opaque origins
at Window.get localStorage [as localStorage] (node_modules/jsdom/lib/jsdom/browser/Window.js:257:15)
at Array.forEach (<anonymous>)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.943s
Ran all test suites.
error Command failed with exit code 1.
```
Upgrading the dependencies (jest) to the latest version helps!
[More info](https://github.com/jsdom/jsdom/issues/2304)
Related #4776
* Implement autodllplugin
* Add flow-typed for autodll-webpack-plugin
* Improve onClick tests
* Make third test pass
* Make sure DLL bundle is loaded without async
* Add nonce
* Fix windows DLL path
Following https://github.com/zeit/next.js/pull/4950
Fix https://github.com/zeit/next.js/issues/4716
I'm not sure to understand this part, though :
> Note: in order to programmatically change the route without triggering navigation and component-fetching, use `props.url.push` and `props.url.replace` within a component
Is there a difference between :
```jsx
export default () => <a onClick={() => Router.push('/about')}>About</a>
```
and
```jsx
export default withRouter(
() => <a onClick={() => props.router.push('/about')}>About</a>
)
```
?
* replace componentWillReceiveProps by componentDidUpdate
* replace props.url by withRouter HOC
* fix deprecated `props.url` in with-shallow-routing example