Skip to content

Releases: nitrojs/nitro

v3.0.1-alpha.2

21 Jan 18:45
@pi0 pi0

Choose a tag to compare

🔋 This release contains many improvements since the alpha.1 release.

⏳ We took extra time to ensure everything works well by testing against real-world projects using Nitro v3.

🎯 We are closer to Beta now. Expect more regular v3 releases!

💬 Join the Nitro Discord for discussions and to report any issues you encounter with Nitro v3 alpha.

🌟 What’s new?

🔥 Rolldown-optimized

We optimized all internal and built-in Nitro plugins and configurations for first-class Rolldown support. We recommend that everyone migrate to rolldown and vite@beta, powered by rolldown.

Tip

Upgrade to the latest Nitro v3 with vite@beta (rolldown) and enjoy a seriously mind-blowing performance boost 🚀

📦 Dependencies are bundled by default

Nitro always generates an optimized and portable build output, containing all of your production dependencies.

Previously, all dependencies were copied (traced) into .output/server/node_modules unless configured to be inlined (bundled).

After adopting Rolldown, we found that bundling produces a more optimized and predictable output, but also is WAY faster to bundle dependencies with Rolldown rather than tracing (copying) them. Nitro now bundles dependencies by default using Rolldown (or Rollup).

Nitro has a built-in list of known dependencies with native Node.js bindings or incompatibilities. Only those dependencies are traced.

Tip

If you need to trace additional dependencies that are incompatible with bundling, use the new traceDeps: [] config option to mark them as traced.

⚛ React Server Components Support

Thanks to @hi-ogawa, you can now use Nitro with @vitejs/plugin-rsc.

Tip

Cheeckout vite-rsc example for demo.

⬆️ Migration

We have added an experimental feature to support path aliases from tsconfig.json. The experimental flag is now disabled by default.

With vite@beta, you can use rolldown's native support:

import { defineConfig } from "vite"; 
import { nitro } from "nitro/vite";

export default defineConfig({
  plugins: [ nitro({ serverDir: "./server" })],
  resolve: { tsconfigPaths: true } // requires vite@beta
});

Changes

