nitro icon indicating copy to clipboard operation
nitro copied to clipboard

v2.10.0 tracker

Open pi0 opened this issue 2 months ago • 0 comments

Nitro v2.10 release had been delayed due to major (non-breaking) structure changes making sure Nitro 2.x is forward-compatible until community adoption happens. It might be delayed a little bit longer after Nitro v3.0.0 release mainly to have enough time to make sure there are no regressions and well-test ecosystem compatibility.

⭐ Highlights

  • You can use nitro instead of nitropack for imports and dependency (#2497)
  • Nitro structure and presets is revamped with new structure and subpath exports (#2473, #2446)
  • Nitro now uses compatibility dates to allow leveraging the latest platform features without major versions (#2511)

✅ Migration

Although migrating to Nitro v2.10 from older 2.x versions is not mandatory, it is highly recommended that you migrate:

Runtime imports

If you were previously importing from #internal/nitro/* or nitropack/runtime/* you should change them to nitropack/runtime.

--- import { defineNitroPlugin } from "#internal/nitro/plugin"
--- import { defineNitroPlugin } from "nitropack/runtime/plugin"
+++ import { defineNitroPlugin } from "nitropack/runtime"

Compatibility date

Adding compatibility date, make sure you can leverage from latest platform enhancements. If this config is not provided nitro will keep using v2.9 behavior for presets. Nitro will show a guide about adding it and if you are using nitro dev command it can automatically add it.

export default defineNitroConfig({
+++  compatibilityDate: "2024-06-12",
});

🌃 Try via the nightly channel

Nitro has a nightly release channel that automatically releases for every commit to try the latest changes. You can opt-in by updating your package.json:

{
  "devDependencies": {
--    "nitropack": "^2.0.0"
++    "nitropack": "npm:nitropack-nightly@latest"
  }
}

(for nuxt users)

{
  "devDependencies": {
--    "nuxt": "^3.0.0"
++    "nuxt": "npm:nuxt-nightly@latest"
  }
}

🚀 Enhancements

  • Generate types for runtime config (#2306)
  • serverAssets: Support ignore option (#2302)
  • Expose getRouteRulesForPath from nitro runtime (#2238)
  • openapi: Support configuration via openapi (#2299)
  • Environment specific event handlers (#2272)
  • Experimental defineRouteMeta (#2102)
  • cloudflare-pages: Generate wrangler.toml (#2353)
  • Allow customizing apiBaseURL, apiDir and routesDir (#1763)
  • aws-lambda: Experimental streaming support (#2412)
  • providers: Add gitlab-pages static provider (#2420)
  • netlify: Experimental support v2 functions ISR via targeted cache-control headers (#2406)
  • Add compatibility date support (#2511)
  • cloudflare-module: Support cloudflare:email and cloudflare:queue hooks (#2487)
  • defineCachedEventHandler: Add event.context.cache (#2519)

🩹 Fixes

  • github-pages: Prerender / by default (#2334)
  • deno-server: Always inject process from node:process (#2372)
  • deno-server: Explicitly remove cert/key from options if either is not set (#2373)
  • Deduplicate plugins (#2391)
  • iis: Deep merge configs (#2358)
  • externals: Compare package paths against normalized id (#2371)
  • azure: Correctly handle maxAge cookie option (#2400)
  • Add .tsx and .jsx to node-resolve extensions (#2398)
  • Lower-case accepted handler method (#2382)
  • Set compilerOptions.noEmit to avoid tsconfig.json warning (#2402)
  • prerender: Only try to add / after prerender:routes hook (#2348)
  • azure: Correctly handle maxAge cookie option (#2403)
  • aws-lambda-streaming: Fix global lambda import pointing to wrong (#2422)
  • netlify: Match ISR route rules when path has a query string (#2440)
  • preset-iis: Parse without explicitArray to allow merging web.config (#2457)
  • Pass custom entry filename when resolving prerenderer (#2461)
  • vercel: Support custom baseURL (#2464)
  • Use relative paths in nitro-config.d.ts (#2471)
  • netlify: Added missing quotes in utils (#2472)
  • Avoid named exports from package.json (e6097ed7)
  • cloudflare-pages: Remove .html extension from _routes.json (#2498)
  • More compatibility for import from nitropack/runtime/* (#2501)
  • build: Correctly watch custom apiDir and routesDir (#2502)
  • public-assets: Do not shadow paths that share prefix (#2516)
  • core: Resolve modules with esm compatibility (#2514)
  • prerender: Extract links from explicit html routes (#2517)

💅 Refactors

  • openapi: Update swagger-ui version to v5 for OpenAPI v3.1 support (#2343)
  • cloudflare-pages: Update root wrangler.toml in CI (#2355)
  • Strict typechecks (#2370)
  • Convert CapturedErrorContext to interface to allow type augmentation (#2393)
  • Overhaul presets structure (#2446)
  • Structure overhaul (#2473)

📖 Documentation

  • Remove duplicate option definition (#2339)
  • fetch: Unexpected spaces (#2368)
  • Correct env variable to NITRO_SHUTDOWN_DISABLED (#2377)
  • caching: Fix typos and rephrase for clarity (#2380)
  • Add a usage example for server sent events (#2379)
  • Correct directory name (#2417)
  • Use npx nypm install in instead of npm install (#2421)
  • websocket: Correct nuxt sse url (#2430)
  • node: Fix node-listener example (#2456)
  • Prefix NITRO_ in .env file (#2486)
  • Fix typo autoSubFolderIndex ~> autoSubfolderIndex (#2494)
  • Correct h3 docs link to event-handler (#2500)

pi0 avatar Jun 13 '24 15:06 pi0