unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.89k stars 496 forks source link

feat: add compatibility date support #2511

Closed pi0 closed 3 months ago

pi0 commented 3 months ago

Compatibility dates allow Nitro presets to update their behavior in non-semver-major releases of Nitro (and higher order toolings as well).

This PR adds support for compatibilityDate option in nitro config which will be required and with a warning, we ask users to set it.

See compatx and this RFC for more context.

When no compatibility date is specified, we assume latest stable release v2.9.6 as safe fallback and show guide to update:


Auto update wizard:

With Nitro CLI: (nitro dev only)

image

No prompt (nuxt CLI, nitro build, user canceled, etc)

image

--

Note: Framework authors can inspire from this utility to implement auto update flow.