100 Commits
Author SHA1 Message Date
Lee RobinsonandGitHub b2c20c9f90 docs: remove catch-all for opengraph-image (#74338)
x-ref: https://github.com/vercel/next.js/issues/49630
2024-12-27 19:30:10 -06:00
72b52e7c86 docs: update ISR self-hosting example code (#74211)
Co-authored-by: JJ Kasper <[email protected]>
2024-12-22 11:36:26 -06:00
Lee RobinsonandGitHub 2de57bdcbf docs: minor typos and fixes (#73955)
Replaces https://github.com/vercel/next.js/pull/73717,
https://github.com/vercel/next.js/pull/73719, and
https://github.com/vercel/next.js/pull/73788.
2024-12-15 16:08:24 -06:00
Lee RobinsonandGitHub 92979e03c6 docs: add versions to connection API (#73798)
Small improvement here to clarify versions.
2024-12-11 09:29:44 -06:00
Lee RobinsonandGitHub fb12264fe3 examples: move Postgres example (#73531)
This has a new home, with an updated template.

https://github.com/vercel/postgres-next-starter
2024-12-04 17:51:11 -06:00
Lee RobinsonandGitHub 953a8c9f1d docs: Fix codeblock switcher (#73436)
https://nextjs.org/docs/app/api-reference/components/link#prefetching-links-in-middleware
2024-12-02 17:58:21 +00:00
87c74c8254 docs: add details on React Compiler annotations with "use memo" (#73053)
While the React Compiler is still in beta, this functionality was not
yet documented. I also updated this to remove the 15 RC since 15 is now
stable.

Co-authored-by: Sam Ko <[email protected]>
2024-11-22 21:08:30 +00:00
Lee RobinsonandGitHub d434b4ce84 Revert "docs: add Fleek's Next.js template" (#73054)
Reverts vercel/next.js#72988

Right now, we're focused on making sure the examples linked are
guaranteed to work and placed inside the Next.js community GitHub
organization.
2024-11-21 11:41:25 -06:00
89ee26cc76 docs: add deploy templates (#71742)
This adds our community maintained templates from:
https://github.com/nextjs

---------

Co-authored-by: JJ Kasper <[email protected]>
2024-10-29 13:06:18 -07:00
Lee RobinsonandGitHub 4e05544788 docs: small updates for canary docs (#71317)
- Rework bullet points from blog post
- Fix relative links mentioning Notion from copy/pasta
- Move the unstable APIs to the bottom of the list
2024-10-15 14:28:03 -04:00
Lee RobinsonandGitHub ca5eb3973a docs: self-hosting video (#71127)
Link to tutorial video recently published:
https://www.youtube.com/watch?v=sIVL4JMqRfc
2024-10-11 11:03:25 -05:00
7f41ea9111 docs: update prerender error (#69744)
Just adding more details here, as it was pretty bare before.

---------

Co-authored-by: JJ Kasper <[email protected]>
2024-09-13 18:17:51 +00:00
Lee RobinsonandGitHub 1e43331253 docs: fix PWA docs (#70050)
Smol one that I missed!
2024-09-12 19:31:35 -07:00
56dc3ed5c9 breaking: remove geo and ip from NextRequest (#68379)
### Overview 

This PR removes the `geo` and `ip` properties from `NextRequest` for
Next.js 15. These values had to be provided by your hosting provider.
Since this feature was not generally useful for the broader Next.js
community (outside of Vercel), we feel it makes more sense to keep this
as a Vercel-specific feature and not something built into the framework.

### Alternatives

If you are using Vercel, you can alternatively use the `geolocation` and
`ipAddress` functions from
[`@vercel/functions`](https://vercel.com/docs/functions/vercel-functions-package)
instead:

```js filename="middleware.ts"
import { geolocation, ipAddress } from '@vercel/functions';
import type { NextRequest } from 'next/server'

export function middleware(request: NextRequest) {
  const { city } = geolocation(request);
  const ip = ipAddress(request)

  // ...
}
```

---------

Co-authored-by: Eng Zer Jun <[email protected]>
2024-09-12 14:22:03 -07:00
Lee RobinsonandGitHub 63e029804e docs: fix data fetching with ORM (#69702)
Follow up from https://github.com/vercel/next.js/pull/69695.
2024-09-04 19:56:45 -05:00
Lee RobinsonandGitHub a18cd16763 docs: Update unstable_cache indentation (#69700) 2024-09-04 19:52:40 -05:00
Lee RobinsonandGitHub db71b6a70c docs: add PWA docs with App Router (#69647)
This adds a guide explaining how to create a PWA with the Next.js App
Router. This includes support for push notifications, installing the app
to your home screen, using a service worker, and more.
2024-09-04 19:20:24 -05:00
Lee RobinsonandGitHub 568df76bd9 docs: add links to search params on server/client (#69618)
x-ref:
https://www.reddit.com/r/nextjs/comments/1f7eeij/what_do_you_absolutely_hate_about_nextjs_you_can/ll7ig41/
2024-09-04 11:32:26 -05:00
Lee RobinsonandGitHub b9b9d68e67 examples: Supabase follow up fixes (#69392) 2024-09-03 22:02:01 -05:00
Lee RobinsonandGitHub ec46f90739 docs: Use useFormState over useActionState (#69547)
We recently merged and combined the RC docs into the main docs, so there
is a single codebase. This added new icons and callouts for parts of
Next.js that are experimental or in a canary release.

However, this gets a little tricky with React 19. There have been
changes to `useFormState` and `useFormStatus` which differ from the
latest v14.x release and 15 + React 19 RC.

As 14 is still the stable release, we need to default to showing
`useFormState` and add proper callouts for those on canary/RC. I also
added more details to the upgrade guide for v15.
2024-09-01 22:16:38 -05:00
Lee RobinsonandGitHub ad268ef318 docs: improve no async client components page (#69440)
Some good feedback that this page was very barebones. Added more details
and options.
2024-08-29 09:23:43 -05:00
Lee RobinsonandGitHub f149d08e01 docs: fix link in data fetching (#69382)
Reported here: https://x.com/gokul_i/status/1828247558419874183
2024-08-27 23:46:27 -05:00
Lee RobinsonandGitHub cfab473ac8 docs: clarify caching (#69391)
When merging the RC docs into the stable docs, we need to revert changes
that apply to core behaviors that have not yet landed on a stable
version.
2024-08-27 21:03:10 -05:00
Lee RobinsonandGitHub 46c67764a7 docs: fix 404 with debugging guide (#69377)
Follow up from https://github.com/vercel/next.js/pull/69367. I believe
they need to be the same number. The app page is currently 404ing.
2024-08-27 13:39:21 -05:00
Lee RobinsonandGitHub 01ae44bbb7 docs: fix a few ISR docs follow up (#69315)
- Code block was accidentally being hidden
- This should have been `no-store` to opt-out of caching
2024-08-26 11:13:52 -07:00
Lee RobinsonandGitHub fea70f39d0 docs: improve data fetching docs and add ISR page (#69285)
This updates the data fetching, caching, and revalidating pages to use a
more standardized template. There is also now more direct, concise
examples and code snippets. Finally, I broke out "revalidating" into a
new ISR page, to better match the terms people are searching for.
2024-08-26 11:23:10 -05:00
Lee RobinsonandGitHub f214bd8b7f docs: remove broken link (#69209)
Addresses https://github.com/vercel/feedback/issues/71759.
2024-08-26 11:22:38 -05:00
Lee RobinsonandGitHub 18dbf34d7a docs: examples page (#69187) 2024-08-26 11:22:30 -05:00
0faaf7aeab docs: clarify caching of fetch based on comment (#68419)
This code snippet comment was misleading, needs to be updated for
Next.js 15 behavior.

Co-authored-by: Delba de Oliveira <[email protected]>
2024-08-06 18:06:24 +01:00
726dabf0ca docs: Improve PPR config/rendering sections (#68210)
Co-authored-by: Delba de Oliveira <[email protected]>
2024-08-01 15:08:37 -05:00
Lee RobinsonandGitHub cab4b65399 docs: small follow up for custom server (#68334)
https://rc.nextjs.org/docs/app/building-your-application/configuring/custom-server
2024-07-30 19:57:48 -05:00
eedbfa1f91 docs: fix code block for server action (#68268)
Co-authored-by: Delba de Oliveira <[email protected]>
2024-07-30 12:03:41 -05:00
Lee RobinsonandGitHub af267a2baa docs: Custom Server for App Router (#68167)
Closes https://github.com/vercel/next.js/issues/59453
Answers https://github.com/vercel/next.js/discussions/49326
Answers https://github.com/vercel/next.js/discussions/55283
2024-07-30 16:58:12 +01:00
Lee RobinsonandGitHub bc89335905 docs: update Pages Router caching docs for SSR / getServerSideProps (#68092)
Source:
https://www.reddit.com/r/nextjs/comments/1ea5oyu/ssr_page_routing_via_getstaticprops_and_edge/
2024-07-25 11:58:19 -05:00
Lee RobinsonandGitHub d36f0bbf91 docs: mention useParams in incremental adoption guide (#68010)
Replaces https://github.com/vercel/next.js/pull/60104 with merge
conflicts (can't edit)
2024-07-23 23:34:05 -05:00
Lee RobinsonandGitHub 9068a06db1 docs: add note about Turborepo to CI section (#67996) 2024-07-23 23:33:35 -05:00
Lee RobinsonandGitHub 9caa2fdc4d docs: update sitemap version history (#68009)
Closes https://github.com/vercel/next.js/issues/67834.
2024-07-22 18:45:53 -05:00
Lee RobinsonandGitHub 761b60ef5a docs: address comments on RC (#67774) 2024-07-15 13:55:26 +01:00
Lee RobinsonandGitHub 90877a2550 docs: add server actions to unsupported features of static exports (#67507)
Server actions require running code on-demand (as an API route) and
cannot be used without a server environment.
2024-07-08 15:39:56 -05:00
Lee RobinsonandGitHub 0115636230 docs: Improve error handling docs (#67332)
Based on this discussion:
https://github.com/vercel/next.js/discussions/62681
2024-07-01 11:10:31 -05:00
Lee RobinsonandGitHub 8b5661eb45 docs: static exports (#67181) 2024-06-25 08:05:09 -05:00
Lee RobinsonandGitHub c037473531 Move create-next-app public/ assets from local folder→ remote URL (#66931)
To reduce the number of files cloned during `create-next-app`, this PR
shifts the SVG assets placed in the `public/` folder to instead by
consumed from the Next.js site.

Since these are SVG files (vector images), the Image component does
_not_ optimize them with image optimization. Image optimization only
applies to raster images (like `.png` or `.jpg`). This means it's
effectively similar to using the `unoptimized` prop on the `Image`
component, which means you don't need to add `remotePatterns` to
`next.config.js` – which would be midly annoying for the
`create-next-app` starter.

I also renamed `file-text.svg` to `file.svg` so the URL is shorter.
These assets will be live on .org any minute now.
2024-06-16 11:42:27 -07:00
da8fb8ebc8 docs: Update Route Handlers docs for dynamic (#66010)
- Remove unnecessary `dynamic` route segment configs
- Add version history
- Remove caching opt-out section, since it's dynamic now

---------

Co-authored-by: JJ Kasper <[email protected]>
2024-05-20 22:40:05 -05:00
Lee RobinsonandGitHub a142012428 docs: clarify gSSP docs for runtime (#65962)
Replaces https://github.com/vercel/next.js/pull/65948.
2024-05-20 09:50:58 -05:00
09a385669b fix: ignore all .env files for create-next-app by default (#61920)
We've seen too many instances of folks accidentally committing their
`.env` files that I feel it's time to make this change.

Up until now, Next.js has recommended that you use `.env.local` when
working locally to store your environment variables. Some developers do
intentionally want to commit their `.env` file without secret values to
source control. However, the ecosystem is fragmented on `.local`
support.

There are tools which require secrets values that do _not_ support
`.local` and require using `.env`. This means that it's possible to dump
your secret values into a `.env` file and commit to source control,
thinking that the defaults would have you covered.

This change updates the defaults for `create-next-app` to ignore all
`.env` files by default. If you want to commit then, you opt-in by
modifying your `.gitignore`, versus the opposite.

Related: https://x.com/complexlity/status/1755890800527892716

---------

Co-authored-by: Sam Ko <[email protected]>
2024-05-09 11:21:27 -07:00
d8e1e50524 docs: update Route Handler streaming example (#65286)
Co-authored-by: JJ Kasper <[email protected]>
2024-05-02 16:46:27 -05:00
Lee RobinsonandGitHub b1db5f81fd docs: fix MDX codeblock (#64673) 2024-04-17 18:18:16 +00:00
Lee RobinsonandGitHub 07a0700dcb docs: clarify runtime (#64593) 2024-04-16 22:52:53 -05:00
Lee RobinsonandGitHub 50ed4542df docs: fix config variable usage in memory docs (#64469)
Closes https://github.com/vercel/feedback/issues/61864
2024-04-14 11:00:36 -05:00
436264ffbc docs: add note about streaming and Safari limitations (#64179)
https://bugs.webkit.org/show_bug.cgi?id=252413

---------

Co-authored-by: Steven <[email protected]>
2024-04-08 07:38:44 -05:00
83bd0f43e1 docs: improve prerender error message (#64154)
Based on customer feedback

---------

Co-authored-by: JJ Kasper <[email protected]>
2024-04-07 09:46:13 -05:00
Lee RobinsonandGitHub e148eac4a8 docs: clarify perf benefits of RSC (#63096)
Source: https://twitter.com/AnthonyPAlicea/status/1766262535026606134
2024-03-10 19:49:46 -05:00
Lee RobinsonandGitHub 1d00ed4bf1 docs: clarify client component intro (#62767)
"Render on the client" could sound like client-only rendering.
2024-03-02 16:39:04 -06:00
Lee RobinsonandGitHub c48a0f8e6d docs: add link to Blob (#62056) 2024-02-14 11:06:47 -05:00
Lee RobinsonandGitHub 09a764d0fc docs: follow up from CRA docs (#61893) 2024-02-10 11:59:17 -06:00
479faa7117 docs: migrating from CRA (#61866)
Co-authored-by: Michael Novotny <[email protected]>
2024-02-09 19:32:53 -06:00
Lee RobinsonandGitHub 5d01e4e608 docs: add Lucia auth (#61255) 2024-01-27 09:25:40 -06:00
Lee RobinsonandGitHub c5d470a491 docs: fix Auth0 typo in authentication (#61171) 2024-01-25 23:20:00 +01:00
d7ff67de67 docs: Combine Pages/App authentication docs (#60848)
Co-authored-by: StephDietz <[email protected]>
Co-authored-by: Stephanie Dietz <[email protected]>
2024-01-25 13:32:02 -06:00
Lee RobinsonandGitHub 524f4c8178 docs: clarify nginx buffering disable (#61010)
https://github.com/vercel/next.js/pull/60943#issuecomment-1904413114
2024-01-22 19:09:30 -06:00
Lee RobinsonandGitHub 5e80715040 docs: streaming while self-hosting must disable buffering (#60943)
Closes https://github.com/vercel/next.js/issues/54667
2024-01-21 10:52:03 -06:00
Lee RobinsonandGitHub 40e2c4623e docs: small tweak to videos (#60904) 2024-01-19 16:01:50 -06:00
Lee RobinsonandGitHub ae46eb8835 docs: small tweaks on video docs (#60902)
https://nextjs.org/docs/app/building-your-application/optimizing/videos
2024-01-19 15:28:30 -06:00
Lee RobinsonandGitHub 4f07843de5 docs: another fix for code block (#60856) 2024-01-18 18:09:11 -06:00
Lee RobinsonandGitHub 1cafe945ab docs: fix JS/TS code block (#60854)
And also making it more clear it doesn't have to be two separate files.
2024-01-18 17:48:24 -06:00
Lee RobinsonandGitHub 1941fc1672 docs: Improve useSearchParams bailout error page (#60852) 2024-01-18 17:12:50 -06:00
Lee RobinsonandGitHub ecbc36cdd2 Fix error from the auth docs. (#60829) 2024-01-18 10:24:39 -06:00
16dcebe792 Stabilize custom cache handlers and changing memory size. (#57953)
This PR stabilizes the previously introduced experimental config options
for providing a custom cache handler (for both ISR as well as the Data
Cache) and for disabling or configuring the in-memory cache size. The
example usage would be as follows:

```js
// next.config.js
module.exports = {
  cacheHandler: require.resolve('./cache-handler.js'),
  cacheMaxMemorySize: 0 // disable default in-memory caching
}
```

This PR also updates the documentation to better reflect how to use the
custom cache handler when self-hosting. Further information will be
added in a following PR that also includes a full example of a custom
cache handler that implements `revalidateTag` as well as passing in
custom cache tags. The API reference docs have been updated here, as
well as a version history added.

I also noticed that we currently have two duplicated versions of the ISR
docs in the Pages Router docs: both for rendering and for data fetching.
Data Fetching is the correct location for this page. There were no other
references to the rendering version in the docs, so that must have been
an accident. I'll need to a get a redirect going for that regardless.

Tests have been updated for `cacheHandler` and I added a new test for
`cacheMaxMemorySize`.

---------

Co-authored-by: Jiachi Liu <[email protected]>
2024-01-17 23:42:52 +01:00
Lee RobinsonandGitHub b177ff6488 examples: Update redis example with useOptimistic (#60596) 2024-01-15 21:19:59 -06:00
Lee RobinsonandGitHub 126c7f2429 docs: remove Next 13 mention for App Router (#60632) 2024-01-14 11:33:37 -06:00
Lee RobinsonandGitHub fcb635e1cd docs: Update Google Analytics error doc (#60612)
Closes https://github.com/vercel/next.js/issues/60598.
2024-01-13 12:27:41 -06:00
Lee RobinsonandGitHub bf63ddb4d9 examples: Update hello world (#60502) 2024-01-10 22:15:21 -06:00
fb73c3a9d2 Add reproduction for HMR moving / renaming files. (#57230)
Pairing with @timneutkens. Passes with webpack, fails with Turbopack.

```
TURBOPACK=1 pn testonly-dev test/development/app-dir/hmr-move-file
```

---------

Co-authored-by: Leah <[email protected]>
Co-authored-by: Tobias Koppers <[email protected]>
2024-01-09 19:02:00 +01:00
Lee RobinsonandGitHub a5ae1a6653 docs: Add docs for next dev --experimental-https (#60357) 2024-01-07 11:32:27 -06:00
Lee RobinsonandGitHub 779a373460 docs: address a few open issues (#60329)
Closes https://github.com/vercel/next.js/issues/42095.
Closes https://github.com/vercel/next.js/issues/59215.
2024-01-06 11:04:17 -06:00
Lee RobinsonandGitHub e566f3297f docs: add example of webhooks with App Router (#60276)
Full example of one with GitHub:
https://raw.githubusercontent.com/leerob/on-demand-isr/main/app/api/webhook/route.ts
2024-01-06 10:02:56 -06:00
Lee RobinsonandGitHub e9fb28c6fd docs: improve grammar (#60149) 2024-01-02 18:40:33 -06:00
Lee RobinsonandGitHub ab7142a68b docs: ⌘+Enter for forms (#60090) 2024-01-01 20:32:26 -06:00
Lee RobinsonandGitHub 8e3e4adfb9 docs: update maxDuration info (#60086) 2024-01-01 14:21:57 -06:00
Lee RobinsonandGitHub 5071fcad81 docs: clarify generateStaticParams and dynamicParams (#60083) 2024-01-01 13:00:06 -06:00
Lee RobinsonandGitHub 80f4a979d1 docs: update install count (#60072) 2023-12-31 17:18:45 -06:00
Lee RobinsonandGitHub 64e905132a docs: Add section for CSP without nonces (#60067) 2023-12-31 09:28:19 -06:00
Lee RobinsonandGitHub fa32e32df4 docs: clarify using redirect with client components (#60056)
Based on feedback from https://github.com/vercel/next.js/issues/54676.
2023-12-30 21:18:10 -06:00
Lee RobinsonandGitHub 9986e82263 examples: Update next-forms example (#60052)
- Remove `experimental_` import for `useFormStatus`
- Update all dependencies
- Move to `postgres` so it works with any Postgres provider
- Fix a TypeScript issue
- Use `next dev --turbo`
2023-12-30 11:17:14 -06:00
Lee RobinsonandGitHub df14fdfa25 docs: fix typo for useFormState (#60010) 2023-12-28 18:22:11 -06:00
Lee RobinsonandGitHub 548a07ff6b docs: opengraph / twitter image needs absolute URL (#59985) 2023-12-27 22:48:56 -06:00
Lee RobinsonandGitHub 9e37c327a4 docs: small changes to linking docs (#59982) 2023-12-27 22:48:21 -06:00
Lee RobinsonandGitHub 7c7d981b2d examples: progressive enhancement for Redis example (#59937)
The example had `useOptimistic` and wasn't structured so that the
browser could fall back to `action` if JS was still loading or disabled.
2023-12-25 20:07:13 -06:00
Lee RobinsonandGitHub 0fc1d9e982 examples: update Redis to App Router (#59311) 2023-12-24 10:09:23 -06:00
Lee RobinsonandGitHub 142e7080a5 docs: clarify setting and reading cookies from Route Handlers (#59915)
Replaces https://github.com/vercel/next.js/pull/57052
2023-12-24 10:02:50 -06:00
Lee RobinsonandGitHub 3d9a1b481e examples: add required env vars to auth example. (#59901) 2023-12-23 10:27:33 -06:00
Lee RobinsonandGitHub 4225da8cba examples: Add new NextAuth.js example (#56914) 2023-12-23 10:21:26 -06:00
Lee RobinsonandGitHub 29fcd57ed1 docs: clarify data fetching pattern (#59602)
You don't fetch data with Server Actions, but mutate.
2023-12-19 20:24:21 -06:00
1c65c55750 docs: improve docs around geolocation and IP headers (#59719)
Based on feedback from https://github.com/vercel/next.js/issues/47793, I
made some improvements around the geolocation docs. Specifically around
`request.ip`, `request.geo`, and how to access these values. I noticed
there was a bit of a divergence, as some of the `NextRequest` and
`NextResponse` docs were split out for the App Router section, but not
all.

This PR finishes that swing by removing the previous catch-all for
`next/server` in the Pages Router docs and splits them into individual
docs pages.

Wrote a lil' thread about this:
https://twitter.com/leeerob/status/1736543599339172121

---------

Co-authored-by: Delba de Oliveira <[email protected]>
2023-12-18 07:55:48 -06:00
Lee RobinsonandGitHub 64d539fc50 docs: fix broken backtick for link (#59717)
<img width="764" alt="CleanShot 2023-12-17 at 11 25 10@2x"
src="https://github.com/vercel/next.js/assets/9113740/437a8a0d-0f56-4199-9629-b767569349de">
2023-12-17 09:53:59 -08:00
Lee RobinsonandGitHub 565c5b20b0 docs: small tweaks (#59638)
Just some random cleanup I wanted to do.
2023-12-16 14:13:17 -06:00
Lee RobinsonandGitHub c542a761d2 docs: remove broken link in webpack section (#59487) 2023-12-11 08:59:58 -06:00
Lee RobinsonandGitHub bb3f0a21a0 docs: fix broken link to learn course (#59288)
Addresses https://github.com/vercel/feedback/issues/47802.
2023-12-05 08:39:54 -06:00
Lee RobinsonandGitHub 9656f15a48 docs: patch upgrade guide to pin install version (#58993)
Closes https://github.com/vercel/feedback/issues/47076.
2023-11-29 08:26:03 +00:00
Lee RobinsonandGitHub 41d890aaec examples: Remove outdated example (#58568)
Closes https://github.com/vercel/next.js/issues/54309.
2023-11-16 22:08:23 -06:00