Releases: nitrojs/nitro
v2.13.3
📦 Dependency Updates
| Package | From | To |
|---|---|---|
httpxy |
^0.3.1 | ^0.5.0 |
h3 |
^1.15.9 | ^1.15.10 |
esbuild |
^0.27.4 | ^0.27.5 |
rollup |
^4.59.0 | ^4.60.1 |
@vercel/nft |
^1.4.0 | ^1.5.0 |
c12 |
^3.3.3 | ^3.3.4 |
citty |
^0.2.1 | ^0.2.2 |
defu |
^6.1.4 | ^6.1.6 |
globby |
^16.1.1 | ^16.2.0 |
listhen |
^1.9.0 | ^1.9.1 |
unstorage |
^1.17.4 | ^1.17.5 |
cookie-es |
^2.0.0 | ^2.0.1 |
youch |
^4.1.0 | ^4.1.1 |
v2.13.2
Note
This release upgrades h3 to latest 1.15.9 which contains security fixes.
🩹 Fixes
- prerender: Skip writing routes with
..or outside of public dir (81f76800) - prerender: Mark invalid routes as skipped (9cb795c7)
📖 Documentation
- Fix icon assets (#4022)
Preset Changes
- vercel: Add types and docs for
isr.exposeErrBody(f7753152)
❤️ Contributors
v3.0.260311-beta
🚀 Enhancements
- Add non bundlable dependencies from nf3 db (a8c8cbaa)
- vite: Use srvx loader for preview (#3999)
- Support zstd for compressPublicAssets (#3934)
- vercel: Rewrite
proxyroute rule on cdn (#4006) - tasks: Expose req and waitUntil in context (#4037)
nitro preview(#4024)nitro deploycommand (#4042)- vite: Auto-detect client entry (#4059)
- vite: Auto-detect client entry " (#4059)
- Use unjs/env-runner (#4088)
- vite: Respect vite
modefor env loading (#4082) - route-rules: Basic auth (#4049)
- vite: Support preview (#4090)
- Export http utils from
nitro(#4097)
🔥 Performance
- Optimize duplicate handler filtering (#4003)
🩹 Fixes
- vite: Remove chunk config when
inlineDynamicImportsenabled (3c506bba) - vite: Merge bundler config first before normalize (64df4cfd)
- Use
virtual:prefix for raw plugin for vite compatibility (dfdff9e9) - Support PORT=0 for random port assignment (#4000)
- Remove deprecated
inlineDynamicImportsfrom rolldown config (bbe5a7a0) - vite: Remove
keep-aliveheader from worker (150b6f91) - vite: Set
copyPublicDir: falseby default (#4005) - vercel: Fix preview mode compat with srvx (#4011)
- RolldownConfig.output is optional (d3b1f7b3)
- Avoid adding extra additional export conditions (#4029)
- Also avoid inferring
bunanddenofrom runtime (09d6aa6d) - Preserve sourcemap mappings for chunks containing user code (#4031)
- Sync routes after scan handlers (#4033)
- prerender: Skip writing routes with
..or outside of public dir (50b3bc5b) - vite: Don't send browser full-reload for ssr-only changes (#4034)
- Escape scanned route url param names (7a5d536f)
- vite: Avoid adding duplicate nitro plugins when using
nitro build(0da93bd3) - Make error handlers consistent with h3 (#4055)
- static: Only append Vary: Accept-Encoding after a static asset match (#4075)
- vite: Run scheduled tasks during vite dev (#4076)
- config: Apply $production/$development layers when NODE_ENV is unset (#4066)
💅 Refactors
- Add
rolldownas dependency (#4002) - runner: Use
node:httpto fetch worker (#4004) - Improve output chunk names (#4027)
- Use
proxyFetchfrom httpxy (118e77ac) - Update worker addr types (d832f3ce)
- Use isolated declaration for runtime (d06b90b1)
- Use new httpxy features (bbf2808e)
- config: Improve builder auto-detection logic (#4058)
- Migrate to unjs/ocache (#4087)
- vite: Use
sec-websocket-protocolto detect Vite WS connection (#4098)
📖 Documentation
- cloudflare: Remove invalid docs and add note about wrangler env (#3978)
- Fix lifecycle link on renderer page (#3992)
- Add code splitting section (#3991)
- Add examples (#3984)
- Add Zephyr Cloud deploy docs (#4092)
- Prepare for v3 beta (#4091)
- Fix link to v2 (5ea3e153)
- cloudflare: Fix env bindings access pattern for Nitro v3 (breaking change) (#4064)
📦 Build
- Remove rolldown from peer deps (5cb673ed)
- Update c12 and remove jiti dep (ade3568e)
- Add jiti as an optional peer dep (6135a8b8)
- Add windows backslash to regexes (9ad2aae7)
- Add
dotenvto optional peer deps (1f3e6d2d) - Add giget to optional peer deps (99f7fe3d)
- Move
hookableto dependencies and fix plugin hook docs (#4014) - Bundle docs as skill +
nitro docs(#4084)
🌊 Types
- Mark output config as non nullable (eb8d7f7d)
Preset Changes
- vercel: Add support for node@24 (#3967)
- aws-lambda: Avoid modifying response headers in streaming mode (#3974)
- vercel: Add types and docs for
isr.exposeErrBody(f0f97cd1) - vercel: Integrate with scheduled tasks (#4030)
- vercel: Add framework info to build output config (#4032)
- cloudflare: Integrate with scheduled tasks (#4046)
- Add
zephyr(#4038)
❤️ Contributors
- Pooya Parsa (@pi0)
- Ruan-cat (@ruan-cat)
- Néstor (@Nsttt)
- Rihan Arfan (@RihanArfan)
- Jared Grimes
- Manuel Schiller (@schiller-manuel)
- Kricsleo (@kricsleo)
- Abdelrahman Awad (@logaretm)
- Renan Tatsuo (@renantatsuo)
- Wade Fletcher (@wadefletch)
- Sandro Circi (@sandros94)
- Haruaki OTAKE (@aaharu)
- Oskar Lebuda (@OskarLebuda)
- Max
- @iiio2](https://github.com/iiio2)
- MiniDigger
- João Vitor (@jvitormelo)
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...