Skip to content

Commit

Permalink
docs: update readme (#2449)
Browse files Browse the repository at this point in the history
  • Loading branch information
orinokai authored Mar 12, 2024
1 parent 84b6ab8 commit 793ea73
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

# Next.js Runtime

> [!NOTE]
> Next.js Runtime v5 is available for early access! Please note that this repository is for the current version (v4) of
> the Next.js Runtime, and the early access version is not yet available in this repository.
> [Learn more](https://docs.netlify.com/frameworks/next-js/overview/).
Next.js is supported natively on Netlify, and in most cases you will not need to install or configure anything. This
repo includes the packages used to support Next.js on Netlify.

Expand All @@ -16,10 +21,10 @@ commands separately will not work, because the Next.js Runtime will not generate
If you use [`next/image`](https://nextjs.org/docs/basic-features/image-optimization), your images will be automatically
optimized at runtime, ensuring that they are served at the best size and format. The image will be processed on the
first request which means it may take longer to load, but the generated image is then cached and served as a static file
to future visitors. By default, Next.js will deliver WebP images if the browser supports it. WebP is a modern image format
with wide browser support that will usually generate smaller files than PNG or JPG. Additionally, you can enable AVIF
format, which is often even smaller in filesize than WebP. The drawback is that with particularly large images, AVIF images may
take too long to generate, and the function times-out. You can configure
to future visitors. By default, Next.js will deliver WebP images if the browser supports it. WebP is a modern image
format with wide browser support that will usually generate smaller files than PNG or JPG. Additionally, you can enable
AVIF format, which is often even smaller in filesize than WebP. The drawback is that with particularly large images,
AVIF images may take too long to generate, and the function times-out. You can configure
[the supported image formats](https://nextjs.org/docs/api-reference/next/image#acceptable-formats) in your
`next.config.js` file.

Expand Down Expand Up @@ -91,7 +96,10 @@ Note that Netlify has a minimum TTL of 60 seconds for revalidation.

## Disable Static 404 on Dynamic Routes with fallback:false

Currently when hitting a non-prerendered path with `fallback=false` it will default to a 404 page. You can now change this default setting by using the environemnt variable `LEGACY_FALLBACK_FALSE=true`. With the environment variable set, those non-prerendered paths will now be routed through using the ISR Handler and will allow you to add redirects for those non-prerendered paths.
Currently when hitting a non-prerendered path with `fallback=false` it will default to a 404 page. You can now change
this default setting by using the environemnt variable `LEGACY_FALLBACK_FALSE=true`. With the environment variable set,
those non-prerendered paths will now be routed through using the ISR Handler and will allow you to add redirects for
those non-prerendered paths.

## Use with `next export`

Expand Down Expand Up @@ -190,13 +198,15 @@ npm test

### End-to-end tests

In order to run the end-to-end (E2E) tests, you'll need to be logged in to Netlify. You can do this using the [Netlify CLI](https://github.com/netlify/cli) with the command:
In order to run the end-to-end (E2E) tests, you'll need to be logged in to Netlify. You can do this using the
[Netlify CLI](https://github.com/netlify/cli) with the command:

```shell
netlify login
```

Alternatively, you can set an environment variable `NETLIFY_AUTH_TOKEN` to a valid Netlify personal access token. This can be obtained from the [Netlify UI](https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui).
Alternatively, you can set an environment variable `NETLIFY_AUTH_TOKEN` to a valid Netlify personal access token. This
can be obtained from the [Netlify UI](https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui).

Then run the E2E tests if logged in:

Expand All @@ -210,7 +220,8 @@ Or if using an access token:
NETLIFY_AUTH_TOKEN=your-token-here npm run test:next
```

_Note: The E2E tests will be deployed to a Netlify owned site. To deploy to your own site then set the environment variable `NETLIFY_SITE_ID` to your site ID._
_Note: The E2E tests will be deployed to a Netlify owned site. To deploy to your own site then set the environment
variable `NETLIFY_SITE_ID` to your site ID._

## Feedback

Expand Down

0 comments on commit 793ea73

Please sign in to comment.