Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated docs for v3 #334

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
`open-next@3.0.0-rc.1` 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)
`open-next@3.0.0-rc.2` 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 open-next@3.0.0-rc.2 build` to build your project before running the `sst deploy` or `cdk deploy` command to deploy your project.
Loading
Loading