Skip to content

Commit

Permalink
v5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
blomqma committed Jan 29, 2024
1 parent ea1caba commit a8f214c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,56 @@
All notable changes to this project will be documented in this file.
We follow the [Semantic Versioning 2.0.0](http://semver.org/) format.

### 5.0.0 - 2024-01-29

TLDR: All Node.js API specific code is split
into the CLI which is much more reliable now.
Support for generating the OpenAPI spec automatically
when running the development server is dropped and
handled by the CLI command
`npx next-rest-framework generate` instead.

#### Add Edge runtime compatibility

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 commands `generate` and `validate` 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 running `next 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:

- Fixed the ESM entry point causing NRF not
being loaded as ESM.
- Fixed the possible return status codes from RPC
routes to match the generated OpenAPI spec.

### 4.3.0 - 2024-01-10

### Changed
Expand Down
2 changes: 1 addition & 1 deletion apps/example/public/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "Next REST Framework",
"description": "This is an autogenerated documentation by Next REST Framework.",
"version": "v4.3.0"
"version": "v5.0.0"
},
"paths": {
"/api/v1/rpc/createTodo": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-rest-framework/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-rest-framework",
"version": "4.3.0",
"version": "5.0.0",
"description": "Next REST Framework - Type-safe, self-documenting APIs for Next.js",
"keywords": [
"nextjs",
Expand Down

2 comments on commit a8f214c

@vercel
Copy link

@vercel vercel bot commented on a8f214c Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

next-rest-framework – ./docs

next-rest-framework-git-main-blomqma.vercel.app
next-rest-framework-blomqma.vercel.app
next-rest-framework.vercel.app

@vercel
Copy link

@vercel vercel bot commented on a8f214c Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

next-rest-framework-demo – ./apps/example

next-rest-framework-demo-blomqma.vercel.app
next-rest-framework-demo.vercel.app
next-rest-framework-demo-git-main-blomqma.vercel.app

Please sign in to comment.