Closed blomqma closed 7 months ago
The latest updates on your projects. Learn more about Vercel for Git βοΈ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
next-rest-framework | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Jan 29, 2024 7:47pm |
next-rest-framework-demo | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Jan 29, 2024 7:47pm |
This is a major change that simplifies the OpenAPI sepc generation process, and adds Edge runtime support.
Removing development-server generation:
This change completely removes the automatic local OpenAPI spec generation when calling the documentation endpoint and leaves the spec generation completely for the CLI which is now much more reliable for the following reason:
Previously the file system based OpenAPI spec generation done by the CLI used the build output generated by Next.js in the
.next
folder. This was however suboptimal as there's no guarantee that the module structure won't change between Next.js versions, breaking the CLI. A new approach is that the CLI commandsgenerate
andvalidate
now generate a temporary build folder called.next-rest-framework
which is compiled using ESBuild which produces consistent output from the CLI. This temporary folder is used to gather the OpenAPI paths from the generated routes and api routes that works with all Next.js versions. This is also much faster than runningnext build
every time with the CLI.With this changes, all Node.js file system based API calls etc. are split do a different bundle so that the code also works in the Edge runtime.
Fixed: