github nitrojs/nitro v2.8.0

latest releases: v2.10.4, v2.10.3, v2.10.2...
11 months ago

🌟 What is new?

πŸš€ Zero config deployment to AWS Amplify Hosting

We have been closely working with the AWS Amplify team to bring you a zero-config experience AWS deployment and it is ready today! Read more in the deployment guide.

πŸ”₯ Code splitting enabled for Cloudflare Pages and Modules

Code-splitting support is now enabled for Cloudflare Pages and Modules presets making startup-time even faster by leveraging lazy chunks. (read more: (#1905))

🍣 Rollup v4 with native SWC-based parser

We've upgraded Nitro to the latest Rollup v4, powered native SWC-based parser for even faster builds (rollup/rollup#5073) πŸ”₯

Normally, you won't need any specific changes in your project. You can also ignore warnings about compatibility with rollup-plugin-visualizer. If you're adding a custom Rollup plugin or using Vite v4, you might encounter type issues due to duplicate dependencies. You can either use the resolutions field in your package.json or simply ignore this warning until Nuxt upgrades to Vite v5 (soon!).

🧩 Modules support to extend Nitro core

With this release, we have introduced a new advanced feature to extend the Nitro builder core. (more documentation will be available soon)

Example: modules/test.ts (server/modules/test.ts for Nuxt projects)

import type { NitroModule } from "nitropack";

export default <NitroModule>{
  name: "my-nitro-module",
  async setup(nitro) {
    console.log("Running custom nitro module...");
    await nitro.updateConfig({
      routeRules: {
        "/**": { swr: true },
      },
    });
  },
};

⚑️ H3 v1.9

h3 v1.9.0 comes with new getValidatedRouterParamsand getRequestFingerprint utilities, decode options for getRouterParam and auto-completion for headers in your IDE!

image

πŸ”₯ More coming soon

There are more exciting features including tasks, db layer, and WebSocket API planned for the next minor releases. Stay tuned!

Changelog

compare changes

πŸš€ Enhancements

  • Support modules to extend nitro builder (#1789)
  • Support inline mode for serveStatic (#1864)
  • Add experimental winterjs preset (#1863)
  • Allow setting preset using SERVER_PRESET environment variable (#1870)
  • cloudflare-pages, Cloudflare-module: Enable code splitting by default (#1905)
  • Support framework config (#1843)
  • Add AWS Amplify Hosting preset (#1912)
  • Upgrade to Rollup v4 (#1927)
  • Improve nitro.json build info (#1930)
  • aws-amplify: Support static builds (#1933)
  • Add defineNitroErrorHandler type helper (#1923)

🩹 Fixes

  • cloudflare-pages: Filter out overlapping public assets dirs (#1859)
  • scanner: Allow having HTTP method as part of the route name (#1895)
  • Generate route types with resolve path and stripped extension (#1897)
  • Scan dirs for unimport on initialization (#1908)
  • aws-amplify: Register and auto detect (0f38eb6f)
  • prerender: Decode generated routes (#1914)
  • Disabled public asset handler name is null (b7a6a1a6)
  • prerender: Decode URIs in headers (#1932)
  • error: Respect accept: text/html request header (#1921)
  • prerender: Filter encoded links starting with # (#1936)

πŸ’… Refactors

  • deno-deploy: Use Deno.serve (#1879)
  • Split preset types (#1910)

πŸ“– Documentation

  • deploy: Split runtimes from providers (#1865)
  • routing: Add note about middleware returns (#1884)
  • Update edge links to nightly (#1902)
  • deploy: Add deno to runtime list (#1899)
  • cloudflare: Update wrangler link (#1913)
  • aws-amplify: Add custom amplify.yml (f412af16)
  • amplify: Remove cache from config (7bbb723e)
  • Hide winterjs due to instability (048c8ff0)
  • Add jsdoc for cache.maxAge (#1878)

🌊 Types

  • Export SerializeTuple and SerializeObject types (#1907)

❀️ Contributors

Don't miss a new nitro release

NewReleases is sending notifications on new releases.