Releases: nitrojs/nitro
v2.5.1
📖 Documentation
- Fix typo in Flightcontrol deployment option (#1332)
📦 Build
- Avoid doubly-bundling runtime types (#1334)
🌊 Types
- Avoid overriding app runtime config namespace (#1333)
❤️ Contributors
- Daniel Roe [email protected]
- ModupeD
v2.5.0
⭐ What is new?
- Type generics supported for
useStorageanduseRuntimeConfigand lots of more type safety enhancements across ecosystem - UnJS ecosystem packages upgraded to the latest versions with lots of bug fixes and enhancements
- With
[email protected]we are now experimenting response streaming support (Demo).
🚀 Enhancements
- Allow customising generated
tsConfig(#1266) - Type
useRuntimeConfigwithNitroRuntimeConfig(#1311) - Type nitro app runtime hooks (#1316)
- Add
cloudflare-pages-staticpreset (#1310) - Add experimental
deno-serverpreset (#592) - Add
flightcontrolpreset (#970, #1250) - Support
jsxandtsxout of the box (#1303) - Add support for
failOnError(#1294) - Generic type support for
useStorage(#1279) - Provide static
process.*andimport.meta.*build flags (#1331)
🩹 Fixes
- bun: Resolve internal dependencies with
bunexport condition (#1313) - deno: Support environment variables (88b4e11)
- Respect
staticflag when auto-detecting preset (#1321) - prerenderer: Don't inherit
staticconfig (#1324) - vercel: Add check for index route rule (#1290)
- Use
event.handledguard before sending direct responses (#1326) - Import
NitroRuntimeHooksfrom runtime dir (#1328) - Generate types for
#imports(#1329)
📖 Documentation
- Update
docusversion (848c86a) - Update
cloudflare-pagespreset (#1304) - Add an example for
devHandlersconfig (#1295)
❤️ Contributors
- Pooya Parsa (@pi0)
- 魔王少年 (@maou-shonen)
- Daniel Roe [email protected]
- Andrew [email protected]
- Estéban (@Barbapapazes)
- Dunqing (@Dunqing)
- Frantz Kati [email protected]
- Mike Laumann Bellika
- Sébastien Chopin (@Atinux)
- Hebilicious (@Hebilicious)
- Michael J. Roberts (@michealroberts)
v2.4.1
⬆️ How to Upgrade?
- Make sure to recreate the lock file as well in order to receive all UnJS ecosystem updates.
- If you are using Nitro via Nuxt, simply use
npx nuxi@latest upgrade --force.
🩹 Fixes
- pkg: Add
http-proxytypes to deps (#1213) - vercel-edge: Use platform provided
processshim (392ce64) - netlify-edge: Update output format (41a4a6a)
- netlify-edge: Support environment variables (5c85c14)
- netlify-edge: Handle static asset urls (116874f)
- netlify-edge: Fix body handling (4c825b6)
- vercel-edge: Fix body handling (c75c2f1)
- deno, lagon, sw: Fix request body handling (1c88e5e)
- netlify-edge: Polyfill missing
x-forwarded-protoheader (4e5f46e)
🏡 Chore
- Update dependencies (c4fcd78)
❤️ Contributors
- Pooya Parsa (@pi0)
- Daniel Roe [email protected]
v2.4.0
⬆️ How to Upgrade?
If you are directly using Nitro, make sure to recreate lockfile as well in order to receive all UnJS ecosystem updates.
If you are using Nitro via Nuxt, simply use npx nuxi@latest upgrade --force.
⭐ What is new?
isr route rule
Vercel and Netlify route rules support a dedicated isr flag to enable Incremental Static Regeneration.
For backward compatibility, we keep converting swr and static route rules to isr for these two presets. If you were previously depending on swr and static route rules, we highly recommend to upgrade nitro and switch to isr flag:
routeRules: {
-- '/blog/**': { swr: 3000 },
++ '/blog/**': { isr: 3000 },
}If you like to leverage Nitro Native SWR cache (stored in storage), you can opt-in using future.nativeSWR: true (nuxt: nitro.future.nativeSWR) config.
Vercel KV Storage
In collaboration with the Vercel team, Nitro now supports seamless integration with Vercel KV Store. See docs for usage information.
Cloudflare Module Worker Preset
You can opt-in to the new Cloudflare Module Worker output format.
The cloudflare pages preset is also upgraded to the worker format with this release
First-class static targets
While Nitro is a server builder, it can be also used to prerender all routes using a renderer and output only static output. New static ,vercel-static, netlify-static and github-pages presets are now available to only output prerender and skip the production server build.
Config HMR support
You can now directly edit route rules and runtime config within nitro.config without the need to restart the nitro server! See #1175 for more information.
Dynamic App Config and Runtime Config
Previously, both useAppConfig() and useRuntimeConfig() were returning a frozen object. Now using useAppConfig(event) and useRuntimeConfig(event) you can have a fully dynamic interface, enabling dynamic, per-request config and support for environments such as Cloudflare where env is only available during the request lifecycle.
If you were previously using useAppConfig() and useRuntimeConfig() in an ambient context (outside of event handlers and composable functions, we highly recommend to migrate to the new API:
-- const appConfig = useAppConfig()
export default eventHandler(event => {
++ const appConfig = useAppConfig(event)
})See #1154 for more information.
Experimental Swagger and Open API support
Swagger and OpenAPI are de facto standard tools for documenting server API routes. You can now see all auto-generated API docs by enabling experimental.openAPI: true (nuxt: nitro.experimental.openAPI: true) and opening /_nitro/swagger UI.
See #1162 for more information.
We are working to bring route-level meta definition for an even better and more detailed docs generator.
New Documentation and Branding
Nitro docs and logo are live with a new fancier design at nitro.unjs.io
🚀 Enhancements
- Add Cloudflare module worker support (#681)
- vercel, netlify: Introduce
isrroute rule (#1124) - Add
staticpreset (#1127) - Add
vercel-staticandnetlify-staticpresets (#1073) - Add
github-pagespreset (#1133) - Pass resolved config to
rollup:beforehook (#1160) - Config reload support for
nitro dev(#1173) - Config hmr support for
routeRulesandrutimeConfig(#1175) - Support dynamic app config and runtime config (#1154)
- Experimental
/_nitro/openapi.jsonand/_nitro/swaggerfor dev mode (#1162) - vercel: Add support for specifying edge regions (#1192)
future.nativeSWR(#1212)
🔥 Performance
- Export
defineNitroConfigfromnitro/config(#1174)
🩹 Fixes
- Separate
typesDirfromtsConfigDir(#1146) - cloudflare: Expose env from module context (#1147)
- proxy: Append request query params for single proxy route rules (#1163)
- vercel, netlify: Keep default behavior for
staticandswrtoisrmapping (#1155) - Apply
chunkFileNameson windows (#1189) - pkg: Allow installing on node v20 and above (#1204)
💅 Refactors
📖 Documentation
- Fix typo (#1131)
- Update serverAssets example (#1156)
- Add edge releases channel (2793f51)
- get-started: H2 instead of h3 (ff3964e)
- routing: Add route rules (46740e6)
- routing: Add missing import (30675d4)
- Fix syntax issue in guide > storage (#1180)
- Update (1e5bb86)
- Fix typo (#1185)
- Fix typo (#1190)
- vercel: Add vercel kv storage section (#1210)
- Update branding (#1188)
- Update vercel-storage (ffff9db)
✅ Tests
- Enable
vercel-edgetest (7951532)
❤️ Contributors
- Pooya Parsa (@pi0)
- Sébastien Chopin (@Atinux)
- Daniel Roe [email protected]
- AaronBeaudoin [email protected]
- Oumar Barry (@oumarbarry)
- G-Cyrille
- 魔王少年 [email protected]
- Iho Somnam [email protected]
- Timhanlon [email protected]
v2.3.3
🚀 Enhancements
- Upgrade to consola v3 (release notes)
🩹 Fixes
- prerender: Show generated routes with error in logs (8e06f2e)
- prerender: Respect output path from main preset (#1114)
📖 Documentation
- Fix typos in storage and cache guides (#1086)
- Use unjs logo (#1104)
- Fix typo in cachedEventHandler options (#1110)
- Use consistent quotes in the routeRules example (#1108)
- Fix typo in server assets mount point (#1119)
- Improve
publicAssetsconfig details (#1102) - Fix small typo in plugin filename (#1081)
❤️ Contributors
- Pooya Parsa (@pi0)
- Gabriel Cipriano (@gabrielcipriano)
- Daniel Roe [email protected]
- Yassine El Ouazzani (@kwarkjes)
- Inesh Bose
- Andre Hammons
- Michael BOUVY [email protected]
v2.3.2
🩹 Fixes
- Sanitize
statusMessageof disallowed chars (#1057) - types: Sync vercel build config types (#1056)
- azure: Support custom baseURL (#1062)
- vercel-edge: Fix route generation (#1071)
- Mark
options.rendereras optional (#1069) - types: Make $Fetch types less complex (#1059)
💅 Refactors
- Add type safety to auto-detected providers (#1072)
📖 Documentation
❤️ Contributors
- Mahdi Boomeri [email protected]
- Daniel Roe [email protected]
- Shohei Maeda
- Lucas (@Draichi)
- Nobkd
- Honza Pobořil [email protected]
v2.3.1
🩹 Fixes
- types: Don't simplify type of serialized return (#1050)
🏡 Chore
- Add
codecov.yml(6fe7f64)
❤️ Contributors
- Pooya Parsa (@pi0)
- Daniel Roe [email protected]
v2.3.0
🚀 Enhancements
- vercel: Add functions config (#976)
- Add support for
sourceMapvalueshiddenandinline(#998) - lagon: Write
.lagon/config.jsonon build (#996) - types: Type $fetch to match json serialization output (#1002)
- Support base in
useStorage(base?: string)and improve docs (#1012) - cloudflare-pages: Rewrite with module syntax (#1004)
- Allow customising generated tsconfig path (#1021)
- Support app config (#1022)
🩹 Fixes
- cloudflare-pages: Only allow 100 rules combined (#973)
- Only mock
debugin production (#990) - Scan middleware and print tree list in ascending alphabetical order (#981)
- externals: Correctly specify multiple external dependencies in package.json (#1013)
- static: Use correct format for last modified (#1017)
- cache: Remove rejected cache promise from pending list. (#995)
- Expose
useStoragewith types (#1026) - prerender: Allow spaces in
hrefvalue regex (#1030) - cache: Use stale value by default when
swris enabled (#1038) - Resolve types relative to custom tsconfig path (#1041)
- Remove duplicate import in generated code (#1043)
- types: Exclude non serializable options from route rules (#1047)
💅 Refactors
📖 Documentation
- Update to latest docus and various improvements (#975)
- Up docus and add back ellipsis (38b1f34)
- Remove tailwind module (b3b7e87)
- lock: Update (7efa31f)
- More improvements (#985)
- Remove fluid layout (d83f2b6)
- Update color (18674c5)
- Add unjs icon in footer (6d36ceb)
- Update docus (5fcc127)
- Add button to open on CodeSandBox (ad120ac)
- Update deployment example for configuration (#972)
- Update dependencies (c923fed)
- cache: Improve documentation and
cachedFunctiondefault options (#1011) - Improve readme and getting started (94d95fa)
- Fix on mobile long path (1d2f57e)
- Improvements (f78619f)
- Add
prerender.ignoredescription (#1032) - Improve configuration page (554b358)
- Improve plugins section (f36a6e0)
- Update readme (c58a764)
- Update homepage hero (b848e5a)
- Update meta tags (70f00e5)
- More improvements (#1039)
- Update docus version (f31240b)
- Upgrade docus (a6ce587)
- deploy/workers: Fix typo of bundle (#1046)
🏡 Chore
- readme: Various improvements (#1009)
- Fix tests (#1014)
- docs: Use pnpm (39f117a)
- Add autofix-ci action (8f9c3e2)
- Remove old docs commands (#1042)
- Update dependencies (02c48f2)
- Maintain lockfile (ac81602)
- Use single undici version for testing (00743bc)
❤️ Contributors
- Pooya Parsa (@pi0)
- Daniel Roe [email protected]
- Felix De Montis [email protected]
- Sébastien Chopin (@Atinux)
- Hannes Küttner [email protected]
- Julie Saia
- Ted De Koning
- Jan Johansen [email protected]
- Tobias Diez [email protected]
- Elian ☕️ [email protected]
- Mahdi Boomeri [email protected]
- Anthony Fu [email protected]
- Tom Lienard (@QuiiBz)
- Alex Korytskyi (@alex-key)
- Shohei Maeda
v2.2.3
🚀 Enhancements
- Add lagon preset (#964)
🩹 Fixes
- node-cluster: Default number of workers (#963)
- cloudflare-pages: Exclude assets from function call (#965)
- cloudflare-pages: Handle assets only for get requests (#968)
- Render json errors for cors requests (#969)
- Use json response for errors in
/api/routes (#971)
💅 Refactors
- externals: Sort
bundledDependencieskeys in outputpackage.json(#967)
📖 Documentation
- cloudflare: Add info regarding
runtimeConfigand environment variables (#958) - Prevent ellipsis overflow on small screens (#956)
- deploy: Add workers page for edge limitations (#953)
🏡 Chore
❤️ Contributors
- Pooya Parsa (@pi0)
- Daniel Roe [email protected]
- Jan-Henrik Damaschke [email protected]
- Bogdan Kostyuk [email protected]
- Hminghe (@hminghe)
- Alexander Lichter (@manniL)
v2.2.2
🩹 Fixes
- Correct
access-control-allow-methodscors header name (#944) - Allow overriding assets
maxAgeusing route rules (db6e6c2) - rollup: Use mlly as fallback resolver when externals disabled (#948)
- Don't render json response if url contains
/api/(#951)
🏡 Chore
✅ Tests
- vercel: Move custom test to additional tests (fb361f8)
❤️ Contributors
- Pooya Parsa [email protected]
- Daniel Roe [email protected]