Skip to content

Commit

Permalink
updated docs for v3 (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
conico974 authored Dec 14, 2023
1 parent 0e827ce commit 83207d8
Show file tree
Hide file tree
Showing 4 changed files with 454 additions and 8 deletions.
3 changes: 2 additions & 1 deletion docs/pages/v3/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"index": "What's new",
"config": "Configuration file",
"override": "Create your own override"
"reference-implementation": "Reference Construct",
"override": "Advanced - Create your own override"
}
13 changes: 11 additions & 2 deletions docs/pages/v3/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const config = {
})
},
},
functions: { // here we define the functions that we want to deploy in a different server
// Below we define the functions that we want to deploy in a different server
functions: {
ssr: {
routes: [
"app/api/isr/route", "app/api/sse/route", "app/api/revalidateTag/route", // app dir Api routes
Expand All @@ -40,15 +41,23 @@ const config = {
override: {
wrapper: "node",
converter: "node",
// This is necessary to generate the dockerfile and for the implementation to know that it needs to deploy on docker
generateDockerfile: true,
},
},
},
edge: {
runtime: "edge",
routes: ["app/ssr/page"],
patterns: ["ssr"],
override: {}
}
},
// By setting this, it will create another bundle for the middleware,
// and the middleware will be deployed in a separate server.
// If not set middleware will be bundled inside the servers
// It could be in lambda@edge, cloudflare workers, or anywhere else
// By default it uses lambda@edge
// This is not implemented in the reference construct implementation.
middleware: {
external: true
}
Expand Down
38 changes: 33 additions & 5 deletions docs/pages/v3/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Callout } from 'nextra/components'

<Callout type="warning" emoji="⚠️">

This is a release candidate, it is not yet ready for production, but we are getting close. We are looking for feedback on this release, so please try it out and let us know what you think.
`[email protected]` is here!!! Please report any issues you find on [discord](https://discord.com/channels/983865673656705025/1164872233223729152) or on the github [PR](https://github.com/sst/open-next/pull/327)
`[email protected]` is here!!! Please report any issues you find on [discord](https://discord.com/channels/983865673656705025/1164872233223729152) or on the github [PR](https://github.com/sst/open-next/pull/327)

This is a release candidate, it is not yet ready for production, but we are getting close. We are looking for feedback on this release, so please try it out and let us know what you think. See [getting started](#get-started) to quickly test it.

It also requires an updated version of the IAC tools that you use, see the sst PR [here](https://github.com/sst/sst/pull/3567) for more information
It also requires an updated version of the IAC tools that you use, see the sst PR [here](https://github.com/sst/sst/pull/3567) for more information.
</Callout>

## What's new in V3?
Expand All @@ -27,4 +27,32 @@ import { Callout } from 'nextra/components'

- Allow for splitting, you can now split your next app into multiple servers, which could each have their own configuration
- An experimental bundled `NextServer` could be used which can reduce the size of your lambda by up to 24 MB
- ~~Support for the `edge` runtime of next~~ (coming soon)
- Support for the `edge` runtime of next (Only app router for now, only 1 route per function)

## Get started

The easiest way to get started is to use the [reference implementation construct](/v3/reference-implementation). Copy this reference implementation into your project and then use it like that in your sst or cdk project:

```ts
import { OpenNextCdkReferenceImplementation } from "path/to/reference-implementation"

const site = new OpenNextCdkReferenceImplementation(stack, "site", {
openNextPath: ".open-next",
})
```

You also need to create an `open-next.config.ts` file in your project root, you can find more info [here](/v3/config).

A very simple example of this file could be:

```ts
import type { BuildOptions } from 'open-next/types/open-next'
const config = {
default: {

}
}
module.exports = config
```

Then you need to run `npx [email protected] build` to build your project before running the `sst deploy` or `cdk deploy` command to deploy your project.
Loading

1 comment on commit 83207d8

@vercel
Copy link

@vercel vercel bot commented on 83207d8 Dec 14, 2023

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:

open-next – ./

open-next-sst-dev.vercel.app
open-next-git-main-sst-dev.vercel.app
open-next.vercel.app

Please sign in to comment.