Commit graph

3152 commits

Author SHA1 Message Date
FoSuCloud
77b21001cc
Fix(example) : Image missing width property in with-redux example (#63546)
- Fixes https://github.com/vercel/next.js/issues/63542

Co-authored-by: yelipei <yelipei@qianxin.com>
Co-authored-by: Steven <steven@ceriously.com>
2024-03-21 18:24:21 +00:00
Cody Olsen
f25ae9a0f9
Update Sanity example deps (#63514)
Most notably it updates `typescript` to `5.4.2` now that Sanity Studio
is updated to support the [more aggressive reduction of intersections
between type variables and primitive
types](https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/#more-aggressive-reduction-of-intersections-between-type-variables-and-primitive-types)
2024-03-20 15:14:16 -04:00
Koji Onishi
430e71a38d
update Docker examples to specify HOSTNAME properly (#59756)
### What?

Update docker examples to correctly set HOSTNAME env variable for
standalone output

Related to PR:
https://github.com/vercel/next.js/pull/52804

### Why?
### TL;DR

The dockerfiile examples need to modified as that contains HOSTNAME
setting that apparently is not working as expected.

Related to Issue:
https://github.com/vercel/next.js/issues/58657

Affected examples:
https://github.com/vercel/next.js/tree/canary/examples/with-docker

https://github.com/vercel/next.js/tree/canary/examples/with-docker-multi-env

### Longer explanations

Based on [Docker
document](https://docs.docker.com/engine/reference/builder/#environment-replacement):
> You can also use environment variables with RUN, CMD, and ENTRYPOINT
instructions, but in those cases the variable substitution is handled by
the command shell, not the builder.

It means that when executing the last CMD ( `node server.js` ) in
Dockerfile samples, the HOSTNAME defined by prior `ENV` instruction is
simply ignored.

This causes problems typically when the host process sets HOSTNAME -
e.g. for instance when using AWS Fargate for deployment [we can't have
control over HOSTNAME](https://stackoverflow.com/a/52871552) set by the
host process. (also refer to the issue #58657 above)

### How?

Updated Dockerfilie samples, by setting HOSTNAME directly in CMD
instruction that launches nextjs server, not in the builder process.

Used this setting at my end (with AWS Fargate) to confirm that it fixes
the network problem.

Closes NEXT-
Fixes #58657

Co-authored-by: Sam Ko <sam@vercel.com>
2024-03-19 21:26:44 +00:00
Arian
a2e3b27dfc
Migrate the with-jotai example from page router to app router (#63390)
## Migrate the with-jotai example from page router to app router

Please if it needs further updates, Let me know!
Happy to contribute

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-03-18 21:28:29 +00:00
Ellert Smári Kristbergsson
08d7a7e518
Update to the Stable API (#60493)
Update MongoDB according to their guidance for their new Stable API 

See:
https://www.mongodb.com/docs/drivers/node/current/fundamentals/stable-api/

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-03-13 18:04:59 +00:00
Cody Olsen
aeb4d724c1
Fix pnpm support in Sanity example (#63249)
As `@sanity/preview-url-secret` wasn't declared as a dependency when
doing:
```bash
pnpm install && pnpm build
```
It would fail to compile:
```bash
Linting and checking validity of types  .Failed to compile.

./app/api/draft/route.tsx:6:36
Type error: Cannot find module '@sanity/preview-url-secret' or its corresponding type declarations.

  4 |  */
  5 |
> 6 | import { validatePreviewUrl } from "@sanity/preview-url-secret";
    |                                    ^
  7 | import { draftMode } from "next/headers";
  8 | import { redirect } from "next/navigation";
  9 |
```
2024-03-13 17:52:56 +00:00
Cody Olsen
f1d72998e8
Update Sanity example for App Router (#63187)
- Updates deps with minor bugfixes.
- Fixes typos and removes debug console logs.
- Less aggressive validation rules for alt text
2024-03-12 16:50:04 -07:00
Maksym Pinchuk
1ab1c4ca34
chore(examples): remove duplicate line in .gitignore for progressive-web-app example (#63207) 2024-03-12 18:09:24 -04:00
Sam Ko
3f1ae54319
Revert "fix: permissions in with-docker example" (#63165)
Reverts vercel/next.js#63134

Closes NEXT-2783
2024-03-11 17:36:11 -07:00
Aaron Campbell
c703fae24c
Allow unsafe-eval during development (#55998)
Fixes issue where a freshly cloned example will not work in development
mode due to `unsafe-eval` being blocked by the CSP.

Currently, the example will not work in development. Running the example
with `run dev` will produce EvalError errors in console which prevent
the app from functioning. This error also prevents any `<Script>`
components with `afterInteractive` from being loaded. These issues do
not occur in production where `eval` is not used.

This PR:
- Fixes the issue by allowing `unsafe-eval` if the environment is not
`production`.
- Improves the `script-src` value by [allowing backwards compatibility
with
browsers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#strict-dynamic)
that do not support `strict-dynamic` (`https: http: 'unsafe-inline'`
will be ignored by browsers that support `strict-dynamic`).

Some further details are available here:
https://github.com/vercel/next.js/issues/55638. This PR is not a fix for
the issue however.

- Fixes https://github.com/vercel/next.js/issues/61316

Co-authored-by: Sam Ko <sam@vercel.com>
2024-03-11 18:15:13 +00:00
Kinbaum
51665b3640
fix: permissions in with-docker example (#63134)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

### What

This pr addresses an issue in Docker where the cache and the creation of
its contents throw the following error:

```
[Error: EACCES: permission denied, mkdir '/app/.next/cache'] {
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/app/.next/cache'
```

Co-authored-by: Sam Ko <sam@vercel.com>
2024-03-11 16:33:03 +00:00
Casey Ocampo
44626ed4e5
fix(examples): dynamically update page title (#63110)
### What?


[blog-starter-kit](https://vercel.com/templates/next.js/blog-starter-kit)'s
page title does not update when navigating to a blog post.

### Why?

The `title` property was missing from:

```
return {
    title, // missing
    openGraph: {
      title,
      images: [post.ogImage.url],
    },
  };
```

Closes NEXT-[Page title is not dynamically updating #63083
](https://github.com/vercel/next.js/issues/63083)
Fixes #63083
2024-03-11 08:42:37 -07:00
Cody Olsen
41019c2314
Update Sanity example for App Router (#63045)
This PR updates the `cms-sanity` example to use:
- App Router
- TypeScript
- Sanity Studio v3 instead of v2
- Embeds the Studio inside the next app on the `/studio` route.
- ISR / Data Cache (revalidations through `revalidatePath` while in Live
Visual Editing, time-based to match the Sanity API CDN in production).
- Support Vercel Visual Editing out of the box.
- The new `next-sanity/image` component.
- Vercel Speed Insights.
- The Sanity Presentation Tool for live content previews.
- Sanity Portable Text setup to fully support `@tailwindcss/typography`.
- [AI Assist](https://www.sanity.io/docs/ai-assist)
  - Auto fill in `alt` text on images.
  - Preset prompts for content creation
2024-03-10 19:49:18 -07:00
Alex Ravenna
f9d84b561c
fix internal Markdown links in Sanity example readme (#63069)
### What?
I fixed two of the Markdown subheadline links in the Sanity example
readme.

### Why?
The weren't working.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-03-08 23:08:40 +00:00
Karl Horky
d71a842f89
Switch CodeSandbox repros to pnpm (#63038)
Closes #57895
Closes #57896

### What?

Switch Yarn v1 to pnpm for reproduction repos, avoiding the CodeSandbox
Yarn v1 `yarn.lock` caching problem described below

### Why?

As confirmed with @CompuIves, CodeSandbox caches the `yarn.lock` file
generated after the first start + `yarn install` of a GitHub template
(Yarn v1) - this saves old versions of Next.js (not the latest canary)
in the lockfile and causes old versions of Next.js to be installed when
users click on the CodeSandbox Reproduction link during issue creation.

This leads to the current breakage, where Next.js actually cannot even
start in the reproduction sandbox:

1. Start creating a new GitHub issue on the `vercel/next` GitHub repo
2. Open [the CodeSandbox reproduction
link](https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template)
linked in the **Link to the code that reproduces this issue** section
3. Observe the error message below in the `dev` task started below
(`experimental.appDir: true` was required in the `13.0.8-canary.0`
version of Next.js in the cached `yarn.lock` file, but the
`next.config.js` file no longer includes this config)

```bash
$ yarn dev
yarn run v1.22.19
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
Error: > The `app` directory is experimental. To enable, add `appDir: true` to your `next.config.js` configuration under `experimental`. See https://nextjs.org/docs/messages/experimental-app-dir-config
    at Object.findPagesDir (/project/sandbox/node_modules/next/dist/lib/find-pages-dir.js:80:19)
    at new DevServer (/project/sandbox/node_modules/next/dist/server/dev/next-dev-server.js:110:59)
    at NextServer.createServer (/project/sandbox/node_modules/next/dist/server/next.js:140:20)
    at /project/sandbox/node_modules/next/dist/server/next.js:155:42
    at async NextServer.prepare (/project/sandbox/node_modules/next/dist/server/next.js:130:24)
    at async /project/sandbox/node_modules/next/dist/cli/next-dev.js:344:17
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

Sandbox demo:
https://codesandbox.io/p/sandbox/quirky-pascal-n32xk2?file=%2Fnext.config.js%3A5%2C1

![Screenshot 2023-11-01 at 16 09
59](https://github.com/vercel/next.js/assets/1935696/b8287a2e-86b4-4c08-afca-bc9219b6d411)

### How?

Switch to pnpm installation commands instead of Yarn v1

### Caveats

This uses CodeSandbox-specific config

### Alternatives considered

- Delete the outdated yarn.lock file on setup of the sandbox, PR open
here: #57895
- Commit an empty `yarn.lock` file to block caching of this file, PR
open here: #57896

cc @samcx @CompuIves
2024-03-08 14:09:59 +00:00
Nhan Doan
22de32702c
chore(blog-starter): update import paths to use aliases (#62986)
### What?
Update import paths to use aliases.

### Why?
For clearer and shorter imports.

### How?

https://nextjs.org/docs/app/building-your-application/configuring/absolute-imports-and-module-aliases

Co-authored-by: Sam Ko <sam@vercel.com>
2024-03-07 17:08:06 -08:00
Darius Cepulis
eace44d129
with-mux-video: move to app router and update packages (#62297)
## App Router

Moves the `with-mux-video` example to idiomatic App Router, with goodies
like
* server component data fetching
* server actions
* layouts
* route groups
* loading UI

## Mux Dependencies

* @mux/mux-node 7 -> 8
* @mux/mux-player-react 1 -> 2
* @mux/upchunk + custom UI -> @mux/mux-uploader

## In other news...

* Fleshed out the README
* Updated imagery
* Moved from styled jsx to tailwind and lightly updated styles

## Contributor Checklist

* [x] The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
* [x] Make sure the linting passes by running `pnpm build && pnpm lint`.
See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-03-07 22:08:49 +00:00
Arian
832cbb3330
chore: migrate basic-css example from page router to app router (#62980)
### Adding or Updating Examples

Migrate the basic-css example from page router to app router. If it
needs further updates, Please let me know

Happy to contribute

---------

Co-authored-by: Steven <steven@ceriously.com>
2024-03-07 15:44:13 +00:00
Sukka
c206d89ec2
feat(eslint): enhance no-unwanted-polyfill w/ new endpoints (#62719)
The PR adds the new `polyfill.io` instance endpoint (from Fastly and
Cloudflare) to the `eslint-plugin-next`'s `no-unwanted-polyfillio`
rules, so these new endpoints can be detected by the rule.

---

`polyfill.io` was acquired by **a China-based CDN company** "Funnull",
see [the announcement from the `polyfill.io` domain owner's
Twitter](https://x.com/JakeDChampion/status/1761315227008643367) and
https://github.com/polyfillpolyfill/polyfill-service/issues/2834.
Despite Funnull's claims of operating in the United States, the
predominance of Simplified Chinese on its website suggests otherwise,
and it turns out that **"Funnull" is notorious for providing service for
the betting and pornography industries**.

[The original creator of the `polyfill.io` has voiced his concern on
Twitter](https://twitter.com/triblondon/status/1761852117579427975). And
since the acquisition, numerous issues have emerged
(https://github.com/polyfillpolyfill/polyfill-service/issues/2835,
https://github.com/polyfillpolyfill/polyfill-service/issues/2838,
https://github.com/alist-org/alist/issues/6100), rendering the
`polyfill.io` service **extremely unstable**. Since then, Fastly
([Announcement](https://community.fastly.com/t/new-options-for-polyfill-io-users/2540))
and Cloudflare
([Announcement](https://blog.cloudflare.com/polyfill-io-now-available-on-cdnjs-reduce-your-supply-chain-risk))
has hosted their own instances of `polyfill.io` service.

---------

Co-authored-by: Steven <steven@ceriously.com>
2024-03-06 16:42:53 +00:00
Tim Neutkens
1cb3b4e265
Fix with-joi example (#62877)
## What?

`next-connect` signature has changed so the example failed to run.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2712
2024-03-05 14:56:56 +01:00
Tim Neutkens
96f88e0d8e
Remove cms-keystonejs-embedded and link to official docs (#62876)
## What?

The example was severely outdated and couldn't `npm install`. This
ensures the latest example can always be used from the Keystone
documentation.


<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2709
2024-03-05 14:34:45 +01:00
Tim Neutkens
c59b391beb
Fix with-passport-and-next-connect import (#62874)
## What?

This example had a wrong import but somehow it still compiled with
webpack. Correctly fails in Turbopack. This adjusts the import to use
the package specified in `package.json`.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2708
2024-03-05 13:11:49 +01:00
Tim Neutkens
c4a5bf5bc0
Fix with-supertokens example (#62817)
## What?

There was a dependency missing that would immediately cause issues.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2686
2024-03-04 21:47:15 +01:00
Tim Neutkens
4ff41caf73
Fix with-quill-js example (#62819)
## What?

Fixes the `dynamic()` call to use the correct syntax.


<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-03-04 16:49:58 +01:00
Tim Neutkens
7822ffcee6
Fix react-native-web example for Turbopack (#62814)
## What?

This example needs a resolve alias which is added in this PR.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2685
2024-03-04 15:46:35 +01:00
Tim Neutkens
8a30860222
Remove deprecated library example (#62813)
## What?

Per the readme here: https://github.com/airbnb/react-with-styles#readme
the library is no longer used.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2684
2024-03-04 15:33:21 +01:00
Tim Neutkens
83c09e5bde
Remove with-reasonml-todo example (#62812)
## What?

Removes this outdated example.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2683
2024-03-04 15:30:53 +01:00
Tim Neutkens
2af956e124
Remove with-semantic-ui example (#62811)
## What?

Removes the outdated example.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2682
2024-03-04 14:21:49 +00:00
Tim Neutkens
463edba93c
Add missing dependencies to with-mdbreact (#62810)
## What?

This example imports two libraries that weren't listed in package.json.
This PR adds them.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2681
2024-03-04 15:04:23 +01:00
Tim Neutkens
2f062d61cf
Link to iron-session example (#62808)
## What?

The current example is outdated so I've removed it and linked to the
package's own example.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2680
2024-03-04 14:46:28 +01:00
Tim Neutkens
04bda302e4
Update with-webassembly example to fix hydration error (#62807)
## What?

This example hasn't been touched since I first added it, updates it to
use App Router and leverage server components, much simpler
implementation 😌

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2679
2024-03-04 14:16:35 +01:00
Tim Neutkens
dd98e7740d
Update auth-with-stytch example to link to the official guide (#62770)
## What?

This example was outdated and using deprecated libraries, also failing
with Turbopack because it used edge-cases in webpack to function. I've
removed the example code and left a link to their official documentation
which I'm assuming is maintained.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2670
2024-03-04 13:53:58 +01:00
Tim Neutkens
b7871953b2
Fix cms-plasmic example (#62790)
## What?

The `@plasmicapp/loader-nextjs` was outdated and doesn't work with the
latest version of Next.js.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2675
2024-03-03 19:32:48 +01:00
Tim Neutkens
a33ed996df
Fix error in api-routes-middleware example (#62788)
## What?

Currently it shows `TypeError [ERR_INVALID_ARG_TYPE]: The "string"
argument must be of type string or an instance of Buffer or
ArrayBuffer.`. It just needs to `JSON.stringify` the value as it can be
an array.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2674
2024-03-03 18:43:41 +01:00
Tim Neutkens
d01d6d9c35
Update with-emotion example (#62771)
## What?

Consolidates all emotion examples into a single one that uses the SWC
plugin by default, making sure you get the best experience.

Added the missing `@emotion/cache` dependency which also makes this
example work in Turbopack.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-03-03 08:04:32 +01:00
Tim Neutkens
79f103fb79
Fix invalid / import in with-facebook-pixel example (#62772)
## What?

This is an undocumented edge case in webpack handling of resolving.
Updates the import to be a normal path.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2672
2024-03-03 07:25:43 +01:00
Tim Neutkens
8c2edb4746
Update with-react-bootstrap to be Turbopack compatible (#62773)
## What?

This example used the legacy `~` operator which is no longer required in
latest webpack.

In case you land here trying Turbopack and running into the can't
resolve error this will be useful to know:

If you still need `~` it can be aliased using the `resolveAlias` option
in Turbopack:


```
module.exports = {
  experimental: {
    turbo: {
      resolveAlias: {
        '~*': '*',
      },
    },
  },
}
```

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2673
2024-03-03 07:25:30 +01:00
Balázs Orbán
f052fa8d6c
chore(examples): fix with-cypress build (#62614)
### What?

Fix the `with-cypress` example build errors.

### Why?

`next build` is broken.

### How?

exclude tests from compilation, fix import

Fixes #50124

Closes NEXT-2629
2024-02-27 23:54:52 +01:00
dongwon kim
e35ace6575
examples: add favicon.ico for to avoid browser requests (#62511)
## What?

To avoid the default `favicon.ico` request by the browser, we are adding
a vercel `favicon.ico` to the project.
Currently, we handle exceptions for `favicon.ico` entering the Dynamic
Route `[lang]` in the following manner, but in this case, favicon.ico
renders the entire page.


[example:app-dir-i18n-routing](https://github.com/vercel/next.js/blob/canary/examples/app-dir-i18n-routing/get-dictionary.ts#L12)
```ts
export const getDictionary = async (locale: Locale) =>
  dictionaries[locale]?.() ?? dictionaries.en();
```


Instead of `favicon.ico`, the full HTML of the default language 'en' is
rendered.
![스크린샷 2024-02-26 오전 1 17
56](https://github.com/vercel/next.js/assets/59330828/ea46b75b-ae93-4db4-9b4b-db33fb5d5709)

In the correct case
![스크린샷 2024-02-26 오전 1 24
49](https://github.com/vercel/next.js/assets/59330828/7faabec1-1fc7-4330-a5c3-30449efcace6)

Fixes https://github.com/vercel/next.js/issues/46918

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-26 17:29:27 +00:00
Miroslav Petrov
47d2dfdb54
Update examples/active-class-name (#62506)
### Description
The current implementation of the activeClassName example doesn't
support the `UrlObject` type for the "href" Link prop.
For example
```
<ActiveLink
  activeClassName="active"
  className="nav-link"
  href={{
    pathname: "/[slug]",
    query: {
      slug: "dynamic-route",
    },
  }}
>
  Dynamic Route
</ActiveLink>
```
won't work.

### Suggestion
We can use the `resolveHref` function to handle all cases.

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-26 16:40:16 +00:00
Arya Emami
7d4821de6f
examples: Update with-redux example to match the guide in Redux Toolkit docs (#59864) 2024-02-24 15:08:56 +00:00
Ryo H
ae524fb244
Fixed typo. (#62440)
### What?

I fixed the typo from `occured` to `occurred`.

Co-authored-by: Ryo H <49798519+ryobs@users.noreply.github.com>
2024-02-23 14:58:41 +01:00
Sina-Abdollahi
65369991d8
fix: 💯 typescript issue with-jest example (#62227)
So there are some toBe property's with React-testing-library that when
written shows this error for example: Property 'toBeInTheDocument' does
not exist on type 'JestMatchers<HTMLElement>'. the commit fixes it

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-20 00:07:35 +00:00
Jon Meyers
5b48db23b1
Add protected page and pending state to with-supabase example (#62211)
### What?

[1] Add protected page
[2] Add pending state

### Why?

[1] People using incorrect ways to protect pages
[2] No feedback that the login page is doing anything when buttons
clicked

### How?

[1] Redirect user to protected page after successful authentication
[2] Use useFormStatus to determine whether the form is in a pending
state

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-19 01:12:58 +00:00
mnjongerius
895e7df860
Patch 2 (#62147)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change
-->
### What?
Updating Example for Storyblok

### Why?
While setting up the Storyblok example to do create quick poc I noticed
some documentation missing and some code not working as expected.

### How?
- Updates documentation about Storyblok example in README
- Code change in HeroPost to make Storyblok example work as expected
2024-02-16 20:29:28 +00:00
Joseph
6fb3993fdc
fix: Check if the GET comments response was ok, otherwise throw (#62041)
Fixes #61941 example blog-with-comment.

The root issue is that the SWR fetcher does not check the `ok` status of the response, and that way we end up putting the error message object into the SWR data. And then `.map` is invoked in the object.

Since this is a learning kind of example, I think perhaps the presented change is just about enough to understand what's going on. Whether or not the people using the example want to gain access to the message from the server is up to them.
2024-02-14 15:03:40 +00:00
akfm
10599a4e1e
fix(examples): cache-handler-redis implementation may cause error "Socket already opened" on production (#61978)
### What?

I copied the contents of `cache-handler.js` and tried it, and got an
error `"Socket already opened"`.
ref: https://github.com/caching-tools/next-shared-cache/issues/284
It should be fixed so that it doesn't matter if it is copied.

### Why?

Because `Socket already opened`, so a condition is needed before `await
client.connect()`.

### How?

Add environment variable(`process.env.REDIS_AVAILABLE`) check.
ref:
https://caching-tools.github.io/next-shared-cache/configuration/opt-out-cache-on-build

Co-authored-by: akfm.sato <01047245@CF0286.local>
2024-02-13 23:45:11 +00:00
Tim Neutkens
2b7f50ff55
Turbopack issue report tests (#61845)
## What?

Currently going through all issues on the Turbo repository to check if
they've been fixed already, this PR adds tests for the reports.

- [x] https://github.com/vercel/turbo/issues/5913

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2413
2024-02-10 12:59:31 +01:00
Jon Meyers
1da90c2756
Clean up with-supabase example (#61799)
### What?

[1] Clean up `with-supabase` example following patterns from @leerob's
recent video on authentication
[2] Add images to matcher to reduce number of times a session is
refreshed
[3] Move instantiation of `cookieStore` into Supabase server helper

### Why?

[1] Make template easier to understand and use
[2] Reduce likelihood users will receive Auth Rate Limit Exceeded error
[3] Makes creating a Supabase client much simpler in Server Components,
Route Handlers and Server Actions

### How?

[1] Refactor middleware and its helper function
[2] Add image extensions to middleware matcher
[3] Call `cookies()` function from `createClient` helper - this should
still be in the [same execution
context](https://nextjs.org/docs/messages/dynamic-server-error) and
appears to work from my testing, but would be good to get the 👍 from
someone at Vercel
2024-02-08 19:07:57 +00:00
Anders D. Johnson
1f0f5d51ed
chore(examples): deduplicate react-dom imports in add-form.tsx (#61751)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Simple cleanup of duplicative import of `react-dom` in add form example.
Some editors, linters, or bundlers take issue with this.
2024-02-07 03:30:38 +00:00
theItalianDev
29e7227362
enhancement(with-supabase): replace getSession() with getUser() (#61564)
### What?
Enhancement of _with-supabase example_. Replacing in **middelware.ts**,
**supabase.auth.getSession()** with **supabase.auth.getUser()**

### Why?
**Never trust supabase.auth.getSession() inside server code such as
middleware**. It isn't guaranteed to revalidate the Auth token.
**It's safe to trust getUser()** because it sends a request to the
Supabase Auth server every time to revalidate the Auth token.

[Setting up Server-Side Auth for
Next.js](https://supabase.com/docs/guides/auth/server-side/nextjs)
2024-02-05 00:24:39 +00:00
Abdul Haseeb
f59540fedc
Fixing a case sensitivity error (#61563)
Fixing a simple case sensitivity error in the import statement,
"storeProvider" should be "StoreProvider".

Co-authored-by: Steven <steven@ceriously.com>
2024-02-02 09:33:32 -05:00
JA
b654effd53
fix(with-docker): resolve build with pnpm (#61529)
### Adding or Updating Examples

- Example:
[with-docker](https://github.com/vercel/next.js/tree/canary/examples/with-docker)
- Update: The latest change introduced in #61466 on the building process
of NextJS when the package manager is PNPM is currently throwing an
error (it works for npm though).

**To replicate the error:**

1. Checkout on the **with-docker** example
2. Install with PNPM so that it generates the pnpm-lock.yaml
3. Build the Docker image -> This will fail on the _builder stage_ step
that runs `pnpm run build`.

**Possible Solution:**
- Run `corepack enable pnpm` before building with pnpm
2024-02-01 19:32:57 +00:00
Stefan Generalao
e0c63aca99
fix: dockerfile npm run build (#61466) 2024-01-31 18:46:33 +00:00
Shane
9c35f21f38
Update blog-starter to App Router (#61170)
### What?

This updates the `blog-starter` example to Next 14.1 App Router.

### Why?

I checked out a new `blog-starter` project on Vercel and was surprised
it was using the Pages Router. I believe the App Router is a better
choice.

### How?

I tried to keep the implementation logic as close to the original Pages
`blog-starter`.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-01-30 17:16:55 +00:00
Sam Ko
8d13ab925e
chore(examples): switch default from yarn to npm in Dockerfiles (#61348)
## Changes

- Switch default package manager to npm
- Fixes https://github.com/vercel/next.js/issues/61293

Closes NEXT-2291
2024-01-29 14:38:31 -08:00
Jonathan Steele
b5750cfc80
fix(with-stripe-typescript): Bump apiVersion when initialising Stripe client (#61217)
### What?

* fix(with-stripe-typescript): Bump `apiVersion` when initialising
Stripe client
2024-01-26 22:23:37 +00:00
Jonathan Steele
ec9ab1b5d5
example(with-stripe-typescript): use client required for error components (#61214) 2024-01-26 15:49:03 +00:00
Jonathan Steele
f82445b01c
example: Add Stripe embedded Checkout example (#60378) 2024-01-23 16:09:04 +00:00
Yuto Yoshino
04860649da
examples: Change "pages" to "apps" in the Image Component Example description. (#60929) 2024-01-21 09:52:10 -06:00
Arseny
3b46f22bb1
Update Redis Cache example with stabilized API (#60800)
This pull request updates the `cache-handler-redis` example with a
stabilized API. The updated `next.config.js` now uses the stable
`cacheHandler` option instead of the
`experimental.incrementalCacheHandlerPath`.
2024-01-21 02:40:54 +00:00
Sam Ko
43227c0dd5
chore: remove lock from with-algolia-react-instantsearch example (#60910)
## Changes

- Remove `pnpm-lock.yaml` from with-algolia-react-instantsearch example

Closes NEXT-2174
2024-01-20 20:34:37 -06:00
Rishabh Poddar
7d4888d961
Updates with-supertokens example app (#60901)
Refactors with-supertokens example app to move some of the helper
functions into the SDK.
2024-01-20 00:35:28 +00:00
Taishi
f000352723
upgrade @types/react-dom to v18.2.18 to import useFormState for server actions in with-supabase example (#60822)
### Adding or Updating Examples

I can't import `useFormState` from `react-dom` with
`@types/react-dom@18.2.5`, so I upgrade it to the latest version of it.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-01-19 04:19:11 +00:00
Augustin Mauroy
c0282712ae
chore(example): update storybook (#60737)
### What?

- update storybook version
- use `SWC` for perf
- pinging dep for security of the example
- update readme to have correct link

Co-authored-by: Sam Ko <sam@vercel.com>
2024-01-16 18:02:13 -08:00
Elyees T
5e29dfc881
Update README.md (#60595)
### Improving Documentation

necessary update for agilitycms readme file to enhance clarity

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-01-17 00:23:05 +00:00
Lee Robinson
b177ff6488
examples: Update redis example with useOptimistic (#60596) 2024-01-15 21:19:59 -06:00
Steven
4466ba436b
chore(examples): use default prettier for examples/templates (#60530)
## Description
This PR ensures that the default prettier config is used for examples
and templates.

This config is compatible with `prettier@3` as well (upgrading prettier
is bigger change that can be a future PR).

## Changes
- Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will
be needed upgrading to prettier@3)
- Added `examples/.prettierrc.json` with default config (this will
change every example)
- Added `packages/create-next-app/templates/.prettierrc.json` with
default config (this will change every template)

## Related

- Fixes #54402
- Closes #54409
2024-01-11 16:01:44 -07:00
hugo-syn
601eaf0e87
chore: Fix multiple typos (#60531)
## For Contributors

Fix multiple typos
2024-01-11 10:44:55 -08:00
hugo-syn
b21a2b9445
chore: Fix typo s/desireable/desirable/ (#60518)
Fix typo s/desireable/desirable/ in 2 README.md files

Co-authored-by: Steven <steven@ceriously.com>
2024-01-11 14:43:13 +00:00
Lee Robinson
bf63ddb4d9
examples: Update hello world (#60502) 2024-01-10 22:15:21 -06:00
Arseny
8694ed6a40
Update cache-handler-redis example dependencies (#59458)
This pull request updates the dependencies in the cache-handler-redis
example. It updates the versions of the `@neshca/cache-handler`, which
introduces new features.

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2024-01-10 18:43:03 +00:00
oxxd
6740f2f891
chore(examples): fix image-component example viewsource paths, shimmer page filename (#60451)
This PR fix `image-component` example viewsource paths and shimmer page
filename. Which would result a Github 404 page in the current live
example.

A flow up fix on this PR #60289
2024-01-10 10:13:42 -05:00
rmathew8-gh
af24c45398
fixed import path in with-jest template. (#60332)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Co-authored-by: Roy Mathew <rmathew8@gmail.com>
Co-authored-by: Sam Ko <sam@vercel.com>
2024-01-06 23:26:59 +00:00
Luke Schlangen
0ea127c642
examples: add allow-unauthenticated option to cloud run deploy (#58792)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-01-06 11:08:27 -06:00
Niklas Ziermann
781fa7745d
examples: improve zustand example (#58696)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-01-06 11:07:54 -06:00
Steven
bb7af2a0d4
chore(examples): migrate image-component example to App Router (#60289)
This PR migrates the `image-component` example from Pages Router to App
Router.

It also upgrades a couple dependencies and regenerates tsconfig.json
2024-01-06 11:03:01 -06:00
Nicolas Froidure
2d52962dfd
examples: improve typings for i18n app dir (#60160) 2024-01-03 08:42:12 -06:00
Tibor Szász
2eda0140e3
examples: fix contentful install instructions (#60050) 2023-12-31 17:22:46 -06:00
Lee Robinson
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
Ian Macartney
7343af9deb
examples: Update Convex Example (#59789)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-12-28 00:25:14 -06:00
Ankit Kashyap
4b68d55b39
examples: Supabase rename .env.local.example to .env.example (#59984) 2023-12-27 22:47:45 -06:00
Dhaya
2c811af22e
examples: Upgrade with-algolia-react-instantsearch example to latest major version and use app router (#59961)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-12-27 10:44:32 -06:00
Mohammed Gadi
bc41a7f829
examples: Update .env.local.example of with-firebase (#59954) 2023-12-27 10:43:52 -06:00
Lee Robinson
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
Luke Schlangen
a0b661de8d
examples: remove broken deploy button (#58794) 2023-12-25 09:03:27 -06:00
Lee Robinson
0fc1d9e982
examples: update Redis to App Router (#59311) 2023-12-24 10:09:23 -06:00
Lee Robinson
3d9a1b481e
examples: add required env vars to auth example. (#59901) 2023-12-23 10:27:33 -06:00
Lee Robinson
4225da8cba
examples: Add new NextAuth.js example (#56914) 2023-12-23 10:21:26 -06:00
Jon Meyers
4462354da1
Fix: Add matcher for middleware (#59651)
### What?
- exclude assets from middleware

### Why?
- avoid refreshing session logic running unnecessarily

### How?
- export matcher config from middleware

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-12-18 09:40:44 -08:00
Joseph
7eac1c8ee9
fix: Invalid next version tag name in with-cypress example (#59647)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Hi,

Fix for the accidental change, introduced in this PR
https://github.com/vercel/next.js/pull/59572, which set the `next`
version tag for the with-cypress example, to `^latest`, which causes the
`create-next-app` step to fail:

```shell
npx create-next-app --example with-cypress with-cypress-app
Creating a new Next.js app in /Users/<user>/<Project-Path>/with-cypress-app.

Downloading files for example with-cypress. This might take a moment.

Installing packages. This might take a couple of minutes.

npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "^latest" of package "next@^latest": Tags may not have any characters that encodeURIComponent encodes.
```

Yarn instead, shows a list of next.js packages to select from instead.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-12-18 09:37:33 -08:00
Delba de Oliveira
f518fd81b3
Docs: Fix formatting in testing docs and update examples dependencies (#59572)
Follow-up from: https://github.com/vercel/next.js/pull/59268
2023-12-13 07:02:53 -08:00
Delba de Oliveira
0ddc7e8fad
Docs: Add App Router Testing Guides and update /examples (#59268)
This PR updates the testing guides to use App Router and TypeScript,
also updates `/examples` to show `app` and `pages` examples.

## Overview

- [x] Create a new "Testing" section that is shared between `app` and
`pages`.
- [x] Explain the differences between E2E, unit testing, component
testing, etc.
- [x] Recommend E2E for `async` components as currently none of the
tools support it.
- [x] Update setup guides for **Cypress**, **Playwright**, and **Jest**
with latest config options, and examples for `app` and `pages`.
- [x] Add new guide for **Vitest**
- [x] Clean up `/examples`: use TS, show `app` and `pages` examples,
match docs config

## Cypress

- [x] E2E Tests
- [x] Component Testing
  - [x] Client Components
  - [x] Server Components
  - [ ] `async` components

**Blockers:** 
- TS: `Option 'bundler' can only be used when 'module' is set to
'es2015' or later`. In **tsconfig.json** compilerOptions, Next.js uses
"moduleResolution": "bundler", changing it to "node" fixes the issue but
it can have repercussions.
  - https://github.com/cypress-io/cypress/issues/27731 
- Version 14 is currently not supported for component testing
  - https://github.com/cypress-io/cypress/issues/28185

## Playwright

- [x] E2E Tests

## Jest

- [x] Unit Testing
   - [x] Client Components
   - [x] Server Components
- [ ] `async` components:
https://github.com/testing-library/react-testing-library/issues/1209
   - [x]  'server-only': https://github.com/vercel/next.js/pull/54891
- [x] Snapshot Testing

**Blockers:**
- TS: https://github.com/testing-library/jest-dom/issues/546
- None of the solutions in the issue work with Next.js v14.0.4 and TS v5

## Vitest 

- [x] Unit Testing
  - [x] Client Components
  - [x] Server Components
  - [ ] `async` components
  - [x] 'server-only'
 - [x] Update vitest example
- [x] Handles CSS, and CSS modules imports
- [x] Handles next/image

## Other

- https://github.com/vercel/next.js/issues/47448
- https://github.com/vercel/next.js/issues/47299
2023-12-12 22:30:23 -06:00
John Pham
d96a7e56a6
Add text-wrap: balance to CNA template for card descriptions (#59384)
### What?
This prevents the descriptions from having orphans at different viewport
widths.

### Why?

| Default | Pretty | Balance |
|--------|-------| --- |
|
![image](https://github.com/vercel/next.js/assets/16027268/66c8eac4-b995-4c30-9bdc-fd44a4a7fdda)
|
![image](https://github.com/vercel/next.js/assets/16027268/07a2e45a-728b-438f-a4e5-98f7c1c5c33a)
|
![image](https://github.com/vercel/next.js/assets/16027268/153fe94a-2b10-4e39-bb19-b1ca702bcea8)
|
2023-12-11 17:41:01 -08:00
Sebastian Silbermann
79a8d01ae6
Use new JSX transform (#56294)
Co-authored-by: Jimmy Lai <laijimmy0@gmail.com>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-12-09 00:17:50 +01:00
Oleh Dutchenko
f7b9843b92
examples: Updates the with-vitest example for server-only usage (#58902) 2023-12-08 00:18:29 -06:00
Rishabh Poddar
484efaec85
examples: Updates with-supertokens example app (#58525)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-12-04 16:17:46 -06:00
Karl Horky
b02a10e331
Enable typechecking on config (#57892)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-12-01 09:57:57 +01:00
Dylan700
d509c2d528
examples: Update Electron Typescript Example with Best Practices (#58947)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-11-29 20:37:03 -06:00
Luke Schlangen
92f7d0c5e9
examples: add direct link to Dockerfile (#58793) 2023-11-29 18:54:44 -06:00