Skip to content

Commit 83207d8

Browse files
authored
updated docs for v3 (#334)
1 parent 0e827ce commit 83207d8

File tree

4 files changed

+454
-8
lines changed

4 files changed

+454
-8
lines changed

docs/pages/v3/_meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"index": "What's new",
33
"config": "Configuration file",
4-
"override": "Create your own override"
4+
"reference-implementation": "Reference Construct",
5+
"override": "Advanced - Create your own override"
56
}

docs/pages/v3/config.mdx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const config = {
2121
})
2222
},
2323
},
24-
functions: { // here we define the functions that we want to deploy in a different server
24+
// Below we define the functions that we want to deploy in a different server
25+
functions: {
2526
ssr: {
2627
routes: [
2728
"app/api/isr/route", "app/api/sse/route", "app/api/revalidateTag/route", // app dir Api routes
@@ -40,15 +41,23 @@ const config = {
4041
override: {
4142
wrapper: "node",
4243
converter: "node",
44+
// This is necessary to generate the dockerfile and for the implementation to know that it needs to deploy on docker
4345
generateDockerfile: true,
4446
},
45-
},
47+
},
48+
edge: {
49+
runtime: "edge",
50+
routes: ["app/ssr/page"],
51+
patterns: ["ssr"],
52+
override: {}
53+
}
4654
},
4755
// By setting this, it will create another bundle for the middleware,
4856
// and the middleware will be deployed in a separate server.
4957
// If not set middleware will be bundled inside the servers
5058
// It could be in lambda@edge, cloudflare workers, or anywhere else
5159
// By default it uses lambda@edge
60+
// This is not implemented in the reference construct implementation.
5261
middleware: {
5362
external: true
5463
}

docs/pages/v3/index.mdx

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { Callout } from 'nextra/components'
22

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

5-
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.
6-
7-
`[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)
5+
`[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)
6+
7+
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.
88

9-
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
9+
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.
1010
</Callout>
1111

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

2828
- Allow for splitting, you can now split your next app into multiple servers, which could each have their own configuration
2929
- An experimental bundled `NextServer` could be used which can reduce the size of your lambda by up to 24 MB
30-
- ~~Support for the `edge` runtime of next~~ (coming soon)
30+
- Support for the `edge` runtime of next (Only app router for now, only 1 route per function)
31+
32+
## Get started
33+
34+
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:
35+
36+
```ts
37+
import { OpenNextCdkReferenceImplementation } from "path/to/reference-implementation"
38+
39+
const site = new OpenNextCdkReferenceImplementation(stack, "site", {
40+
openNextPath: ".open-next",
41+
})
42+
```
43+
44+
You also need to create an `open-next.config.ts` file in your project root, you can find more info [here](/v3/config).
45+
46+
A very simple example of this file could be:
47+
48+
```ts
49+
import type { BuildOptions } from 'open-next/types/open-next'
50+
const config = {
51+
default: {
52+
53+
}
54+
}
55+
module.exports = config
56+
```
57+
58+
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.

0 commit comments

Comments
 (0)