Releases: nitrojs/nitro
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: truemore clear (#1949)
🏡 Chore
✅ Tests
❤️ Contributors
- Pooya Parsa (@pi0)
- Becem [email protected]
- 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 getValidatedRouterParamsand getRequestFingerprint utilities, decode options for getRouterParam and auto-completion for headers in your IDE!
🔥 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
inlinemode forserveStatic(#1864) - Add experimental
winterjspreset (#1863) - Allow setting preset using
SERVER_PRESETenvironment variable (#1870) - cloudflare-pages, Cloudflare-module: Enable code splitting by default (#1905)
- Support
frameworkconfig (#1843) - Add AWS Amplify Hosting preset (#1912)
- Upgrade to Rollup v4 (#1927)
- Improve
nitro.jsonbuild info (#1930) - aws-amplify: Support static builds (#1933)
- Add
defineNitroErrorHandlertype 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/htmlrequest 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
SerializeTupleandSerializeObjecttypes (#1907)
❤️ Contributors
- Pooya Parsa (@pi0)
- Siegerts [email protected]
- Passionate-bram
- Daniel Roe [email protected]
- Neil Richter (@noook)
- Xin Du (Clark) [email protected]
- Anthony Fu [email protected]
- Dario Piotrowicz (@dario-piotrowicz)
- Kalwabed Rizki
- Thunfisch987
- Oof2win2 [email protected]
- Markthree (@markthree)
- Estéban (@Barbapapazes)
v2.7.2
🩹 Fixes
- cloudflare-pages: Filter out overlapping public assets dirs (#1859)
❤️ Contributors
- Daniel Roe [email protected]
v2.7.1
🩹 Fixes
- Recursively simplify returned objects (#1847)
- cache: Fix
etagandlast-modifiedvalues (#1855) - cache: Invalidate wrongly cached handler entities (#1857)
❤️ Contributors
- Pooya Parsa (@pi0)
- Daniel Roe [email protected]
v2.7.0
🚀 Enhancements
- vercel: Support
bypassTokenfor on-demand static reganaration (#1723) - prerender: Support
retryandretryDelay(#1534) - Allow disabling compressed size calculation (#1756)
🔥 Performance
- Use native fetch for node >= 18 to reduce %40 of bundle size! (#1724)
🩹 Fixes
- Sort dependencies in
.output/package.json(#1708) - Add
application/javascriptmime type in lambda utils (#1737) - renderer: Allow all h3 handled body types (#1755)
- dev: Safe error message override (#1712)
- azure: Fix cookie format normalization (#1753)
- Exclude undefined from hook types (#1769)
- iis-node: Pass
PORTasNITRO_UNIX_SOCKET(#1783) - aws-lambda: Handle
event.isBase64Encoded(#1779) - cache: Allow overriding integrity (#1791)
- cache: Write SWR and update errors to the console (#1794)
- cache: Only return validated stale value (#1795)
- cache: Only invalidate if validate returns false (#1796)
- Watch plugins directory (#1800)
- cache: Allow setting multiple set-cookie headers (bad practice!) (#1838)
- prerender: Decode HTML entities in rendered links (#1824)
- storage: Validate and skip invalid mounts (#1805)
- cache: Validate
entry.valueto have value for cached handlers (84559382) - cache: Fix event handler integrity hash generation (#1820)
- cache: Set cache item before returning response on first request (#1813)
💅 Refactors
- iis: Improve preset and docs (#1784)
📖 Documentation
- Update prerender options (11a24124)
- Fix typo (#1722)
- Register error handler using
hookinstead ofhookOnce(#1743) - Update lock file (#1750)
- Fix typo (#1759)
- Fix configuration file name of the custom preset (#1760)
- Typo in word "legacy" in Configuration docs (#1780)
- cloudflare: Add local dev section (#1772)
🏡 Chore
- Add
.devcontainer(#1633) - Update
vitestto1.0.0-beta(#1776) - Use pnpm
shell-emulatorfor Windows local development (#1828) - Use
nitropack-nightlyfor the nightly release channel (#1841)
🤖 CI
- Run tests against Node.js 18 (#1713)
❤️ Contributors
- Pooya Parsa (@pi0)
- Yasser Lahbibi (@yassilah)
- Horu
- Michael Brevard [email protected]
- Daniel Roe [email protected]
- MiniDigger < Martin>
- Estéban (@Barbapapazes)
- Heb (@Hebilicious)
- Henrique Lopes
- McPizza [email protected]
- Michael BOUVY [email protected]
- Jeremy Graziani
- Tobias Diez [email protected]
- VALERIY SINEVICH
- Roman Zipp [email protected]
- Benjamin GAYMAY (@BenjaminGaymay)
- Alexander Lichter (@manniL)
- Farnabaz (@farnabaz)
- Nils K
- Jonas Thelemann (@dargmuesli)
- Jenjen75 [email protected]
- Sébastien Chopin (@Atinux)
v2.6.3
🩹 Fixes
- firebase: Apply region for gen2 deployments (#1657)
- cloudflare-pages: Autodetect static preset (#1659)
- Resolve output dirs relative to
rootDir(#1666) - prerender: Allow disabling html sub-folders (#1676)
- firebase: Use correct key when importing firebase
httpsOptions(#1663) - Await on
send()calls (#1701) - Bun dev compatibility (#1702)
- aws-lambda,netlify-lambda: Binary body v2 and cookies v1 (#1683)
- iis: Merge
web.config(#1658)
📖 Documentation
- render-com: Add note about node version (#1693)
- Add instructions for using Nuxt edge release channel (#1688)
- Add instructions for bun (#1672)
✅ Tests
- Update test for bun headers (#1684)
❤️ Contributors
- Gavin Hardaker (@Hardaker587)
- Heb (@Hebilicious)
- Colin McDonnell (@colinhacks)
- Pooya Parsa (@pi0)
- Luke Nelson [email protected]
- Rajeev R Sharma [email protected]
- Markthree (@markthree)
- Daniel Roe [email protected]
- Yuichi Takebe
v2.6.2
🩹 Fixes
- Use new h3 generics for
defineCachedEventHandler(#1640) - aws-lambda, netlify: Add
isBase64Encodedresponse field (#1645) - Exclude typed body from
cachedEventHandler(#1647) - static: Send immediate empty responses for 304 handling (#1639)
🏡 Chore
- Update
listhento latest (62ac3065)
✅ Tests
- Add test for prerender ignored
data:URLs (#1431)
❤️ Contributors
- Pooya Parsa (@pi0)
- Markthree (@markthree)
- Daniel Roe [email protected]
- Azcray
v2.6.1
🩹 Fixes
- Correctly mark
middleware: falsefor scanned routes (#1631) - Pass relative ignore paths when scanning public assets (#1632)
❤️ Contributors
- Pooya Parsa (@pi0)
- Daniel Roe [email protected]
v2.6.0
note
📰 Release article coming soon!
🚀 Enhancements
- storage: Default data storage for
nodeand dev presets (#1352) - Support regexps in external options (#1388)
- Support
exportConditionsand add worker default conditions (#1401) event.waitUntilwith Cloudflare integration (#1421)experimental.typescriptBundlerResolutionflag (#1384)- Support
ignoreto ignore scanned files (#1430) - Allow ignoring public assets with
ignoreoptions (#945) - Add
iisserver preset (#1436) - Auto capture errors with
nitroApp.captureError(#1463) - vercel: Enable streaming support out of the box (#1514)
- Fully resolve type paths for auto-import declarations (#1528)
- Add
prerender:config,prerender:initandprerender:donehooks (#1519) - cache: Support cached event handlers with varies (#1184)
- app: Support
request,beforeResponseandafterResponsehooks (#1545) - Experimental composition api via
useEvent()ans async context support (#1546) - prerenderer: Support for query links exploration (#1474)
- cloudflare-pages: Add config to customize generated
_routes.json(#1312) - firebase: Add support for 2nd generation functions (#1500)
- externals: Resolve actual subpaths before guessing (#527)
- externals: Support aliasing traced packages (#1553)
- wasm: Support output esm imports (#1565)
- Enable
timingin debug mode (#1577) - prerender: Preserve prerendered asset
content-typeheader (#1587) - externals: Improved output
package.json(#1607) - firebase: Support renaming exported server function (#1377)
- azure: Support custom configuration (#1344)
- node-server: Support listening to unix sockets using
NITRO_UNIX_SOCKET(#1201) - cloudflare-module, cloudflare-pages: Experimental dynamic imports (#1172)
- cli: Support
--presetand--minify/--no-minifyargs forbuild(#1621) - cli: Add listhen options for
devcommand (#1622) - Handle stream and
Uint8Arrayfor lambda presets (#1624)
🔥 Performance
- Use
fsLitedriver for productiondata:storage (dd290763) - Use inline
http-graceful-shoutdownto reduce externals (8053cca0) - Remove
source-map-supportas node supports--enable-source-maps(9ba8fe98) - Bundle runtime dependencies (#1554)
- Use local fetch for proxy route rules (#1609)
🩹 Fixes
- rollup: Replace
globalThis.process.withprocess.(#1360) - types: Enable
allowSyntheticDefaultImportsoption by default (#1383) - cache: Try to call
event.waitUntil(#1422) - defineCachedFunction: Properly infer function type (#1423)
- static: Safe decode path (#1459)
- Split cookie headers (#1452)
- deno-deploy: Treat all
https://modules as external (#1438) - cache: Call
event.waitUntilon main resolver when expired (421d6255) - prerender: Skip redirects (#1448)
- aws-lambda,netlify: Base64 encode binary responses (#1274)
- app: Enable router preemptive mode (#1504)
- vercel: Allow arbitrary function configuration (#1508)
- Use relative paths in
tsconfig.json(#1518) - prerender: Free up memory after each route is written to the disk (#1536)
- prerender: Call
prerender:routebefore freeing up memory (#1537) - prerender: Only match
hrefattribute after whitespace (#1530) - externals: Absolute paths are inlined (#1429)
- openapi: Merge handlers with same route and different method (#1497)
- prerender: Exclude encoded
hrefattributes from link extraction (#1485) - externals: Increase score for npm package name patterns to avoid breaking changes (#1548)
- deno-deploy: Decode static asset path before reading from filesystem (#1494)
- Remove non-standard
moduleexport condition (#1559) - externals: Trace externals with their commonjs / esm status (#1562)
- Use relative paths in generated tsconfig (#1572)
- app: Use
event.pathinstead ofevent.url(41a76c0f) - cache: Don't use
_originalPath(#1576) - types: Use relative type path to nitro
#internal/nitro(#1584) - Disable sourcemap minify for dev (e38f3586)
- Use relative source map paths and add test (#1582)
- pkg: Remove node 14 from supported
engines(#1585) - prerender: Use decoded asset id to access prerendered asset header overrides (#1588)
- Add
consola/corealias (#1591) - vercel,netlify: Don't deprecate
swrwhencache: false(#1603) - build: Workaround bun's difference in
function.toString()(#1606) - firebase: Ignore
fseventdependency (#1610) - Directly pass
localFetchto route rules handler (#1611) - stormkit: Properly send buffer responses (#1616)
- Add parent
node_modulesof nitro to modules dir for pnpm compat (#1618) - deno-server: Fix injections and enable back tests (#1625)
💅 Refactors
- cloudflare: Use
wrangler deployinstead ofpublish(#1372) - cloudflare: Use
wrangler deployin more places (#1393) - prerender: Improve console formatting for failed routes (#1471)
- Reduce usage of
event.node.req(#1511) - Reduce usage of
event.node.res(#1513) - timing: Hide debug logs with
0ms(8a44d19c) - firebase: Update generated
package.json(#1608) - Migrate from
http-proxytounjs/httpxy(#1623)
📖 Documentation
- vercel: Add note about top level
api/directory (#1386) - Add nitro plugins examples (#1403)
- Add custom preset instructions (#1409)
- aws: Add note about inlining dynamic chunks (#650)
- Fixed typo of the word
discussions(#1433) - Fix typo (#1446)
- Use
defineEventHandlerinstead ofeventHandler(#1442) - Remove auto-imported
defineNitroConfig(#1441) - Add
utils/directory (#1451) - storage: Add runtime storage configuration examples ([#1456](https://github.com/unjs/nitro/pull/...
v2.5.2
🩹 Fixes
- Add
envPrefixtoruntimeConfig.nitrotypes (#1336) - prerender: Allow to fetch static files (#1340)
- options: Default target to
staticwhenstaticoverride is set (#1342) - Correct default
node-servertarget (7976318) - vercel, netlify: Always check
nativeSWRfuture flag (ccebe4e) - vercel, netlify: Handle boolean values for route rule deprecation (dfd8bbd)
- Dedup
unstoragedependency and use subpath alias (#1164) - dev: Ensure socket path is accessible (#1115)
- Type
event.$fetchandevent.fetch(#1343) - Allow configuring
esbuildtransform plugin (#1347)
📖 Documentation
- Add a reference to install Azure functions core tools to the swa section (#1339)
❤️ Contributors
- Pooya Parsa (@pi0)
- Daniel Roe [email protected]
- Stefan Bittmann [email protected]
- Nick Dawson