Next.js 7 Released with 40% Faster Builds

微信扫一扫,分享到朋友圈

Next.js 7 Released with 40% Faster Builds

The Next.js team have announced version 7
of their open-source React framework. This release of Next.js focuses on improving the overall developer experience with 57% faster boot times and 40% faster builds in development, improved error reporting and WebAssembly support.

Next.js is a React framework whose primary goal is to provide great performance in production along with a great developer experience. In order to provide this great developer experience, Next.js supports server-side rendering, code splitting and client-side routing out the box.

Next.js is built on many industry standard tools within the JavaScript ecosystem such as Babel and Webpack and with version 7 comes the latest versions of these tools. These upgrades along with a new incremental compilation cache means that Next.js compilations are now 40% faster, a basic application will see compilation reduce from 304ms to 178ms.

With the Webpack upgrade Next.js 7 benefits from the new .mjs support allowing for all the common JavaScript modules such as CommonJS, AMD and ESM to be bundled but also support for EcmaScript, JSON and WebAssembly modules too.

Next.js 7 also bundles the latest version of Babel which brings support for TypeScript, fragment syntax, and experimental auto-polyfilling.

Initial payload sizes in Next.js 7 have been decreased by as much as 7.4%, taking a document size in previous versions of Next.js from 1.62kB to 1.50kB. These improvements have come from the Next.js team removing certain HTML elements and minifying some inline scripts.

Another major improvement with Next.js 7 is its support for the React Context API. The Context API is a way to share data across React components without having to explicitly share it every time. In Next.js this reduces memory usage by 16% due to Next.js’s ability to share code between pages.

Next.js 7 supports dynamic importing of modules; previously this was not possible due to Next.js rolling its own import functionality. They’ve now removed that and support default import functionality that comes out the box with Webpack, allowing dynamic imports, naming and bundling of files.

Next.js has received lots of praise within the community. reacttricks on Reddit says “I’ve been using Next.js exclusively for all projects in the last year and a half, I’d recommend everyone to try it.”. Other feedback includes confusion on what Next.js is; theineffablebob asks “Next just a framework that includes everything you need to get a site up and running? Is it sorta like one of those boilerplates?” Nextjs.org considers itself the PHP of the JavaScript and React world in this quote from nextjs.org: “Think about how webapps are created with PHP. You create some files, write PHP code, then simply deploy it. We don’t have to worry about routing much, and the app is rendered on the server by default.”.

You can get the latest version of Next.js from the Next.js website
.

小米8屏幕指纹版暗藏玄机:航天级高分子散热可降温3℃

上一篇

Google estimated to be paying $9 billion to be Safari's default search engine

下一篇

你也可能喜欢

Next.js 7 Released with 40% Faster Builds

长按储存图像,分享给朋友