We are proud today to introduce the production-ready Next.js 6.1 , featuring:
In addition to the Next.js 6.1 release, we're excited to announce that nextjs.org is now open source
In versions before Next.js 6.1 Next.js implemented react-hot-loader on behalf of the user. This library keeps React state between hot reloads.
In doing so react-hot-loader adds a few non-standard behaviors to React, for example, it will ignore shouldComponentUpdate and the element type ended up being a proxy component instead of the actual React component.
To make sure Next.js is as close to default React as possible we have removed react-hot-loader as a dependency, this makes sure development and production mode are closer to each other in behavior.
This is an excerpt. The full article is published by Next.js Blog.
Answers to common questions regarding this article's topic, architecture, and practical applications.
When Next.js 6.0 was released the magically injected url property on page components was deprecated. The reason url is going away is that we want to make things very predictable and explicit. Having a magical url property coming out of nowhere doesn't aid that goal. The recommended way to get the same properties the url property had is using withRouter: // old
class Page extends React.Component {
render() {
const { url } = this.props;
r
General
We are proud today to introduce the production-ready Next.js 6.1, featuring:
How It Works
The Next.js community is growing, with more than 450 contributors that already landed at least 1 commit into the Next.js core or examples. There's many ways to contribute back to Next.js: Joining the community and giving advice on GitHub Contributing examples of common use cases: examples directory Checking the good first issue and help wanted labels on GitHub There's 30 open issues with the good first
issue
label. Giving new contributors the opp
General
By default, Next.js automatically looks for any .js or .jsx file inside the pages directory to define routes. With the introduction of universal webpack in Next.js 5 came the possibility to have compile-to-js top-level pages. A good example is Typescript, which uses .ts and .tsx. pageExtensions is a configuration key in next.config.js aimed at allowing Next.js plugins to define extensions that should be considered pages. For example @zeit/next-ty
General
Recently we've been paving the way for upcoming features, this involved some under the hood changes that will improve code quality in the long run. One of these changes is that the server/build directory is moved to the top level build. This makes the webpack and babel configuration easier to find for new contributors. We have also been focusing on adding Flow types throughout the codebase. A change we've made that is more visible to users is tha