Skip to content

Commit 8e9613a

Browse files
authored
Update README.md
1 parent b56b7c1 commit 8e9613a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ OpenNext aims to support all Next.js 13 features. Some features are work in prog
4545
module.exports = nextConfig
4646
```
4747

48-
3. Build app
48+
3. Build the app
4949

5050
```bash
5151
npx open-next build
@@ -71,7 +71,7 @@ This is the recommended setup.
7171
<img alt="Architecture" src="/readme/architecture.png" width="800" />
7272
</p>
7373

74-
A few AWS resources are created:
74+
A few AWS resources need to be created:
7575

7676
- An S3 bucket to host static assets from `.open-next/assets`.
7777
- A Lambda function handling server and API requests.
@@ -81,15 +81,15 @@ A few AWS resources are created:
8181

8282
## How does OpenNext work?
8383

84-
When you call `npx open-next build`, behind the scene OpenNext builds your Next.js app using the `@vercel/next` package. This package does 2 things:
84+
When you call `npx open-next build`, behind the scenes OpenNext builds your Next.js app using the `@vercel/next` package. This package does 2 things:
8585

8686
- It calls `next build` with the [`minimalMode`](https://github.com/vercel/next.js/discussions/29801) flag. This flag disables running middleware in the server code.
8787

8888
- Instead, it bundles the middleware separately. This allows us to deploy middleware to edge locations.
8989

9090
Then `open-next` transforms `@vercel/next`'s build output into a format that can be deployed to AWS. The following steps are performed:
9191

92-
1. Creates a `.open-next` directory in user's Next.js app.
92+
1. Creates a `.open-next` directory in the user's Next.js app.
9393

9494
1. Bundles the middleware handler with the [middleware adapter](/cli/assets/middleware-adapter.js). And outputs the handler file into `.open-next/middleware-function`.
9595

@@ -103,7 +103,7 @@ Then `open-next` transforms `@vercel/next`'s build output into a format that can
103103

104104
## Example
105105

106-
In the `example` folder, you can find a benchmark Next.js app. Here is a link deployed using SST's [`NextjsSite`](https://docs.sst.dev/constructs/NextjsSite) construct. It contains a handful of pages. Each page aims to test a single Next.js feature.
106+
In the `example` folder, you can find a benchmark Next.js app. Here's a link deployed using SST's [`NextjsSite`](https://docs.sst.dev/constructs/NextjsSite) construct. It contains a handful of pages. Each page aims to test a single Next.js feature.
107107

108108
## Debugging
109109

@@ -119,12 +119,12 @@ Create a PR and add a new page to the benchmark app in `example` with the issue.
119119

120120
#### Why use the `@vercel/next` package for building the Next.js app?
121121

122-
`next build` generates a server function that runs middleware. With this setup, if you use middleware for static pages, these pages cannot be cached. If cached, CDN (CloudFront) will send back cached response without calling the origin (server Lambda function). To ensure the middleware is invoked on every request, caching is always disabled.
122+
The `next build` command generates a server function that runs the middleware. With this setup, if you use middleware for static pages, these pages cannot be cached. If cached, CDN (CloudFront) will send back the cached response without calling the origin (server Lambda function). To ensure the middleware is invoked on every request, caching is always disabled.
123123

124-
Vercel deploys the middleware code to edge functions, which gets invoked before the request reaches the CDN. This way, static pages can be cached. On request, middleware gets called, and then the CDK can send back cached response.
124+
Vercel deploys the middleware code to edge functions, which gets invoked before the request reaches the CDN. This way, static pages can be cached. On request, the middleware gets called, and then the CDN can send back the cached response.
125125

126126
OpenNext is designed to adopt the same setup as Vercel. And building using `@vercel/next` allows us to separate the middleware code from the server code.
127127

128128
---
129129

130-
Maintained by [SST](https://sst.dev), join our community: [Discord](https://sst.dev/discord) | [YouTube](https://www.youtube.com/c/sst-dev) | [Twitter](https://twitter.com/SST_dev)
130+
Maintained by [SST](https://sst.dev). Join our community: [Discord](https://sst.dev/discord) | [YouTube](https://www.youtube.com/c/sst-dev) | [Twitter](https://twitter.com/SST_dev)

0 commit comments

Comments
 (0)