Releases: nitrojs/nitro
v3.0.1-alpha.2
🔋 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
ServerRequestfromnitro/types (#3785) netlify.configoptions namespace (#3794)- Add
serverEntryconfig (#3795) _libchunks (#3849)- cloudflare: Support
exports.cloudflare.ts(#3834) - Mock runtime virtual imports (#3861)
- Support
renderer: falseconfig (#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
cfcontext (#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-transformimport (6382d116) - rolldown: Set
platformconfig (cd142cc3) - vite: Remove bundler conditions for
externalConditions(28aa37cd) - vite: Remove custom
noExternalfor server envs (d34a0450) - vite: Temporary workaround for react bundling (9b276e11)
- dev: Remove
transfer-encodingheader 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.requestto supportsocketPathin dev fetch (#3268) - cli: Respect
devServerconfig (#3881) - Handle void hook result (7f42bc15)
- Use
modulecondition andmainfields for bundling (#3886) - Cache
rou3compilation by options hash (#3890) - openapi: Only filter
undefinedfrom 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.jsonwhenfalsefor error handler (#3920) - vercel: Add preview command (#3921)
- Collect errors in utils/parallel (#3933)
- Force trace
pgdependency (0e06c714) - Avoid naming
node_modules/.*as lib chunk (22bd0c63) - Use static replacement for websocket feature (#3964)
💅 Refactors
v2.13.1
This release mainly updates dependencies (696dc3a9)
h3@1.15.5released with security fix (release notes)unstorage@v1.17.4released withchokidar,lru-cache, andh3dependency bumps (release notes)
v2.13.0
🚀 Enhancements
- vercel: Add support for skew protection (#3850)
- bun: Support
NITRO_BUN_IDLE_TIMEOUTenv variable (#3294)
🔥 Performance
🩹 Fixes
- firebase: Update gen 1 import to match latest sdk (28406449)
- Correct
cryptopolyfill (5caca6c0) - vercel: Handle ISR requests with
passQuery: true(#3539) - dev: Automatically use
Content-Encoding: gzipfor.gzstatic files (#3381) - static: Add vary: accept-encoding for assets with compressed version (#3443)
- dev: Respect
opts.jsonwhenfalsefor 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-functionstype import (d27fbe86)
📖 Documentation
📦 Dependencies
- Update
esbuildto 0.27 (a0176dfa) - Update
unwasmto 0.5 (85b057b8) - Update
@vercel/nftto v1 (5aeb9f89) - Update
@rollup/plugin-commonjsto v29 (58d2ff13) - Update
@rollup/plugin-aliasto v6 (3f493325) - Update
globbyto v16 (7b8da4c0)
🤖 CI
❤️ Contributors
- Pooya Parsa (@pi0)
- Ori (@oritwoen)
- Dmitry Istomin (@tirojal)
- Typed SIGTERM (@typed-sigterm)
- Daniel Roe (@danielroe)
- Oyama Michinoku (@yamanoku)
- WIP (@paulcrussell)
- Kricsleo (@kricsleo)
- Jamaluddin Rumi (@jamaluddinrumi)
- Sébastien Chopin (@atinux)
v3-alpha.1
🌟 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
?assetsimport (#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
nodehandler format (#3717) routesconfig (#3718)- Opt-in filesystem routing using
serverDirconfig (#3719) - vite:
rolldown-vitesupport (#3723) - routing: Use
baseURLconfig (#3724) - Export
defineConfigand 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/tsconfigpreset (#3754)- core: Autoload project
tsconfig.jsonfor aliases and JSX options (#3757) ⚠️ Migrate tooxc-transformandoxc-minify(#3763)renderer.staticconfig (#3765)- Websocket Support (#3766)
- cloudflare: Enable
nodeCompatanddeployConfigby default (#3768) - Auto detect builder (making rollup optional) (#3769)
- Improve sourcemap support (disabled by default) (2753e1cf)
- cloudflare: Enable
no_bundleby 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: truefrom each service build (#3665) - build: Avoid replacing unexpected words (#3671)
- cloudflare: Add
cloudflare:workersalias in dev (#3663) - Support
autoimportstypeFrom property for declaration gen (#3670) - vite: Call
rollup:beforehook in dev mode for compatibility (2d199369) - vite: Consistently call
rollup:before. after resolving config (aec6dd26) - Add hookable sub-dep to
runtimeDependencies(5349f852) - rolldown: Pass
minifyoption (264ba29b) - vite: Always enable
noExternalfor prod (cdeb667d) - Automatically add
bunanddenoexport conditions (#3695) - vercel: Move bun detection to earlier stage (b34f0492)
- vite: Disable cors in dev (#3692)
- app: Unwrap
_requestwithout 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
errorHandlerconfig (16b10fb0) - rolldown, vite: Escape non-safe chars from
chunkFileNames(491dc128) - vite: Set correct builder (fa27a9a2)
- Retry last-build link once (25fa2e9e)
- vite: Only pass
transformoptions in rolldown mode (737f4e6e) - vite: Use
configEnv.commandto determine dev mode (#3730) - vite: Send full-reload to server (#3732)
- vite: Update
<!--ssr-outlet-->for prod (ebb040f3) - Apply
baseURLto production assets (#3734) - vercel: Properly parse
x-now-route-matchesheader (c0ee44bf) - cloudflare: Workround for rolldown minify issue (#3748)
- Standard preset aliases (5419b335)
- node, bun, deno: Use static import only (#3751)
- vite: Use
noExternallist for dev (#3761) - Resolve full path of strings in
modules: [](23f7bea2) - Add
buildDirtonoExternal(c21a33ba) - cloudflare: Push unenv externals preset to resolved config (5faf0f5e)
- Make nitro/meta side-effect free (2292c661)
- cloudflare: Only enable
no_bundlefor workers (not pages) (409ecf3c) - vite: Add route rules only if
assetsDirgenerated (#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
__fallbackto__server(4aad3595) - rollup: Hide
THIS_IS_UNDEFINEDwarn (5f6da290) - rolldown: Update transform config (3be802f2)
- ESM imports with erasable syntax (#3704)
⚠️ Cleanup deno, bun and node presets (#3705)⚠️ RemovedefineRenderutil (#3706)- vite: Remove
__VITE_MANIFEST__(#3714) ⚠️ Registe...
v2.12.9
v2.12.8
v3 alpha
v2.12.7
v2.12.6
🩹 Fixes
- vercel: Better o11y for ISR cached routes (#3560, bde8ce85)
- vercel: Generate prerender config for o11y routes matching
isrroute rule (#3562) - vercel: Skip o11y routes matching
isrroute rule (#3563) - vercel: Move
/ISR route before wildcard matches (81c2f9cd)
❤️ Contributors
- Pooya Parsa (@pi0)
- Daniel Roe (@danielroe)
v2.12.5
🩹 Fixes
- vercel: Prefix o11y routes with
baseURL(5c58de9b) - Allow accessing VFS through unix sockets (#3533)
- cloudflare-module: Output
_headersfile to the correct directory (#3517) - bun: Respect
HOSTandNITRO_HOST(#3547)
💅 Refactors
- vercel: Rename
__nitrofunction to__fallback(#3502, 4b28c706) - vercel: Update function config types (#3505)
- cloudflare: Update node-compat (#3558)
📖 Documentation
📦 Build
🏡 Chore
❤️ Contributors
- Pooya Parsa (@pi0)
- MrlingXD (@wling-art)
- Adam DeHaven (@adamdehaven)
- Julien Huang (@huang-julien)
- Luke Nelson (@luc122c)
- Anthony Shew (@anthonyshew)