Releases: unjs/nitro
v2.9.7
Note
Release of Nitro 2.10 might little bit take longer (after Nitro 3.0 release) in order to make sure all major refactors are nonbreaking and tested enough. In the meantime, 2.9.7 adds important fixes.
Full changelog: v2.9.6...v2.9.7
🩹 Fixes
- github-pages: Prerender
/
by default (#2334) (8b5cbc5) - Deduplicate plugins (#2391) (4293b8b)
- Add
.tsx
and.jsx
to node-resolve extensions (#2398) (d2c0d74) - typescript: Set
compilerOptions.noEmit
to avoidtsconfig.json
warning (#2402) (6b6777e) - prerender: Only try to add
/
after prerender:routes hook (#2348) (fb88efd) - Pass custom entry filename when resolving prerenderer (#2461) (9bd6622)
- public-assets: Do not shadow paths that share prefix (#2516) (72db848)
- openapi: Update swagger-ui version to v5 for OpenAPI v3.1 support (#2343) (9e2cd8a)
- Convert
CapturedErrorContext
to interface to allow type augmentation (#2393) (45ff175) - renderer: Check full path for
/favicon.ico
placeholder (#2553) (b86bb45) - Use relative paths in
nitro-config.d.ts
(#2471) (4d70b75) - prerender: Extract links from explicit html routes (#2517) (e1f87c5)
- cloudflare-pages: Remove
.html
extension from generated_routes.json
(#2498) (79b85fe) - core: Resolve modules with esm compatibility (#2514) (4657ada)
- Update cli preset with esm module format (#2539) (f6f2327)
- types: Infer types correctly when method is omitted (#2551) (f76d21b)
- deno-server: Explicitly remove cert/key from options if either is not set (#2373) (d887f4a)
- azure: Correctly handle maxAge cookie option (#2403) (aabdc9c)
- netlify: Ensure preview command is correct (#2561) (d16a47b)
- iis: Deep merge configs (#2358) (f03addd)
- iis: Parse without explicitArray to allow merging
web.config
(#2457) (6c3e080) - vercel: Support custom baseURL (#2464) (61f2079)
- Lower-case accepted handler method (#2382) (e60e114)
- defineCachedEventHandler: Add
event.context.cache
(#2519) (fc3968b)
❤️ Contributors
- Pooya Parsa (@pi0)
- Sébastien Chopin (@Atinux)
- Leex (@jsonleex)
- Daniel Roe (@danielroe)
- Ariesly Ariesly.Mao@hotmail.com
- Julien Blatecky (@julien1619)
- Juho Rutila (@nice-game-hints)
- Maik Kowol (@94726)
- Julien Huang julien.huang@outlook.fr
- Yuurin (@byyuurin)
- Brandon Roberts (@brandonroberts)
- Ígor Jacaúna (@igorjacauna)
- Sby1ce (@sby1ce)
v2.9.6
🩹 Fixes
- Generate root/src directory aliases (#2318)
- externals: Skip resolving virtual ids start with
\0
(#2321) - types: Account for
undefined
value for$fetch
return type (#2327) - cloudflare-pages: Use predefined wildcards in
routes.exclude
(#2319)
📖 Documentation
- Remove outdated nightly warning (#2317)
❤️ Contributors
- Peter Graugaard git@graugaard.me
- Damian Głowala (@DamianGlowala)
- Pooya Parsa (@pi0)
- Daniel Roe (@danielroe)
- Stefan
v2.9.5
✅ Fixes and Improvements
- openapi: Add experimental
/_nitro/scalar
endpoint (#2252) - openapi: Use dynamic host + port (#2216)
- openapi: Add
schema
to generated parameters (#2235) - openapi: Avoid double slash for base (fdf7e70a)
- options: Set
scheduledTasks
to an empty object by default (#2285) - prerender: Call
nitroApp
close hook when done prerendering (#2287) - types: Return
T
fromSerialize
when it extendsundefined
(#2286) - raw: Exclude yaml from raw plugin (#2275)
- externals: Check explicit inline rules on resolved id (#2288)
- raw: Allow importing relative paths (#2289)
- types: Make c12 env types available for
NitroConfig
(#2292) - netlify-edge: Write
_headers
and_redirects
(#2291) - cloudflare-pages: Write
_headers
and_redirects
for non static builds (#2290) - netlify: Allow writing
config.json
(#2264) - Allow importing utils from
nitropack/runtime
(#2314) - openapi: Upgrade to openapi 3.1 (#2297)
- Use
.d.ts
for runtime generated types (#2313)
📖 Documentation
- routing: Add note about middleware execution order (#2282)
- routing: Fx link to h3 object syntax handler (#2281)
- Update tasks return value (8a62e7db)
- cache: Add a note for serverless environment (dc83a2e2)
- Fix typo (#2298)
❤️ Contributors
- Pooya Parsa (@pi0)
- Matt Kane matt.kane@netlify.com
- Hans Pagel
- Jamaluddin Rumi 16121031@student.mercubuana-yogya.ac.id
- Julien Huang julien.huang@outlook.fr
- Bobbie Goede bobbiegoede@gmail.com
- Damian Głowala (@DamianGlowala)
- Daniel Roe (@danielroe)
- Sébastien Chopin (@Atinux)
- Neil Richter (@noook)
- Samuel Burkhard sxburk@gmail.com
- Shoshana Connack (@moshetanzer)
- Yuurin (@byyuurin)
- Markthree (@markthree)
v2.9.4
🩹 Fixes
- Handle path negations when scanning public assets (#2250)
- pkg: Add
ioredis
as unstorage peer dependency (#2266)
📖 Documentation
- Fix server assets example path (#2248)
- Remove duplicate
integrity
key (#2246) - Fix wording (#2261)
- Remove nightly notice (39bc3f2e)
- tasks: Update dev server usage (#2240)
- cache: Add example usage for
cache.varies
(#2241)
❤️ Contributors
- Adam DeHaven (@adamdehaven)
- Neil Richter (@noook)
- Pooya Parsa (@pi0)
- Alexander Lichter (@manniL)
- KobZ (@devseckobz)
- Klein Petr petr@kleinpetr.com
- Daniel Roe (@danielroe)
v2.9.3
🩹 Fixes
- raw: Use mime to chck binary types and exclude
.json
(#2239)
📖 Documentation
- Fix typo (a445fae6)
❤️ Contributors
- Pooya Parsa pyapar@gmail.com
- Keigo Nakao (@kspace-trk)
v2.9.2
🩹 Fixes
- database: CamelCase the connector name (#2228)
- Respect
imports.autoImport: false
(#2226) - server-assets: Mark
yaml
,json
,json5
andcsv
as text (#2229) - import-meta: Import
process
fromnode:process
for node compatible builds (deno) (#2225)
📖 Documentation
- deploy: Add link to zero config providers (#2206)
- fetch: Fix typo (#2209)
- Fix typo (#2211)
- Fix typo (#2205)
- Remove lagon (#2204)
- Update url for experimental database feature (#2210)
- providers: Improve formatting & use new
undocs
components (#2202) - Improve cache page (674089b3)
❤️ Contributors
- Pooya Parsa (@pi0)
- Divy Srivastava (@littledivy)
- Alexander Lichter github@lichter.io
- Daniel Roe (@danielroe)
- Sébastien Chopin (@Atinux)
- Christian Preston (@cpreston321)
- Phan Khắc Đạo daopk.dev@gmail.com
- Maxime Pauvert (@maximepvrt)
- Jeff Galbraith (@hawkeye64)
- Rajeev R Sharma i.rarsh@gmail.com
- Julien Vanelian (@JulienVanelian)
- Gangan (@shinGangan)
v2.9.1
🩹 Fixes
- Dev:
remoteAddress
might be undefined forx-forwarded-for
(#2198) - Disable scheduled tasks in testing environment (#2200)
📖 Documentation
🤖 CI
- Skip
cloudflare-pages
test for windows (#2199)
❤️ Contributors
- Pooya Parsa pyapar@gmail.com
- Roman Nuritdinov (@Ky6uk)
- Stefan stefan.heim@hotmail.com
- Shoshana Connack
- manniL
v2.9.0
🎉 Released live from Vue.js Amsterdam
⭐ What is new?
🏃♂️ Nitro Tasks
All changes
🚀 Enhancements
- prerender: Support function/RegExp for
prerender.ignore
(#1966) - CLI: Show meta framework name on server build success (#1955)
- Presets: Add zeabur preset (#1942)
- Experimental nitro tasks (#1929)
- Add types:extend hook (#1715)
- Allow oveeridng nested runtime config with env (#1831)
- wasm: Universal support with esm import syntax (#2017)
- wasm: Migrate to unjs/unwasm (#2037)
- zeabur: Support zeaburStatic and auto detect preset (#2014)
- runtime-config: Experimental env expansion support (#2043)
- Support binary server assets (#2107)
- Experimental websocket support (#2170)
- dev: Expose upgrade handler (5374429f)
- Experimental database layer (#1351)
- Experimental scheduled tasks (#2179)
- cache: Support async shouldBypassCache and shouldInvalidateCache (#2181)
- prerender: Add total prerender time (#2130)
- Presets: Add koyeb preset (#1248)
- providers: Support alwaysdata hosting provider (#1790)
- routeRules: Allow wildcard redirects (#1976)
🩹 Fixes
- rollup: Avoid preserving relative externals (#1972)
- wasm: Directly generate chunk exports (#2003)
- iis-node: Correctly escape backslashes for port fix (#2020)
- deno-deploy: Shim
x-forwarded-for
andx-forwarded-proto
headers (#2026) - Add
baseURL
to openapi generated url (#2049) - dev: Correctly set
x-forwarded-*
headers (29ddd948) - azure: Add
18
and20
to supported node versions (#2077) - azure: Pass body to the context as-is (#2079)
- dev: Only mock consola in production (#2110)
- Default to bundler module resolution (#2120)
- Handle optional
routeHandler.route
in rollup chunk (#2152) - File extension stripping in
writeTypes
function (#2139) - cache: Detect malformed data read from storage (#2161)
- cacheEventHandler: Provide event.fetch and event.$fetch (#2066)
- module: Resolve modules with jiti directly (#2030)
💅 Refactors
- Include framework name in more build packages (#1973)
- cloudflare: Remove
--local
from perview commands (#1979) - cloudflare: Remove unused import (#1980)
- rollup: Improve generated chunk names (#2004)
- Use name exports in presets entry (1abfc3e5)
- Reimplement WASM plugin (#2031)
- Various improvements around tasks api (#2175)
- tasks: Stablize api (#2178)
- github-pages: Add
--dotfiles
to deploy command hint (#2158)
📖 Documentation
- routing: Update request filtering to match the type of getRequestURL (#1977)
- config: Fix
setResponseHeader
example params (#2027) - netlify: Add note to make sure publish dist is set to dist (#2035)
- cloudflare: Various updates, cleanups and fixes (#1981)
- presets: Deprecate
lagon
(17f922aa) - Update the routing page (#2085)
- Update the cache page (#2087)
- Close code-group in cache section (#2093)
- routing: Escape filename paths and prepend routes folder (#2097)
- storage: Fix unstorage links (#2101)
- routing: Fix typo for getRouterParam (#2098)
- Update the storage page (#2086)
- Add object syntax for event handler (#2091)
- Update the configuration page (#2083)
- Update the assets page (#2088)
- Create a page on built-in fetch (#2089)
- Add warning about azure functions stability (#2092)
- cloudflare: Update deployment guide (#2074)
- Fix icon of fetch page (#2115)
- Update getting started page (#2082)
- Fix links to /guide/auto-imports (#2131)
- Fix typo in defineCachedFunction example (#2133)
- Clarify difference between dir and baseURL (#2144)
- Migrate to undocs (#2163)
- index: Fix utils link (#2172)
- websocket: Fix typo (#2173)
- Fix typo (3017e6e2)
- vercel: Add monorepo info (#2183)
- Fix typo (#2182)
- cloudflare: Add local bindings usage (#2135)
- Fix link to h3 utils (#2184)
- deploy: Add platform.sh (#1630)
📦 Build
- Better dist chunk names (#2005)
✅ Tests
- cloudflare: Migrate to
miniflare
v3 (#2018) - Enable azure tests behind a flag (#2076)
- Enable binary response test for all presets (#2078)
- Avoid prerendering
icon.png
(cb220f7e)
🤖 CI
- Fix nightly release job condition (#1975)
❤️ Contributors
- Julien Huang julien.huang@outlook.fr
- Jasper Zonneveld
- M4dz (@m4dz)
- Dominik Opyd dominik.opyd@gmail.com
- Justin Ellingwood justin.ellingwood@gmail.com
- Connor Pearson cjp822@gmail.com
- Alexander Lichter (@manniL)
- David De Sloovere
- Dario Piotrowicz (@dario-piotrowicz)
- Balázs Németh
- Mehmet hi@productdevbook.com
- Markthree (@markthree)
- Arkadiusz Sygulski aareksio@gmail.com
- Jamaluddin Rumi jamal.rumi@icloud.com
- Pooya Parsa (@pi0)
- McPizza gh@l1.io
- Shoshana Connack
- Anthony Fu anthonyfu117@hotmail.com
- Jackson Tenclay
- Rihan (@RihanArfan)
- Remonke
- Daniel Roe (@danielroe)
- Estéban (@Barbapapazes)
- Gerard Wilkinson gerard.wilkinson@me.com
- Tobias Lebeitsuk
- Alexander (@cany748)
- Kasper Kronborg kasper@kronborg.info
- Gustavo Alfredo Marín Sáez aterbonus@gmail.com
- Alexandr
- Yuanlin Lin im.yuanlinlin@gmail.com
- Mcremer-able marc.cremer@able-group.de
- Jasonleong jasonliangbiz@gmail.com
- METO (@metowolf)
- Michael Brevard yonshi29@gmail.com
- Bobbie Goede bobbiegoede@gmail.com
- Becem (@becem-gharbi)
- Mukund Shah
- Ayo Ayco (@ayoayco)
v2.8.1
🩹 Fixes
- dev: Conditionally access worker address for build info (#1947)
- Force use wasm import strategy for windows (e73b849f)
- netlify-lambda: Handle base64 encoded body (#1940)
- cloudflare: Wasm support with dynamic chunks (#1957)
- prerenderer: Write responses with json signature to original path (#1963)
📖 Documentation
- cache: Make default value
swr: true
more clear (#1949)
🏡 Chore
✅ Tests
❤️ Contributors
- Pooya Parsa (@pi0)
- Becem becem.gharbi@live.com
- Mick Lawitzke (@MickL)
v2.8.0
🌟 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 getValidatedRouterParams
and getRequestFingerprint
utilities, decode
options for getRouterParam
and auto-completion for headers in your IDE!
![image](https://private-user-images.githubusercontent.com/5158436/284309070-7bb2612b-3811-4b05-859c-c3a438d67ce1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxNzA2OTksIm5iZiI6MTcyNDE3MDM5OSwicGF0aCI6Ii81MTU4NDM2LzI4NDMwOTA3MC03YmIyNjEyYi0zODExLTRiMDUtODU5Yy1jM2E0MzhkNjdjZTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjBUMTYxMzE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzFhYWY0ODEwYWU2MmU3MDBhMDIyZTBiNWNiOGE4MmFkNGM3ZTMyYzdhOGMwZjVjMWZjNTFlMTljOTJkY2RlMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.SOLvVJVDZCo90Ctmshm0mBxcBbckrk5QGqqo74EdX0s)
🔥 More coming soon
There are more exciting features including tasks, db layer, and WebSocket API planned for the next minor releases. Stay tuned!
Changelog
🚀 Enhancements
- Support modules to extend nitro builder (#1789)
- Support
inline
mode forserveStatic
(#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
📖 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
andSerializeObject
types (#1907)
❤️ Contributors
- Pooya Parsa (@pi0)
- Siegerts stephen.siegert@gmail.com
- Passionate-bram
- Daniel Roe daniel@roe.dev
- Neil Richter (@noook)
- Xin Du (Clark) clark.duxin@gmail.com
- Anthony Fu anthonyfu117@hotmail.com
- Dario Piotrowicz (@dario-piotrowicz)
- Kalwabed Rizki
- Thunfisch987
- Oof2win2 honza.koco44@gmail.com
- Markthree (@markthree)
- Estéban (@Barbapapazes)