⚠️ Behavior Changes

  • Resolve virtual templates with single plugin (#3819)
  • Remove nodeModulesDirs (#3798)
  • Overhaul externals support (#3799)
  • Opt-in experimental.tsconfigPaths (#3859)
  • Remove nitro/deps/* (#3878)

🚀 Enhancements

  • Enable native WASM support by default (#3781)
  • Add manifest.deploymentId (#3792)
  • vercel: Support skew protection (#3787)
  • Export ServerRequest from nitro/types (#3785)
  • netlify.config options namespace (#3794)
  • Add serverEntry config (#3795)
  • _lib chunks (#3849)
  • cloudflare: Support exports.cloudflare.ts (#3834)
  • Mock runtime virtual imports (#3861)
  • Support renderer: false config (#3822)
  • Allow custom ignore patterns for public assets (#3883)
  • vite: Experimental React Server Components (RSC) support (#3919)
  • Automatically trace known native packages (#3923)
  • vite: Auto-register server consumer environments as services (#3928)
  • cloudflare: Always augment request with cf context (#3904)
  • vercel, netlify, cloudflare: Support req.ip (#3952, #3946)
  • Support rolldownConfig (#3887)

🔥 Performance

  • Resolve virtual templates with a single plugin (#3819)
  • Use filters for plugin hooks (#3820)
  • Remove nodeModulesDirs (#3798)
  • Disable externals if there is no include pattern (b407ed68)
  • vite: Add filter hooks for virtual imports (effb2c6b)
  • Reduce virtual dep plugin impact (#3879)
  • vite: Patch assets plugin for hook filters (8872365b)
  • rolldown: Improve tree-shaking (ced5469f)
  • Lazy import unimport (e20c92d9)
  • Process static assets in parallel (#3911)

🩹 Fixes

  • vite: Detect when SSR entry points to same file as server entry (#3796)
  • deno: Always mark node: imports as external (1d48539f)
  • raw: Generate simple sourcemap (87e718da)
  • vite: Improve dev middleware (#3804)
  • vite: Skip nitro middleware on mounted paths (#3805)
  • aws-lambda-streaming: Handle empty body (#3814)
  • vite: Skip early dev handler for special prefixes (#3817)
  • rolldown: Log dev build errors (e08dbb32)
  • Update oxc-transform import (6382d116)
  • rolldown: Set platform config (cd142cc3)
  • vite: Remove bundler conditions for externalConditions (28aa37cd)
  • vite: Remove custom noExternal for server envs (d34a0450)
  • vite: Temporary workaround for react bundling (9b276e11)
  • dev: Remove transfer-encoding header from worker (33acd73f)
  • vercel: Handle ISR requests with passQuery: true (#3851)
  • Properly compile wildcard only optimized route rule (22a293c5)
  • Update import to nitro/meta (8039866b)
  • Externals windows paths (4d2e6b8a)
  • Handle oxc transform errors (4754f28d)
  • Virtual routes (#3862)
  • Cache nitro app instance in global (c3761400)
  • app: Unique prerender app id (1b1bcec7)
  • app: Improve instance caching (23a6c8f8)
  • app: Isolate instance per build (2e108f51)
  • task: Use http.request to support socketPath in dev fetch (#3268)
  • cli: Respect devServer config (#3881)
  • Handle void hook result (7f42bc15)
  • Use module condition and main fields for bundling (#3886)
  • Cache rou3 compilation by options hash (#3890)
  • openapi: Only filter undefined from array nodes (#3894)
  • vite: Kill prerenderer child process when the vite preview server closes (#3907)
  • vite: Wait on preview child port to be ready (#3908)
  • vite: Trap unhandled errors in worker (301604f8)
  • dev: Respect opts.json when false for error handler (#3920)
  • vercel: Add preview command (#3921)
  • Collect errors in utils/parallel (#3933)
  • Force trace pg dependency (0e06c714)
  • Avoid naming node_modules/.* as lib chunk (22bd0c63)
  • Use static replacement for websocket feature (#3964)

💅 Refactors

  • Improve output chunk names (#3780)
  • Overhaul externals support (#3799)
  • Env runners ([#3836](h...
Read more

v2.13.1

15 Jan 12:37
@pi0 pi0

Choose a tag to compare

compare changes

This release mainly updates dependencies (696dc3a9)

  • h3@1.15.5 released with security fix (release notes)
  • unstorage@v1.17.4 released with chokidar, lru-cache, and h3 dependency bumps (release notes)

v2.13.0

08 Jan 22:16
@pi0 pi0
0874039

Choose a tag to compare

compare changes

🚀 Enhancements

  • vercel: Add support for skew protection (#3850)
  • bun: Support NITRO_BUN_IDLE_TIMEOUT env variable (#3294)

🔥 Performance

  • Process static assets in parallel (#3910)
  • Limit concurrency for compressing public assets (#3384)

🩹 Fixes

  • firebase: Update gen 1 import to match latest sdk (28406449)
  • Correct crypto polyfill (5caca6c0)
  • vercel: Handle ISR requests with passQuery: true (#3539)
  • dev: Automatically use Content-Encoding: gzip for .gz static files (#3381)
  • static: Add vary: accept-encoding for assets with compressed version (#3443)
  • dev: Respect opts.json when false for error handler (#3920)
  • dev: Apply headers from route rules for static assets (c74d7a17, f059e4ba, be316b49)
  • vercel: Avoid adding o11y links for prerendered paths (#3927)
  • cloudflare-durable: Expose env bindings in durable handler (#3931)

💅 Refactors

q

  • Update firebase-functions type import (d27fbe86)

📖 Documentation

  • Add versions select (#3855)
  • Fix compatibilityDate value (#3570)

📦 Dependencies

🤖 CI

  • Avoid bumping h3 to nightly (0b5a9c37)
  • Correct ref check for nightly (de8d24c4)

❤️ Contributors

v3-alpha.1

10 Nov 18:42
@pi0 pi0

Choose a tag to compare

compare changes

🌟 Highlights (since alpha.0)

  • Fully supporting rolldown and rolldown-vite
  • Even smaller: install size is down to 9MB with ongoing efforts to reduce more
  • Runtime performance can get close to 98% of native performances (tested with standard preset on Bun)
  • We have bunch of fresh examples
  • Removed lots of old hacks, fixed stability issues
  • WebSockets supported
  • Vite plugins can extend Nitro (RFC)

Join Nitro Discord Server if you have feedbacks and ideas!

🚀 Enhancements

  • vite: Support ?assets import (#3662)
  • vercel: Support Bun runtime (#3678)
  • vite: HMR client when server routes change (#3700)
  • vercel: Add back node handler format under a flag (#3709)
  • vite: Interoperability between nitro modules and vite plugins (#3712)
  • Support node handler format (#3717)
  • routes config (#3718)
  • Opt-in filesystem routing using serverDir config (#3719)
  • vite: rolldown-vite support (#3723)
  • routing: Use baseURL config (#3724)
  • Export defineConfig and runtime utils from "nitro" (#3726)
  • Server fetch utils (#3731)
  • vite: Load dot env in preview mode (#3735)
  • Improve build info loading (#3743)
  • vercel: Switch to node compat if one handler format is node (#3749)
  • Automatically detect deno and bun as preset (#3750)
  • nitro/tsconfig preset (#3754)
  • core: Autoload project tsconfig.json for aliases and JSX options (#3757)
  • ⚠️ Migrate to oxc-transform and oxc-minify (#3763)
  • renderer.static config (#3765)
  • Websocket Support (#3766)
  • cloudflare: Enable nodeCompat and deployConfig by default (#3768)
  • Auto detect builder (making rollup optional) (#3769)
  • Improve sourcemap support (disabled by default) (2753e1cf)
  • cloudflare: Enable no_bundle by default (6d7c4b0f)
  • cli: Support nitro build --builder (07b725f5)

🔥 Performance

  • Upgrade hookable (#3684)
  • app: Tree-shake extra routing logic when not needed (#3685)
  • Reduce error handler bundle impact (af7f1565)
  • app: Tree-shake extra condition (74134d25)
  • standard: Only accept standard req (6420d784)
  • app: Directly passthrough req (13f66ac2)
  • Tree-shake plugins and hooks when not used (#3698)
  • Reduce nitroApp.fetch() overhead (#3699)

🩹 Fixes

  • vite: Skip pre nitro middleware if path has extension (#3649)
  • cloudflare: Properly resolve dev plugin (3afbc402)
  • vite: Remove noExternal: true from each service build (#3665)
  • build: Avoid replacing unexpected words (#3671)
  • cloudflare: Add cloudflare:workers alias in dev (#3663)
  • Support autoimports typeFrom property for declaration gen (#3670)
  • vite: Call rollup:before hook in dev mode for compatibility (2d199369)
  • vite: Consistently call rollup:before. after resolving config (aec6dd26)
  • Add hookable sub-dep to runtimeDependencies (5349f852)
  • rolldown: Pass minify option (264ba29b)
  • vite: Always enable noExternal for prod (cdeb667d)
  • Automatically add bun and deno export conditions (#3695)
  • vercel: Move bun detection to earlier stage (b34f0492)
  • vite: Disable cors in dev (#3692)
  • app: Unwrap _request without in operator (7fcd1568)
  • Handle sync callHook value (d3b720f0)
  • Improve internal dependency resolution (#3702)
  • node, bun, deno: Add back unhandled error/rejection traps (#3710)
  • vite: Improvements on #3712 (#3712)
  • dev: Trap unhandled errors (#3710)
  • routing: Normalize and resolve handlers (15669702)
  • routing: Filter invalid final handlers (c1a3be05)
  • vite: Ignore invalid SSR env without entry (aefcdb31)
  • config: Resolve errorHandler config (16b10fb0)
  • rolldown, vite: Escape non-safe chars from chunkFileNames (491dc128)
  • vite: Set correct builder (fa27a9a2)
  • Retry last-build link once (25fa2e9e)
  • vite: Only pass transform options in rolldown mode (737f4e6e)
  • vite: Use configEnv.command to determine dev mode (#3730)
  • vite: Send full-reload to server (#3732)
  • vite: Update <!--ssr-outlet--> for prod (ebb040f3)
  • Apply baseURL to production assets (#3734)
  • vercel: Properly parse x-now-route-matches header (c0ee44bf)
  • cloudflare: Workround for rolldown minify issue (#3748)
  • Standard preset aliases (5419b335)
  • node, bun, deno: Use static import only (#3751)
  • vite: Use noExternal list for dev (#3761)
  • Resolve full path of strings in modules: [] (23f7bea2)
  • Add buildDir to noExternal (c21a33ba)
  • cloudflare: Push unenv externals preset to resolved config (5faf0f5e)
  • Make nitro/meta side-effect free (2292c661)
  • cloudflare: Only enable no_bundle for workers (not pages) (409ecf3c)
  • vite: Add route rules only if assetsDir generated (#3774)

💅 Refactors

  • vite: Avoid empty lines in CI and test (44b2f091)
  • vite: Show original plugin name/hook when failed (b0a49d41)
  • vite: Overhaul plugin setup (#3676)
  • vite: Enable back nf3 (57503e42)
  • vercel: Rename __fallback to __server (4aad3595)
  • rollup: Hide THIS_IS_UNDEFINED warn (5f6da290)
  • rolldown: Update transform config (3be802f2)
  • ESM imports with erasable syntax (#3704)
  • ⚠️ Cleanup deno, bun and node presets (#3705)
  • ⚠️ Remove defineRender util (#3706)
  • vite: Remove __VITE_MANIFEST__ (#3714)
  • ⚠️ Registe...
Read more

v2.12.9

28 Oct 13:26
@pi0 pi0

Choose a tag to compare

compare changes

🩹 Fixes

  • Set explicit delimiters to allow $ in replacements (#3689)

Enhancenments

  • vercel: Support bun runtime (#3678)

🏡 Chore

❤️ Contributors

v2.12.8

23 Oct 12:38
@pi0 pi0

Choose a tag to compare

compare changes

🩹 Fixes

  • build: Avoid replacing window$1 (#3672)
  • cloudflare: Add cloudflare:workers alias in dev (#3663)
  • Support autoimports typeFrom property for declaration gen (#3670)

🤖 CI

❤️ Contributors

v3 alpha

11 Oct 17:29
@pi0 pi0

Choose a tag to compare

v3 alpha Pre-release
Pre-release

This is the first version of the Nitro v3, marking a new milestone.

Check out new docs (WIP) for more info and stay tuned for the official blog post by next week.

v2.12.7

07 Oct 15:50
@pi0 pi0

Choose a tag to compare

compare changes

🩹 Fixes

  • vercel: Always add url to src regex for isr routes (#3595)

📦

  • Updated dependencies (diff)

❤️ Contributors

v2.12.6

11 Sep 15:22
@pi0 pi0

Choose a tag to compare

compare changes

🩹 Fixes

  • vercel: Better o11y for ISR cached routes (#3560, bde8ce85)
  • vercel: Generate prerender config for o11y routes matching isr route rule (#3562)
  • vercel: Skip o11y routes matching isr route rule (#3563)
  • vercel: Move / ISR route before wildcard matches (81c2f9cd)

❤️ Contributors

v2.12.5

02 Sep 08:57
@pi0 pi0

Choose a tag to compare

compare changes

🩹 Fixes

  • vercel: Prefix o11y routes with baseURL (5c58de9b)
  • Allow accessing VFS through unix sockets (#3533)
  • cloudflare-module: Output _headers file to the correct directory (#3517)
  • bun: Respect HOST and NITRO_HOST (#3547)

💅 Refactors

  • vercel: Rename __nitro function to __fallback (#3502, 4b28c706)
  • vercel: Update function config types (#3505)
  • cloudflare: Update node-compat (#3558)

📖 Documentation

  • vercel: Minor improvements (#3498)
  • Deprecate edgio preset (#3509)

📦 Build

  • Remove @netlify/functions dependency (#3556)
  • Update node engine to ^20.19.0 (#3557)

🏡 Chore

  • Update @vercel/nft to 0.30 (97ff9d5e)
  • Update pretty-bytes and unplugin-utils (d847547f)

❤️ Contributors