NuxtJS 2.8: What’s New and Improved
Improved Developer Experience
The latest version of NuxtJS, 2.8, focuses on enhancing the developer experience with several new features:
- Grouped SSR logs: Server-side rendering (SSR) logs are now grouped, making it easier to debug and identify issues.
- Code building indicator: A new indicator shows the build status of your application in the browser, eliminating the need to switch to the terminal.
- Smart reloading: NuxtJS now only listens for file changes in supported extensions, reducing unnecessary reloads.
- Automatic page directory detection: NuxtJS automatically detects when a page directory is created, eliminating the need to restart the server.
For example, you can take advantage of the grouped SSR logs by using the nuxt.js
module:
module.exports = {
// Enable grouped SSR logs
ssr: {
log: {
group: true
}
}
}
Bug Fixes and Improvements
NuxtJS 2.8 also includes several bug fixes and improvements:
- Improved lazy loaded components: Lazy loaded components are now smaller and more efficient.
- Minified SPA fallback HTML files: The HTML for the SPA fallback is now minified, reducing file size.
- Improved consola: Consola, a library for adding custom styles to the console, is now optional.
- Bundle re-render: You can now control which scripts are loaded by your HTML using the
inject
option in thebundleRenderer
object. - Safe SSR logs: NuxtJS now safely formats SSR logs, preventing errors and making debugging easier.
For instance, you can customize the bundle re-render by adding the following code:
module.exports = {
// Customize bundle re-render
build: {
bundleRenderer: {
inject: ['script1', 'cript2']
}
}
}
Dependency Upgrades
NuxtJS 2.8 includes several dependency upgrades, including:
- Consola v2.7.0
- Connect v3.7.0
- Webpack v4.32
- Babel v7.4.5
- Thread-loader v2.1.2
Migration Tip
Upgrading to NuxtJS 2.8 requires no changes to your project code. Everything will be automatically migrated once you upgrade.
What’s Next?
The NuxtJS team is committed to continuously improving the framework. Stay tuned for future updates and releases.
Join the Conversation
Share your thoughts on the new features and improvements in NuxtJS 2.8. What’s your favorite new feature or API? Share in the comments!