Commit graph

3114 commits

Author SHA1 Message Date
xiaolou86
b95474a9d2
fix typos (#56870) 2023-10-18 00:46:47 +00:00
Steven
3a459ca986
chore(next/image)!: mark onLoadingComplete as deprecated in favor of onLoad (#56944)
## History

We used to pass `onLoad` through directly to the underlying img so `onLoadingComplete` was introduced in order to handle the case when `placeholder="blur"` was used and `onLoad` would trigger before the placeholder was removed.

We have since changed the behavior of `onLoad` so that it acts the same as `onLoadingComplete` and therefore `onLoadingComplete` is no longer needed.

## What is this PR doing?

This PR marks `onLoadingComplete` as deprecated in favor of `onLoad`. In the future, we may remove `onLoadingComplete`.
2023-10-17 21:12:22 +00:00
Mateusz Burzyński
db214214d6
Update Babel dependencies (#51962)
### What?

Update Babel packages across the board

### Why?

Since you ship vendored presets and plugins it's impossible for people to update this stuff at their own pace - independently from Next. So users of `next/babel` are currently stuck with old versions and, for example, they might not be able to use the TS `satisfies` operator.

### How?

I just updated ranges (to pinned ones) where I could find them, run `corepack pnpm i` and re-run build scripts in the `packages/next`.

Fixes #43799
2023-10-17 02:25:57 +00:00
Josh Story
0a80017d03
Update React from d900fadbf to 09fbee89d. Removes server context and experimental prefix for server action APIs (#56809)
The latest React canary builds have a few changes that need to be
adopted for compatability.

1. the `useFormState` and `useFormStatus` hooks in `react-dom` and the
`formData` opiont in `react-dom/server` are no longer prefixed with
`experimental_`
2. server content (an undocumented React feature) has been removed. Next
only had trivial intenral use of this API and did not expose a coherent
feature to Next users (no ability to seed context on refetches). It is
still possible that some users used the React server context APIs which
is why this should go into Next 14.

### React upstream changes

- https://github.com/facebook/react/pull/27513
- https://github.com/facebook/react/pull/27514
- https://github.com/facebook/react/pull/27511
- https://github.com/facebook/react/pull/27508
- https://github.com/facebook/react/pull/27502
- https://github.com/facebook/react/pull/27474
- https://github.com/facebook/react/pull/26789
- https://github.com/facebook/react/pull/27500
- https://github.com/facebook/react/pull/27488
- https://github.com/facebook/react/pull/27458
- https://github.com/facebook/react/pull/27471
- https://github.com/facebook/react/pull/27470
- https://github.com/facebook/react/pull/27464
- https://github.com/facebook/react/pull/27456
- https://github.com/facebook/react/pull/27462
- https://github.com/facebook/react/pull/27461
- https://github.com/facebook/react/pull/27460
- https://github.com/facebook/react/pull/27459
- https://github.com/facebook/react/pull/27454
- https://github.com/facebook/react/pull/27457
- https://github.com/facebook/react/pull/27453
- https://github.com/facebook/react/pull/27401
- https://github.com/facebook/react/pull/27443
- https://github.com/facebook/react/pull/27445
- https://github.com/facebook/react/pull/27364
- https://github.com/facebook/react/pull/27440
- https://github.com/facebook/react/pull/27436

---------

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-10-16 15:46:10 -07:00
Surav Shrestha
869d93c777
docs: fix several typos (#56788)
`Enviroment -> Environment`

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-10-13 15:40:14 -04:00
Alex Yang
ac8a6035df
fix: http2 example issue (#56768)
### What?

If the custom server uses `app.render(xxx)` will render the normal js files as server components in dev mode and cause 404 error when loading every non-HTML file.

### How?

Fixes https://github.com/nodejs/help/issues/4253, fixes https://github.com/vercel/next.js/issues/50270
2023-10-13 16:55:48 +00:00
Mayank
0b5251c2f0
chore(example): bump @radix-ui/react-icons (#56452)
Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-10-12 20:38:09 +00:00
Zack Tanner
daa865fff6
fix lint error from fauna example (#56719)
https://github.com/vercel/next.js/pull/56185 wasn't passing lint checks

[x-ref](https://github.com/vercel/next.js/actions/runs/6487087673/job/17616654281?pr=56718#step:28:196)
2023-10-11 19:45:22 +00:00
Shadid12
216d968c9f
examples: Update Fauna example (#56185) 2023-10-11 12:39:25 -05:00
Mustafa Dağkıranlar
9b2f29ebaf
Update actions.ts (#56579)
fixed depricated nonempty()
2023-10-09 02:32:42 +00:00
Ryan LaBarre
b436589ff8
Maintenance: minor example dep bumps to fix moderate vulns (#56375)
### What?
Merged a bunch of dependabot alerts in my own canary branch, mainly
postcss patch updates, and one graphql minor update, to fix moderate
security vulnerabilities in examples. Spot checked most and look good
still. EDIT: also one in scripts/send-trace-to-jaeger

### Why?
Because safety

### How?
Dependabot

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Steven <steven@ceriously.com>
2023-10-04 11:18:54 -04:00
Hamir Mahal
be952fbb31
fix: typo in with-stripe-typescript example (#56274)
fixes #56273.
2023-10-02 16:47:23 +00:00
vinay
638cc931be
(Examples) update Grafbase example (#54705)
Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-09-30 15:08:26 +00:00
Balázs Orbán
55a638ba42
chore(examples): fix with-jest types (#56193)
### What?

Closes https://github.com/vercel/next.js/issues/55167
Also does the same as #56151 for `with-jest-babel`

Fixes https://github.com/vercel/next.js/issues/55167
2023-09-29 13:53:20 +00:00
Lokesh Singh
a623685f44
chore(examples): remove deprecated dependency from with-jest (#56152)
Fixes #56151
Tests added: none
Errors: https://ibb.co/MnTDChy

@testing-library/jest-dom provides its own type definitions

@types/testing-library__jest-dom has been deprecated 
ref: https://www.npmjs.com/package/@types/testing-library__jest-dom
2023-09-29 01:56:09 +00:00
Jonathan Summers-Muir
06705a4815
Chore/update with supabase demo deploy button (#52483)
### What?

- added correct deploy button urls
  - uses new supabase integration
- updated readme for local development, more clearer instructions
- added opengraph image

### Why?

- old supabase integration is buggy
- readme is more clear for local development

---------

Co-authored-by: Steven Tey <stevensteel97@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-09-27 17:36:17 -07:00
Mayank
764f6c8ec7
Update dependencies in examples (#55993)
Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-26 22:34:44 +00:00
Ahmed Abdelbaset
379f2d82c2
chore: Remove 'beta.' Subdomain from beta.nextjs.org Links (#55924)
**low-priority chore change**

## What?
This PR removes the 'beta.' prefix from links beginning with it. These links are no longer in beta and are now automatically redirected to their non-beta versions. The change serves as a minor enhancement.
2023-09-26 20:09:21 +00:00
Rishabh Poddar
5cd8e87812
Update to with-supertokens example app (#56035)
Adds cache control headers in the auth middleware to prevent issues with cached tokens being passed in GET API requests.

Co-authored-by: Mihály Lengyel <1129990+porcellus@users.noreply.github.com>
Co-authored-by: Nemi Shah <18233774+nkshah2@users.noreply.github.com>
Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-09-26 19:24:27 +00:00
Frederik von Sperling
7102e297d1
example: panda css (#55004)
# Panda CSS example
This example contains a simple implementation of [Panda CSS](https://panda-css.com/). It contains styling for a link made in four different approaches supported by Panda CSS. Refer to the [documentation](https://panda-css.com/docs) for when to use - and how to combine - the different approaches to suit your needs.

## Link examples
-  [Atomic Recipe (CVA)](https://panda-css.com/docs/concepts/recipes#atomic-recipe-or-cva) Create multi-variant atomic styles with a type-safe runtime API.
- [Atomic Style](https://panda-css.com/docs/concepts/writing-styles#atomic-styles) Type-safe reusable atoms with small CSS footprint.
- [Config Recipe](https://panda-css.com/docs/concepts/recipes#config-recipe) Resuable recipes extracted and generated just-in-time.
- [Text Styles](https://panda-css.com/docs/theming/text-styles#defining-text-styles) Global text styles for consistent and legible typography.

## Preview
Preview the example live on [https://example-panda-css.vercel.app/](https://example-panda-css.vercel.app/)

## Motivation
Panda CSS is a CSS-in-JS framework, that support the new era of server components and the rise of the app-directory in Next.js. It is a performant, type-safe, developer friendly framework, which uses modern CSS features. It is heavily inspired by existing frameworks, such as Chakra UI, Vanilla Extract, Stitches and Tailwind.

More on [why you should choose Panda CSS](https://panda-css.com/docs/overview/why-panda)
2023-09-26 17:17:49 +00:00
Martyanov Andrey
9e9e366865
docs: pass base headers while setting nonce (#55708)
Example for setting "nonce", when created, clears the passed headers
2023-09-26 15:12:13 +00:00
vinay
c56f9f4ff9
(Example) Update with-opentelemetry example. (#54775)
Updated with new `Metadata` API.


Here in this example there is `legacy.tsx` in `/pages`  folder should i remove it or retain it??
Also in `/pages/legacy.tsx` we have defined `/preact-stars` route but we don't have the corresponding file. 
I have remove `/preact-stars` from `/app/page.tsx` as there is no `/app/preact-stars/page.tsx` in this example.
And `/shared/fetch-github-stars.ts` is fetching only `next.js` stars.

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-09-26 02:56:23 +00:00
Yahya Muhammad
e94868215d
Fix metadata typo in examples/with-jest page (#55994)
Fix typo in `app/rsc/page.tsx`: `const metdata` should be `const metadata`
2023-09-26 02:46:20 +00:00
Lee Robinson
c7ff12b753
docs: update next-forms example (#55927)
A few bits of follow up from my previous PR updating the forms example.
2023-09-25 21:41:14 -05:00
Mayank
82eb6e6f49
chore(examples): bump dependency versions (#55899)
Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-09-25 16:31:49 +00:00
Balázs Orbán
37b5cea794
chore: NextJS -> Next.js (#55961) 2023-09-25 14:53:11 +00:00
Lee Robinson
5f4238d9fa
docs: useFormState (#55564)
This PR shows how to use a new React hook `useFormState` in the context
of the [Forms and
Mutations](https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations)
docs. It also updates the forms example (`next-forms`) to show the
recommended patterns for loading / error states.

Related: https://github.com/vercel/next.js/pull/55399
---
Co-authored-by: John Pham <johnphammail@gmail.com>
2023-09-22 16:10:25 -05:00
Mayank
a17c235dc9
Fix/upgrade examples data fetch (#55695)
Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-21 16:15:41 +00:00
Mayank
563019f79c
Fix/upgrade examples with clerk (#55676)
Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-20 20:28:35 +00:00
Mayank
5591abe7ad
chore(examples): upgrade next-translate dependencies (#55637)
Snyk has created this PR to upgrade next from 13.4.7 to 13.4.19.

See this package in npm:
https://www.npmjs.com/package/next

See this project in Snyk:

https://app.snyk.io/org/mayank1513/project/e72076fc-8d2c-4d92-ac05-133865d727f0?utm_source=github&utm_medium=referral&page=upgrade-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 #

-->

---------

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-09-20 10:22:40 +02:00
Mayank
1afc38933f
fix: examples/with-grafbase/package.json to reduce vulnerabilities (#55593)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-GRAPHQL-5905181


Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-19 14:46:12 -04:00
Mayank
2815c6fc2b
fix: examples/with-fauna/package.json to reduce vulnerabilities (#55594)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-GRAPHQL-5905181




Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-19 18:32:46 +00:00
Matt Hooper
b5beb3a968
Correct spelling in playwright docs (#55557) 2023-09-18 22:59:01 +00:00
Alejandro Roigé
4c6d4b35b4
Type Error on Event Type payment_intent webhook (#55493)
changed` failed `for `payment_failed` on line 45

### What?
Error in line 45 on type of payment_intent

### Why?
Example provided does not work 

### How?
Added 'payment_'
2023-09-18 20:15:42 +00:00
Kevin
d420233ec2
Hotfix for missing application/json header in Prepr example (#55517)
I added the application/json header to the API lib of the Prepr example.
Because without it when statically generating an error is produced by
GraphQL.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-18 09:33:26 -04:00
Mayank
9adddc27aa
fix: examples/cms-keystonejs-embedded/package.json to reduce vulnerabilities (#55354)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-PROMPTS-1729737
- https://snyk.io/vuln/SNYK-JS-SHELLQUOTE-1766506
- https://snyk.io/vuln/SNYK-JS-TAR-1579152
- https://snyk.io/vuln/SNYK-JS-TAR-1579155




Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-14 19:31:03 +00:00
lijianan
cb5e75d97b
example: fix example error (#54599)
example: fix example error
2023-09-14 15:09:05 -04:00
Mayank
84b1e7e6b4
fix: upgrade @emotion/css from 11.10.0 to 11.11.2 (#55352)
upgrade @emotion/css from 11.10.0 to 11.11.2.



Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-14 13:34:47 +00:00
Will Binns-Smith
17ba84b7a7
WEB-1135: Update examples and schema for Turbopack loaders config change (#54584)
This addresses inconsistencies with existing examples and config schema
from changes in #49535.


Closes WEB-1451
2023-09-14 14:50:02 +02:00
Michael Novotny
fe797c1074
Updates Mozilla links to not include language preference (#55326)
Internal suggestion to remove `en-US` from Mozilla urls since MDN is
available in multiple languages nowadays it will automatically redirect
to the viewer’s language preference.

Closes
[DX-2076](https://linear.app/vercel/issue/DX-2076/make-external-mozilla-links-language-agnostic-in-nextjs-docs)
2023-09-13 11:06:29 -05:00
Mayank
546bd28c00
fix: upgrade react-native-web from 0.11.7 to 0.19.7 (#55221)
upgrade react-native-web from 0.11.7 to 0.19.7.




Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-12 19:36:33 +00:00
Mayank
9f852403f0
fix: upgrade sharp from 0.29.3 to 0.32.5 (#55254)
upgrade sharp from 0.29.3 to 0.32.5.

Fix Remote Code Execution (RCE)
[SNYK-JS-SHARP-2848109](https://snyk.io/vuln/SNYK-JS-SHARP-2848109)




Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-12 15:38:10 +00:00
Mayank
c91e6609bf
fix: upgrade date-fns from 2.28.0 to 2.30.0 (#55274)
to upgrade date-fns from 2.28.0 to 2.30.0.



Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-12 15:26:49 +00:00
Mayank
80654c1e30
chore(examples): upgrade @keystone-next/keystone (#55210)
…ilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-PROMPTS-1729737
- https://snyk.io/vuln/SNYK-JS-SHELLQUOTE-1766506
- https://snyk.io/vuln/SNYK-JS-TAR-1579147
- https://snyk.io/vuln/SNYK-JS-TAR-1579152
- https://snyk.io/vuln/SNYK-JS-TAR-1579155




Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-11 14:02:20 +00:00
Mayank
31f28287bf
fix: upgrade recoil from 0.7.6 to 0.7.7 (#55222)
upgrade recoil from 0.7.6 to 0.7.7

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Steven <steven@ceriously.com>
2023-09-11 09:56:43 -04:00
Mayank
1097ab279a
examples: update KeystoneJS version (#55201)
…ilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-APOLLOSERVERCORE-2928764
- https://snyk.io/vuln/SNYK-JS-LOADERUTILS-3042992
- https://snyk.io/vuln/SNYK-JS-LOADERUTILS-3043105
- https://snyk.io/vuln/SNYK-JS-LOADERUTILS-3105943
- https://snyk.io/vuln/SNYK-JS-NEXT-1540422
- https://snyk.io/vuln/SNYK-JS-NEXT-1577139
- https://snyk.io/vuln/SNYK-JS-NEXT-2405694
- https://snyk.io/vuln/SNYK-JS-NODEFETCH-2342118
- https://snyk.io/vuln/SNYK-JS-SHELLQUOTE-1766506




Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-10 19:41:51 +00:00
Mayank
606c73a548
examples: upgrade @makeswift/runtime from 0.2.2 to 0.10.13 (#55203)
Snyk has created this PR to upgrade @makeswift/runtime from 0.2.2 to 0.10.13.




Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-10 19:39:18 +00:00
Mayank
0f212096f6
Fix/security (#55189)
Update to fix vulnerability in @builder.io/react@1.1.52 

Co-authored-by: Snyk bot <19733683+snyk-bot@users.noreply.github.com>
2023-09-10 13:01:27 +00:00
Lee Robinson
12252c2711
examples: Update strict-csp example with better nonce (#55131)
Follow up to https://github.com/vercel/next.js/pull/55039.
2023-09-08 05:12:22 +00:00
Lee Robinson
7a256e657b
Update Jest and Vitest example for App Router. (#54989)
Building off https://github.com/vercel/next.js/pull/54891, updates the `with-jest` and `with-vitest` examples with updated packages and App Router tests.
2023-09-05 13:31:47 +00:00
Sander
be3a7e471b
chore: upgrade playwright example (#53584)
Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-09-04 00:26:08 +00:00
Tito
95e33c4dd2
Fix: slug type issue (#54616)
Failure at build time because - Type error: Argument of type 'string | null' is not assignable to parameter of type 'string'.
2023-09-04 00:23:38 +00:00
Okoye Charles
53d6da6cc6
fix: Fix grammar issues on README.md (#54921)
In this PR resolved the grammatical error on the [README.md](https://github.com/vercel/next.js/blob/canary/examples/with-passport-and-next-connect/README.md)

Fixes #54919
2023-09-02 15:10:37 +00:00
Lee Robinson
5eea161d8b
docs: Add docs on CSP and nonce generation (#54601)
There's been some confusion on the correct way to add a `nonce`, so took the opportunity here to:

- Add a new docs page for Content Security Policy
- Explained how to generate a `nonce` with Middleware
- Showed how to consume the `nonce` in a route with `headers`
- Updated the `with-strict-csp` example
- Update the `nonce` error message page
- Backlinked to the new page in a few places in the docs
2023-09-01 22:13:49 +00:00
Mert Can Altın
469c799c00
fix: fixed grammar error in the code comment (#54902)
hello I tried to solve issue #54857
2023-09-01 19:42:54 +00:00
Rui Ying
49a891deb5
Fix the prerender cache update error with the example Dockerfile (#54870)
It seems the app router attempts to write its cache to both `.next/cache` and `.next/server` in docker.

This fix should fix standalone output server's error `Failed to update prerender cache... [Error: EACCES: permission denied...` when deployed in a docker container with the example Dockerfile.

Related discussion: https://github.com/vercel/next.js/discussions/51164
2023-09-01 17:19:13 +00:00
Elijah Ohiwerei
7e76c353b3
feat(examples): Migrate 'with-mongoose' example to TypeScript with total type safety (#53603)
### What?
I kindly request the maintainers to review this Pull Request, which aims to migrate the `with-mongoose` example to TypeScript with total type safety.

### Why?
By doing so, we enhance the overall quality and maintainability of the example, aligning it with modern best practices for type-safe codebases.

### How?
I have thoroughly tested the changes to ensure they do not introduce regressions and maintain compatibility with the existing codebase.



Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-09-01 14:34:13 +00:00
Jonathan Steele
acbbf14a49
example: Add elements.update() to ensure latest payment amount is reflected (#54848)
### What?
In the Payment Element demo, call
[`elements.update()`](https://stripe.com/docs/js/elements_object/update)
when the payment amount value is updated via slider. This ensures
wallets (Apple Pay, Google Pay) display the correct payment amount.

---------

Co-authored-by: Michael Novotny <manovotny@gmail.com>
2023-08-31 15:53:41 -05:00
Mayank
7b54e954c2
update dependencies (#53334)
### 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

### What?
Updated dependencies to latest for Sentry example.

### Why?
Remove tech debt
2023-08-31 15:47:14 +00:00
Luke Bussey
1aab5ee915
(Example) Update with-segment-analytics to use segmentio/analytics-next and app layout (#52327)
The
[with-segment-analytics](https://github.com/vercel/next.js/blob/canary/examples/with-segment-analytics)
example is out of date so this PR updates it to use
[segmentio/analytics-next](https://github.com/segmentio/analytics-next)
with TypeScript and the app layout.

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2023-08-30 13:04:38 -05:00
Steven Tey
989233eba3
updated sitecore deploy button (#54678) 2023-08-28 17:59:53 +00:00
Alex Hawley
c1b753c795
(Example) Add CMS Sitecore XM Cloud Example (#54535)
### What?

This PR adds the `cms-sitecore-xmcloud` example.

Sitecore XM Cloud is a headless CMS platform that empowers content editors to manage content, layout, and structural aspects of web pages. The Sitecore JSS framework connects frontend JavaScript applications to the XM Cloud API, allowing retrieval of content and presentation layout information.

Sitecore JSS for Next.js integrates Next.js with Sitecore JSS, offering a structured approach to connect a Next.js application to XM Cloud. The `cms-sitecore-xmcloud` example, derived from the Sitecore JSS initializer, showcases the frontend application exclusively, omitting backend implementation details.

### Why?

While Sitecore offers detailed documentation for creating XM Cloud projects and JSS applications, existing starter templates often combine frontend and backend configurations. The `cms-sitecore-xmcloud` example focuses solely on the frontend application and includes environment variable examples to establish a connection with XM Cloud, eliminating the need for a .NET-compatible machine.

### How?

For comprehensive guidance on setting up an XM Cloud site and JSS application, refer to Sitecore and Vercel documentation. The `cms-sitecore-xmcloud` example is created using the Sitecore JSS initializer, integrating Next.js and SXA (Sitecore Experience Accelerator) add-ons. Further documentation can be found at:

- [Deploying to Vercel](https://doc.sitecore.com/xmc/en/developers/xm-cloud/walkthrough--deploying-your-front-end-application-to-vercel.html)
- [Documentation (Experience Platform)](https://doc.sitecore.com/xp/en/developers/hd/210/sitecore-headless-development/sitecore-javascript-rendering-sdk--jss--for-next-js.html)
- [Documentation (XM Cloud)](https://doc.sitecore.com/xmc/en/developers/xm-cloud/sitecore-javascript-rendering-sdk--jss--for-next-js.html)
- [Documentation (Create an XM Cloud project from a starter template)](https://doc.sitecore.com/xmc/en/developers/xm-cloud/create-an-xm-cloud-project-from-a-starter-template-in-the-xm-cloud-deploy-app.html)


Co-authored-by: Steven Tey <28986134+steven-tey@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-08-27 01:27:38 +00:00
Lee Robinson
b048d7eee2
docs: Forms and mutations (#54314)
This PR is a larger change to documentation to make the following
updates:

- Deconstructs [Server
Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions)
into "Forms and Mutations" and an API reference
- Removes content in place of future React API documentation pages
- Removes outdated [Building
Forms](https://nextjs.org/docs/pages/building-your-application/data-fetching/building-forms)
docs from the Pages Router and adds conditional content for both routes
in "Forms and Mutations"
- Adds TypeScript code blocks to API Routes page, recommends Route
Handlers for isomorphic signatures.
- Updates `revalidatePath` and `revalidateTag` docs to have a Server
Actions example.

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-08-25 14:31:11 -05:00
Mohamed A. Salah
b7eb6d43b9
set hostname to 0.0.0.0 (#54342)
When I try to deploy to Google Cloud Run it fails after some
investigation I saw this line in

.next/standalone/server.js
```javascript
const hostname = process.env.HOSTNAME || 'localhost'
``` 
This some how make this log when i run docker 
```shell
- ready started server on 172.17.0.2:3000, url: http://172.17.0.2:3000
``` 
I don't know why it's logging this address even if the server running on
localhost.

So this my fix
Set hostname to 0.0.0.0 to avoid deployment failing on Google cloud run.
2023-08-21 19:05:57 +02:00
Lee Robinson
0718aec93b
Update Contentful example for App Router. (#54205)
This PR updates the `cms-contentful` example to use:

- App Router
- TypeScript
- Draft Mode (previously Preview Mode)
- ISR / Data Cache (revalidations through `revalidateTag`)

Further, it combines many separate files into more manageable single files, and tries to better bucket provider-specific logic into the `lib/` folder. I'm hoping this can be the foundation for re-writing the rest of the `cms-*` examples to use App Router.

Overall, the code is much easier to reason about IMO. Pretty happy with the change. I sprinkled some `any`'s throughout here, but if someone wants to make it better, go for it! 

https://app-router-contentful.vercel.app/
2023-08-21 13:21:37 +00:00
Tim Neutkens
d60690e2bd
Update Docker example to remove HOSTNAME (#54102)
With the latest changes in stable Next.js setting HOSTNAME is not longer required for the image to function correctly 👍 

Fixes #54093
2023-08-16 10:08:38 +00:00
Tim Neutkens
c9fef184fd
Revert "Move USER and remove redundant --chown from Dockerfile (#53441)" (#54046)
This reverts commit 39c06ae95e.

Based on
https://github.com/vercel/next.js/pull/53441#pullrequestreview-1578047015

<!-- 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 #

-->
2023-08-15 10:37:17 +02:00
Jiachi Liu
3f83743a6e
Make next a devDependency of @next/third-parties package (#53996)
ensure `next` is the dependency of third-parties package so turbo will
build next first then `@next/third-parties` to avoid type failing

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-08-14 08:55:57 -07:00
Rishabh Poddar
dd00229e03
examples: Update with-supertokens example app (#53434)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-08-14 10:09:36 -05:00
Tim
fa88095f44
examples: Update Example Prepr CMS (#49224)
Co-authored-by: Kevintjuhz <kevin@kqcreations.com>
Co-authored-by: Kevintjuhz <k.quaedvlieg@outlook.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2023-08-14 07:13:50 -05:00
Artur Bień
e0ca2ba544
feat(image): DataURL placeholder support for <Image /> (#53442)
Adds support for base64-encoded `placeholder`. Enables using placeholders without the "blur" effect.

Fixes #47639
- [x] Add support for DataURL placeholder
- [x] Add tests
- [x] Update docs

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-08-11 23:45:20 +00:00
Steven
87301834b3
chore: add light/dark mode theme detection to image component example (#53760)
This PR adds documentation for light/dark mode detection with `next/image`.

In the future, we could also document the picture solution once https://github.com/vercel/next.js/pull/51205 goes stable (although some of the preloading would not be possible).

* x-ref: https://twitter.com/victorbayas/status/1688596439704780822
2023-08-09 14:55:42 +00:00
Dingan(Will) Wang
5cfb936edd
Fix example/with-material-ui broken links (#53707)
Fixed the example/with-material-ui broken links.

It seems the external websites got updated.
2023-08-08 22:37:41 +00:00
vinay
c669c383a0
(example) update github-pages example (#52168)
Removed `appDir: true` from experimental flag and code refactor.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-08-07 22:35:06 +00:00
Jonathan Steele
786812d214
docs(with-stripe-typescript): Update README demo link (#53662) 2023-08-07 08:58:02 -05:00
Gonzalo
a66aca1e67
EXAMPLE: fix with-supabase signup button style (#53531)
### What?
Fix example `with-supabase` https://github.com/vercel/next.js/tree/canary/examples/with-supabase signup button

### Why?
Signup button text color is not the right one so the developer is not able to see the text.

### How?
Updated the style using tailwind as it is what we are using in the example.

Before:
![image](https://github.com/vercel/next.js/assets/1652286/269c3be1-70ee-4b92-9161-4d1c35cbd01c)

After (Fixed):
![image](https://github.com/vercel/next.js/assets/1652286/3aa6af87-7958-470d-bf05-d1187963e792)
2023-08-04 20:36:52 +00:00
Stef
39c06ae95e
Move USER and remove redundant --chown from Dockerfile (#53441)
### What?

In the Dockerfile example:

* Moves the `USER` command above the `COPY`s
* Removes the `--chown` on the `COPY`s 

> **Note**
> I don't know for 100% sure this won't have unintended side effects. Part of my motivation for opening this PR is to sense check whether we will be causing a regression by making this change in our own projects.
> 
> Please let me know if there's any concerns with this!

### Why?

Sonar security scanner flags this Dockerfile as having "security hotspots" due to the use of `--chown`

https://rules.sonarsource.com/docker/RSPEC-6504/

### How?

Make the `--chown`s redundant by setting the current user before doing the `COPY` commands.
2023-08-03 23:36:08 +00:00
Jonathan Steele
b7c9604cc7
example: Improve Stripe examples (#53255)
### What?
* Updates to the pre-existing [`with-stripe-typescript` example](https://github.com/vercel/next.js/tree/canary/examples/with-stripe-typescript).

### Why?
* Uses latest Stripe best practices.
* Updates to App Router.


Co-authored-by: Michael Novotny <446260+manovotny@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-08-03 23:25:29 +00:00
Kasper Andreassen
c5931a43d3
Update incorrect example link (#53472)
### What?
The link to the demo in README.md for `example/cms-enterspeed`.

### Why?
The link was pointing to the wrong demo.

### How?
Updated the README.md.
2023-08-02 10:04:09 -07:00
Jon Meyers
269114b5cc
examples: implement server side auth with supabase (#53372)
### What?

1. Refactor `with-supabase` example to use server-side auth

### Why?

1. It is the recommended path for Next.js, and can serve as an example for the authentication docs

### How?

1. Move authentication methods from Client Component to Route Handlers
2023-08-02 16:41:05 +00:00
Sam Ko
5c0e4895f3
Switch default reproduction-template to app (#53453)
### Updating reproduction examples

Our current `pnpm create next-app -e reproduction-template`, which is present in our Issues template, will create a Pages app. This PR updates the default (`reproduction-template`) to App Router, and adds a `reproduction-template-pages` example.
2023-08-01 18:20:19 +00:00
Balázs Orbán
10f74a1d45
Revert "docker examples: improve perf by using COPY --link" (#53440)
Reverts vercel/next.js#52835 because it does not work on Google Cloud Run, which we mention in the README.md.

Closes #53425
2023-08-01 12:48:57 +00:00
lijianan
a462a1583f
fix: update lost dependencies for examples (#53419)
update lost dependencies for examples
2023-08-01 04:06:07 +00:00
lijianan
a0d1d728b9
examples: update examples with-ant-design (#52896)
demo: update examples with-ant-design

- https://github.com/ant-design/ant-design/pull/43663
2023-07-30 23:35:46 +00:00
Balázs Orbán
5bccef85f2
chore(examples): fall back to English dictionary in i18n example (#53207)
If an unknown locale is detected, we should fall back to English

Fixes #53201


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-07-29 06:38:26 +00:00
Felipe Oliveira
46677ccda6
fix: (README.md) Fix typing error (#53311)
Fix typing error on documentation where 'deploying' it was written as 'deloying'
2023-07-28 20:43:43 +00:00
兰天游
04e46cbf40
feat: remove unused global variable (#51767) 2023-07-22 05:21:37 +00:00
Jon Meyers
2b49741308
examples: export force-dynamic from all dynamic routes (#52916)
### What?

Stop `with-supabase` template from throwing errors on build

### Why?

Dynamic Routes now fail the build, rather than console.logging an error

### How?

Export the following from any routes that use the `cookies` function

```
export const dynamic = "force-dynamic";
```

Install `encoding` as a dev dependency until this is fixed downstream
2023-07-20 13:33:43 +00:00
Kévin Dunglas
d8660bb059
docker examples: improve perf by using COPY --link (#52835)
### What?

Uses `COPY --link` instructions in Docker examples.

### Why?

This significantly [accelerates Docker builds and improves caching](https://www.howtogeek.com/devops/how-to-accelerate-docker-builds-and-optimize-caching-with-copy-link/).

This instruction is supported for more than 1 year and is now supported by almost all modern Docker installations.
We use it successfully for a while in [the API Platform distribution](https://github.com/api-platform/api-platform/blob/main/pwa/Dockerfile), which includes Next.js and is derived from these examples.

### How?

By updating the existing examples.
2023-07-18 20:44:46 +00:00
Eldar Amantay
0084166caa
chore(docs): Add mentioning of HOSTNAME env variable for standalone output (#52804)
### What?

Update documentation to mention a `HOSTNAME` env variable for `standalone` output

Related to Feature: https://github.com/vercel/next.js/pull/44627 

### Why?

Current documentation mentions only `PORT` env, but does not mention `HOSTNAME` added in January

Affected documentation pages:

- https://nextjs.org/docs/app/api-reference/next-config-js/output

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

### How?

- Run examples
- Check documentation
2023-07-17 19:59:53 +00:00
Starunaway
3c3f50ddde
Update examples: counter.tsx - Don't need empty space (#52576)
Don't need empty space
2023-07-12 15:41:04 +00:00
Tom Ballinger
a2618ede90
examples: Update Convex to latest version (0.19) (#52473)
Update Convex example to use convex 0.19.x

- [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
2023-07-09 22:51:15 +00:00
Kelly
67d7219cfd
Fix typos in examples/with-redux (#52368)
Two minor typos fixed:

`Thnuk` >> `Thunk`
`configre` >> `configure`
2023-07-07 12:18:50 +00:00
Jiachi Liu
0048908078
Remove legacy head.js in examples (#52292)
* Remove legacy `head.js` from examples and use `metadata` exports
instead
* Update the report template

---------
2023-07-05 16:42:36 -07:00
Steven
31dee6f38a
chore: remove experimental appDir: true from examples (#52289)
The experimental flag is no longer needed.

https://nextjs.org/blog/next-13-4
2023-07-05 21:45:39 +00:00
Delba de Oliveira
18406adf9c
Make sure DevEx can approve docs PRs / Remove Spaces (#51996) 2023-06-29 17:10:53 +00:00
Francesco Sansalvadore
b636d3d755
[examples] Update styling for with-supabase example (#51751)
### Adding or Updating Examples

Improve styling for the `with-supabase` example.

<img width="2048" alt="Screenshot 2023-06-24 at 15 07 46"
src="https://github.com/vercel/next.js/assets/25671831/0bba9a0a-a660-411e-b960-ea933aa2750a">
<img width="2048" alt="Screenshot 2023-06-24 at 15 07 58"
src="https://github.com/vercel/next.js/assets/25671831/00f70c8b-e6ea-47ac-8a2e-829b4b808280">

---------

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 21:11:13 -07:00
Milo
5b5ea47c54
Avoiding try-catch block on examples/app-dir-i18n-routing (#51786)
`Negotiator.languages()` accepts an array of available locales and
returns only results that are present in it.

This effectively eliminates the need to use a try-catch block when
calling `matchLocale`.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-27 17:00:14 -07:00
Mohan Raj Rajamanickam
fb10b2cfb1
chore(examples): relax pinned versions to fix npm install fail due to peer deps issue (#51636)
Currently `npm install` fails with
```
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR!   peer react@"*" from next-redux-wrapper@7.0.5
npm ERR!   node_modules/next-redux-wrapper
npm ERR!     next-redux-wrapper@"^7.0.2" from the root project
npm ERR!   2 more (next, react-dom)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.3" from react-redux@7.1.3
npm ERR! node_modules/react-redux
npm ERR!   react-redux@"7.1.3" from the root project
npm ERR!   peer react-redux@"*" from next-redux-wrapper@7.0.5
npm ERR!   node_modules/next-redux-wrapper
npm ERR!     next-redux-wrapper@"^7.0.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
```

<!-- 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: JJ Kasper <jj@jjsweb.site>
2023-06-24 00:12:38 -07:00
realazy
fa519f63b7
fix some issues on examples/app-dir-i18n-routing (#51576) 2023-06-24 00:29:41 +00:00
Aral Roca Gomez
03fe3f6330
docs: update with-next-translate example using appdir (#51720)
I updated the with-next-translate example using the app directory and
updated to current versions

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-23 13:39:07 -07:00
Jon Meyers
4dae429e8c
examples: add missing supabase-js dependency for with-supabase example (#51703)
### What?

Adds `supabase-js` as dependency for `with-supabase` example

### Why?

`with-supabase` example is missing `supabase-js` dependency, which is a
peer dependency of `@supabase/auth-helpers-nextjs`

### How?

Adds `supabase-js` to `examples/with-supabase/package.json`

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-23 11:02:50 -07:00
Jon Meyers
0674d95d2e
examples: improve with-supabase example (#51442) 2023-06-21 15:37:03 -07:00
Jessica Chowdhury
cca9dd1297
examples: Add new cms-payload example. (#49616)
This PR adds `cms-payload` to the examples folder. The demo provides a
NextJS frontend, built with Payload, which can be deployed together in a
single instance.

### Improving Documentation or adding/fixing Examples

- [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: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-16 07:32:51 -07:00
Jon Meyers
3cac09790b
examples: update with-supabase example to App Router (#51335)
### What?

Update Next.js with Supabase example

### Why?

Existing example for Next.js with Supabase is out of date

### How?

- Rename `with-supabase-auth-db-realtime` to `with-supabase`
- Update example to use App Router
- Use Supabase Auth Helpers for Next.js to configure auth cookies

---------
2023-06-16 06:16:42 -07:00
Dima Vakatsiienko
04cd1fd4ef
Upgrade with-redux example to app router (#49994)
### What?

Update **with-redux** example.

### Why?

**with-redux** example have:
- outdated packages
- outdated approaches and relies on **pages** directory

Since **app router** is stable now and is recommended to use, I've updated this example.

### How?

An update includes:
- move example to **app router**
- update **package.json** deps to the latest versions
- modernize jest by switching from **ts-node** to **@swc/jest**
- fix and overhaul **tests**
- modernize **redux** infra
- overhaul example **source code quality**


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-06-16 02:00:04 +00:00
Valentin Politov
5b268be6f3
examples: migrate with-elasticsearch to TypeScript (#44842)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

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


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-06-15 16:26:09 +00:00
Milan K
b09bbad535
Auth0 V2 migration update (#45302)
## Documentation / Examples

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

Hi Next.js team,  

This PR aims to update examples/auth0 with Auth0 V2 and fix profile api console error.

https://github.com/auth0/nextjs-auth0/blob/v2.0.0/V2_MIGRATION_GUIDE.md

Thanks for the review.
2023-06-15 16:10:16 +00:00
Tom
831f58a70c
change strapi example to latest one - fixes #51332 (#51334)
fixes #51332 




### What?

Changed the link to the latest official Strapi example with Next.js (+ App Router), Tailwind and TypeScript.

### Why?

The current example will be archived. See related blog post: https://strapi.io/blog/introducing-the-new-strapi-starter-with-nextjs13-tailwind-and-typescript

> We'd also like to address what this means for older Strapi starters. Due to limited bandwidth, we've decided to support only this new Strapi Starter officially, and all other starters will be archived.

### How?

.
2023-06-15 15:21:48 +00:00
Nicolás Figueroa
29bd0980cf
with-facebook-pixel: new implementation with app folder (#49880)
### What?

* **Facebook pixel implementation with the new `app folder` structure.**
* The pixel script can now be kept in the public folder.
* The Facebook script can be placed in the `layout.js` file
* A component called `FacebookPixel` is provided to handle the initial script setup and manage `PageView` events when the page changes.
* Classic implementation with `pages` folder now is in `_pages`

### Why?
To provide an example of implementing the new `app folder` structure with Next.js ˆ13, which includes using the new files like `layout`, `page`, etc.

### How?

Utilizing the `next/script` package and the `layout.js` file to initialize the Facebook pixel when the application starts and manage subsequent events.

### Evidence of Implementation:

Here are some examples that demonstrate the successful implementation of the Facebook pixel using the new `app folder` structure and `Next.js ˆ13`


Tracking main page `app/page.js`
<img width="399" alt="image" src="https://github.com/vercel/next.js/assets/26902419/fd3baee8-363d-4f2c-b949-517409ad36de">

<img width="2105" alt="image" src="https://github.com/vercel/next.js/assets/26902419/7d91d786-cd31-4c21-bb79-7e9a78fb1c3b">

Tracking another path `app/about/page.js`
<img width="333" alt="image" src="https://github.com/vercel/next.js/assets/26902419/dda7bc05-6fb5-482d-8a6a-d981a08c66e1">

<img width="2102" alt="image" src="https://github.com/vercel/next.js/assets/26902419/b0392d6e-31fe-42d1-a7b4-ca38879dde94">

navigation between pages with `next/link`
<img width="2098" alt="image" src="https://github.com/vercel/next.js/assets/26902419/21115bee-a77f-4467-bb25-c95e2850cda2">
2023-06-15 04:11:32 +00:00
Max Proske
28dca13498
Update Docker examples to use Compose v2 command (#51134)
Compose v1 has reached EOL, and will no longer be included with Docker after June 2023: https://www.docker.com/blog/docker-desktop-4-19/
2023-06-14 20:03:36 +00:00
Brandon Owens
862f556c69
Update Player.tsx to improve code readability and styling. (#50275)
Updated the demo player component to have more consistent styling and
format.

I thought this could be some nice spring cleaning for the community 🧹 

<!-- 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 or adding/fixing 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: JJ Kasper <jj@jjsweb.site>
2023-06-13 23:20:28 -07:00
Lazar Nikolov
2ce15c4d3c
update(examples): Update with-sentry example (#47855)
Updating the `with-sentry` example with latest dependencies versions, new feature docs, and also converted it to TypeScript.

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

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-06-14 06:10:06 +00:00
Dustin Thurston
dd61ee44c5
Show how to utilize the provided .env file in the docker-compose file (#50712)
### What?
I added a small change to the `with-docker-compose` example to show how to make the provided `.env` file usable.

### Why?
I struggled to understand why I could not get environment variables to work as intended and thought this small change might help someone else new to docker in the future.

### How?
Added a few comments to the `docker-compose.dev.yml` file, along with showing how to utilize a `.env` file with docker-compose



Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-06-14 05:42:00 +00:00
Akira Kijinami
d080c8ee79
fix deprecated configureStore in with-redux-saga example (#50342)
<!-- 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 or adding/fixing 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 #

-->

This PR introduces the following changes:
- Replaced redux's [deprecated
createStore](https://github.com/reduxjs/redux/pull/4336) with
configureStore from @reduxjs/toolkit.
- Updated packages.
- Corrected an error in getStaticProps.

This is my first contribution and there may be some shortcomings, I
appreciate your understanding and look forward to your feedback.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-13 22:00:35 -07:00
Tom
6f9c9ad1d8
fix: cypress component testing - fixes #50283 (#50303)
<!-- 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 or adding/fixing 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?

Fixing the cypress component testing example, since it breaks the
next.js build process.

### Why?

The default example is not working regarding this issue:
https://github.com/vercel/next.js/issues/50283

Because there's a cypress test file (`*.cy.tsx`) inside the `/pages`
directory.

### How?


In this pull request, I made the following changes:

- Removed the new Cypress component test file from the /pages directory
to resolve conflicts with the build process.
- Created a dedicated directory for components, and created a new
example component.
- Moved the test file to the new component directory to ensure it works
as expected.

Build works:


![image](https://github.com/vercel/next.js/assets/987947/f79cc585-ad32-4780-ba56-a5f28259c69c)

Starting the new component testing works:


![image](https://github.com/vercel/next.js/assets/987947/032cff8f-5d1f-4aa2-b6b6-c95b5739e838)

Cypress Component Testing starts correctly:


![image](https://github.com/vercel/next.js/assets/987947/dff446b7-533b-4f6a-8f6c-09066866ba41)

The Component Test is there and ready to test:


![image](https://github.com/vercel/next.js/assets/987947/c235e1bb-9097-47b9-a625-a71b2ef5e129)

The Component Test passed as expected:


![image](https://github.com/vercel/next.js/assets/987947/fbaeaa18-5b63-4de6-9953-486bd7959703)

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-13 21:53:50 -07:00
Tom
a59c1f0d58
Fix with typescript stripe example fixes #50541 (#50574)
### What?

The TypeScript Stripe example has been fixed to address various issues. One of the issues was related to calling a function, which has now been resolved. Additionally, the Stripe API used in the example was outdated, causing an error during the build process. This issue has also been fixed.

By making these fixes, the TypeScript Stripe example should now work correctly without any function calling issues or errors related to the outdated Stripe API during the build.

### Why?

There's an issue regarding this problem `Fix with typescript stripe example fixes #50541`

```console
$ next build
- info Linting and checking validity of types ..- error ESLint must be installed in order to run during builds: yarn add --dev eslint
- info Linting and checking validity of types ...Failed to compile.

./components/CartSummary.tsx:41:24
Type error: Argument of type '{ sessionId: any; }' is not assignable to parameter of type 'string'.

  39 |     }
  40 |
> 41 |     redirectToCheckout({ sessionId: response.id })
     |                        ^
  42 |   }
  43 |
  44 |   return (
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

### How?

- Calling the `redirectToCheckout` function the right way 275cb65f3d/use-shopping-cart/react/index.d.ts (L65)
- Updating Stripe API
- Fix some changed / depcrated code since the API has changed a little
- Fix a TS error since the used library does not has a correct TS defintion file


![image](https://github.com/vercel/next.js/assets/987947/dd21dbb0-e949-4b3e-a26c-6a6d720c6e37)



Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-06-14 04:41:56 +00:00
Ethan Arrowood
d31ced1d26
update storybook example (copy from vercel/vercel) (#50865)
Updates the `with-storybook` example to be the example located in [`vercel/vercel`](https://github.com/vercel/vercel/tree/main/examples/storybook). 

The motivation for this change is that we now have better support for storybook. It is now treated as its own framework and so users can specify the `storybook` framework as well as custom build command `build-storybook` in order to get near zero-config support 🌟 

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-06-14 03:18:44 +00:00
Delba de Oliveira
3d41ccb916
Update codeowners (#51250)
Tweak code owners after some testing and feedback. 

- Move the Next.js team up to be optional global code owners (so that everyone can review but are not tagged for review). Global individuals should still be tagged if there are no specific `.vercel.approvers` files in subdirectories.
- Adds @vercel/devex to image files so there's coverage on those files for the docs
- Target specific folder and files for Styfle to get notified
- Deletes some rules in the old GitHub codeowners
2023-06-13 17:47:12 +00:00
Sora Morimoto
0840793abf
Fix all 404 links (#51209)
I found some 404 links in jsdoc, so I used ripgrep to find and fix all the broken links to fix all the other links in this PR.
2023-06-13 14:25:40 +00:00
Michael Novotny
55b29fb351
Updates prettier to latest version. (#51000)
There are some incoming docs / MDX changes where prettier will throw an error when using the older version. Updating prettier before I bring in those changes.

Looks like the most notable change is adding parentheses around `typeof` checks in TypeScript. 

**Before**

```
export type Locale = typeof i18n['locales'][number]
```

**After**

```
export type Locale = (typeof i18n)['locales'][number]
```
2023-06-09 14:58:19 +00:00
vikas singh
13bd196d08
Added Azure Cosmos DB started code, containing a minimal app and README.md (#49128)
These changes contain Started Code for Azure Cosmos DB.
2023-06-08 21:42:46 +00:00
Delba de Oliveira
8c2e5bd072
Update codeowners to use Vercel Spaces (#50841)
Move as much of codeowners as possible to use Vercel Spaces. 

1. Makes `@timneutkens @ijjk @shuding @huozhi @feedthejim` global owners
2. Make the `@vercel/next-js` team _optional_ owners of **/docs**,
**/errors**, and **/contributing**, makes team owners of a few packages
as per old config.
3. Make `@vercel/devex` (docs and devrel) owners of **/docs**,
**/errors**, and **/contributing**
4. Make `@vercel/devrel` (devrel only) owners of **/examples**
5. Make `@vercel/web-tooling` owners of specific files and folders (as
per old config)

Leaves @styfle as owner of **image** files on the old config since this
pattern `/**/*image*/** ` can't be used with Vercel Spaces.

Note: We cannot add * or / at the end of files.
[Docs](https://spaces-docs.vercel.sh/docs/code-owners#:~:text=Code%20Owners%20files%20are%20meant%20to%20encourage%20distributed%20ownership%20definitions%20across%20a%20codebase.)
2023-06-08 12:02:18 +02:00
Jack Sutton
27655dbba7
Update Vanilla Extract Example (#50394)
### What?
- Adds an updated Vanilla Extract example
- ~~Note that `@vanilla-extract/next-plugin` currently requires
`experimental: { appDir: true }` to be set.~~

### Why?
- The
[documentation](https://nextjs.org/docs/app/building-your-application/styling/css-in-js)
currently links to a [personal
repo](https://github.com/SuttonJack/vanilla-extract-app-dir)
- Closes https://github.com/SuttonJack/vanilla-extract-app-dir/issues/2

<p align="center"><img width="600"
src="https://github.com/vercel/next.js/assets/92991945/eeab322e-e75e-4999-9fe7-39aa15c45c11"
/></p>

-->
2023-05-27 01:41:17 +00:00
Maia Teegarden
ff070e530b
Use correct casing in filenames (#50223)
My computer ignored the casing change when copying things over, which
causes resolution errors.
2023-05-23 17:49:36 +00:00
Ibrahem Mahyob
7230976317
Fix TypeScript error in with-mongodb example (#50094)
- Resolves #50084

The context parameter in the getServerSideProps function lacked a type, which led to a compile-time error. To resolve this, the GetServerSidePropsContext type from next was used to properly type the context parameter. This ensures type safety and allows TypeScript to catch potential errors at compile time.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-05-22 18:59:40 +00:00
Dev Agrawal
815c256681
Clerk example updates (#50021)
<!-- 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 or adding/fixing 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 #

-->
Fixed landing page responsiveness for smaller screens
Sign in, Sign up, and User profile components centered on page
Fixed demo URL in readme
Added redirect to landing page after signout

@perkinsjr

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-22 18:43:47 +00:00
Darsh Patel
f9f0f335e6
fix: use node copyFile for cross-platform support (#48740)
Fixes: #48712

Use node copyFile in the package.json script for cross-platform support 

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-05-21 21:23:49 +00:00
Maia Teegarden
e5eab8b38d
update with-turbopack example (#49332)
Updated to latest app-playground code
2023-05-18 17:33:02 +00:00
Rodrigo Esteves
9e5116975d
Upgrading react-ga to react-ga4 (#48932)
taken from google analytic's page:

 "_On July 1, 2023, this property will stop processing data. Starting in March 2023, for continued website measurement, migrate your original property settings to a Google Analytics 4 (GA4) property, or they'll be copied for you to an existing GA4 property, reusing existing site tags._"

The package 'react-ga' doesn't support GA4, so i updated the package to 'react-ga4', the example continues primarily the same, the only differences is that specifying 'pageview' is now required instead of just setting the location of the pageview and the expection() function doesn't exist in this package.

required changes are welcomed




Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-05-16 22:06:09 +00:00
Dev Agrawal
9e978cf64f
with-clerk example updated to app router (#49717)
<!-- 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 or adding/fixing 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?
Updates the `with-clerk` example to use the app router and latest
version of `@clerk/nextjs`
### Why?

### How?

Closes NEXT-
Fixes #

-->

Updates the `with-clerk` example to use the app router and latest
version of `@clerk/nextjs`
2023-05-15 22:25:43 +00:00
Rishabh Poddar
af3380790e
Update with-supertokens example (#49804)
Update dependencies of our SDKs to point to the latest version

---------
2023-05-15 14:25:43 -07:00
Alexander Bluhm
5ccf71a418
Add mdx page example to examples/app-dir-mdx (#47082)
This PR affects the `examples/app-dir-mdx` project.

Currently, only an example of importing a `.mdx` file (`message.mdx`) into the `page.tsx` file is shown.
However, a more common example would be using a `.mdx` file as a page, e.g., in a blog scenario.
I added an example for this, enabled the page extension to allow `.mdx` pages, and changed the body's height, which is a cosmetic change for the newly created blog page.
2023-05-13 20:12:13 +00:00
Steven
68b51415ec
chore: update examples to use draft mode (#49720)
This PR updates the examples to use Draft Mode introduced in [Next.js 13.4](https://nextjs.org/blog/next-13-4)

fix NEXT-1153
2023-05-13 07:12:56 +00:00
Lee Robinson
fa1370fd9b
Update links from beta to stable docs. (#49349)
Now that the beta docs have been merged into stable with the release of
13.4, this updates all links as some paths have changed due to
redirects.

---------

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-05-11 11:52:29 -07:00
Maia Teegarden
fdd6e979f4
Turbopack alpha -> beta (#49103)
Closes WEB-918
Closes WEB-913
2023-05-04 16:53:40 +02:00
Balázs Orbán
8d9658c680
chore: simplify repo templates (#49073)
[Slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1682414178536089)

Closes NEXT-1076
2023-05-03 14:42:31 +02:00
lijianan
eea3f34bc2
chore: use includes replace indexOf (#48901)
use includes replace indexOf
2023-05-02 00:07:04 +00:00
Daniel
37821b54c4
docs: Fix path of '.env.template' (#49012) 2023-05-01 15:23:24 +00:00
JTaylor0196
f7baa56792
update example Deploy button URLs (#48842)
### What?
Updates Deploy button URLs for all listed examples here:
https://github.com/vercel/next.js/tree/canary/examples

### Why?
The Deploy URLs are currently broken and result in a failed clone
attempt on Vercel.

### How?
The URLs have been changed from https://vercel.com/new/git/external?… to
-> https://vercel.com/new/clone?…
(Last updated
[here](8eaabe2fb0)
in 2021)
2023-04-26 13:31:44 -04:00
Dylan Jhaveri
e952160049
Update Mux example logo to new Mux brand (#48654)
<!-- 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 or adding/fixing 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 #

-->
2023-04-20 23:45:43 +00:00
Adil Ansari
2505e11146
fix: Adding search field decorator (#48350)
### Updating Tigris example

- [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
2023-04-13 19:51:12 +00:00
Yohei Tsubuku
df16f74f0f
Fix the typo on README.md (#48274)
This is a very tiny fix. I hope it helps.
`examples` → `example`
2023-04-12 02:07:38 +00:00
Jan Kaifer
e35710f71f
Recommend @opentelemetry/api instead of @vercel/otel reexport (#48013)
- remove vscode folder from example
- recommend `@poentelemetry/api` over `@vercel/otel`

<!-- 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 or adding/fixing 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 #

-->

fix NEXT-959
2023-04-06 14:17:47 +02:00
Swarnava Sengupta
a79d1efdd0
[Docs] Update react docs link (#47891)
- This PR fixed the  Documentation link of new react.dev website.
2023-04-04 11:56:03 -07:00
Jan Kaifer
a3acbf4f55
Add documentation on OTEL support (#47194)
Added docs that mention:
- important code-snippets from example
- links to official OTEL docs
- document NEXT_VERBOSE_OTEL
- explain what we provide out of the box
- what we don’t
- explain how you can add tracing yourself
- explain how instrumentation.js works
- it can be used for different types of instrumentation that don't use
OTEL. It's just a hook called when starting up a new node environment.

- list of all spans we instrument by default
 
fix NEXT-799 ([link](https://linear.app/vercel/issue/NEXT-799))

---------

Co-authored-by: S3Prototype <liuqahs15@gmail.com>
2023-04-04 14:24:46 +00:00
Ricardo Fiorani
9d6eee11a6
Update github link (#47900) 2023-04-04 10:02:52 +00:00
Rishabh Poddar
c9c8f6cde0
Updates with-supertokens example app (#47701)
Co-authored-by: NkxxkN <kevin@supertokens.io>
Co-authored-by: NkxxkN <kevin.antoine@protonmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Rishabh <rishabh@supertokens.io>
Co-authored-by: Bhumil Sarvaiya <sarvaiyabhumil@gmail.com>
Co-authored-by: jscyo <joelsteve97@hotmail.com>
Co-authored-by: Mihaly Lengyel <mihaly.lengyel@tresorit.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Mihaly Lengyel <mihaly@lengyel.tech>
Co-authored-by: Alisher <alisher@supertokens.com>
Co-authored-by: Nemi Shah <nemishah1212@gmail.com>
2023-03-31 05:38:58 +00:00
Steven
af49d5098b
chore(docs): update next export to output: 'export' (#47717)
fix NEXT-927 ([link](https://linear.app/vercel/issue/NEXT-927))
2023-03-31 02:04:23 +00:00
Ian Macartney
38953adb11
Update Convex example to convex@0.12.0 (#47175)
Updates Convex to 0.12.0

### Improving Documentation or adding/fixing Examples

- [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: Alex Cole <2695197+alexcole@users.noreply.github.com>
2023-03-28 00:32:20 +00:00
Lee Robinson
7c44cf0a3b
Use App Router for static export example. (#47584)
To aid the new docs, stable static export in the next release.

https://beta.nextjs.org/docs/configuring/static-export
2023-03-27 23:11:47 +00:00
Karl Horky
3ad55721d1
Remove incorrect entries for pnpm debug log (#47241)
**Reasons for making this change:**

- it is contained within `node_modules/`, which is already ignored
- the previous versions, which were not in `node_modules/`, did not have
a period at the beginning of the filename

Links to documentation supporting these rule changes:

**Changelog with proof here:**


ba4b2db1f2/pnpm/CHANGELOG.md (L3330)

History:

- my PR to remove this from `github/gitignore` here:
https://github.com/github/gitignore/pull/4250
- First introduced in `github/gitignore` in
https://github.com/github/gitignore/pull/3732 by `@sakurayang` (merged
by `@martinwoodward`)

<!-- 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 or adding/fixing 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: JJ Kasper <jj@jjsweb.site>
2023-03-26 22:26:05 -07:00
vinay
826fb36680
fix-(Examples) Updated link tags in Auth0 example code. (#47518)
Updated The link Tags for example on Auth0.

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-03-25 18:03:59 +00:00
Akshay
f30069b09d
Updated the versus short form in ssg-ssr example in docs (#47397)
<!-- 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 or adding/fixing 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: JJ Kasper <jj@jjsweb.site>
2023-03-24 17:24:00 -07:00
Muhammad Uzair
cb541006dc
chore(examples): Fix for destroy is not a function error (#47469)
Fixes #47393

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Steven <steven@ceriously.com>
2023-03-24 15:02:39 +00:00
Rishabh Poddar
5914a339c8
Update to supertokens example app (#47435)
Updates backend SDK version dependency for supertokens-node

---------

Co-authored-by: NkxxkN <kevin@supertokens.io>
Co-authored-by: NkxxkN <kevin.antoine@protonmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Rishabh <rishabh@supertokens.io>
Co-authored-by: Bhumil Sarvaiya <sarvaiyabhumil@gmail.com>
Co-authored-by: jscyo <joelsteve97@hotmail.com>
Co-authored-by: Mihaly Lengyel <mihaly.lengyel@tresorit.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Mihaly Lengyel <mihaly@lengyel.tech>
Co-authored-by: Alisher <alisher@supertokens.com>
Co-authored-by: Nemi Shah <nemishah1212@gmail.com>
2023-03-23 23:11:43 -07:00
furkan mavili
1a85bb7c65
chore: fix localhost port (#47413)
Development server actually running on port 3000.

![image](https://user-images.githubusercontent.com/61994117/226997492-7d61d401-bcdc-47b0-ac5b-48469c5a88b8.png)
2023-03-22 18:20:22 +00:00
Muhammad Uzair
985028b4bc
chore(examples): fix Mongoose deprecation warning (#47358)
Upgraded mongoose to the latest version. Mongoose Deprecation Fixed for
issue #47336

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-03-21 17:03:20 -07:00
tka5
fd0e81342f
fix typo (#47235)
Co-authored-by: Jan Kaifer <jan@kaifer.cz>
2023-03-20 15:45:45 +00:00
Franktronics
8dabe4fc96
docs: commentary correction for i18n app folder (#47226)
Simple correction of a word in the comments
2023-03-17 02:07:18 +00:00
Balázs Orbán
8c98a207f2
feat(cli): introduce --tailwind flag (#46927)
### What?

This PR introduces a new `--tailwind` flag to the `create-next-app` CLI,
to make it easier to bootstrap a Next.js app with Tailwind CSS
pre-configured. This is going to be the **default**. To opt-out of
Tailwind CSS, you can use the `--no-tailwind` flag.

### Why?

Tailwind CSS is one of the most popular styling solutions right now, and
we would like to make it easier to get started.

Currently, the closest you can come to this is by running `pnpm create
next-app -e with-tailwindcss` which will clone the
https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss
example. But that example is not configured for the App Router. This PR
will let you add Tailwind CSS to both `app/`, `pages/`, and start out
with TypeScript or JavaScript via the CLI prompts.

(Some community feedback
https://twitter.com/dev_jonaskaas/status/1632367991827443713,
https://twitter.com/samselikoff/status/1634662473331617794)

### How?

We are adding 4 new templates to the CLI bundle.

> Note: The styling is not pixel-perfect compared to the current
templates (using CSS modules) to require fewer overrides, but I tried to
match it as close as possible. Here are a few screenshots:

<details>
<summary><b>Current, light</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224733372-9dba86fe-9191-471d-ad9f-ab904c47f544.png"/>
</details>

<details>
<summary><b>Tailwind (new), light</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224733610-038d9d0f-634d-4b69-b5c2-a5056b56760c.png"/>
</details>

<details>
<summary><b>Current, dark, responsive</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224733790-9b4d730c-0336-4dbe-bc10-1cae1d7fd145.png"/>
</details>

<details>
<summary><b>Tailwind (new), dark, responsive</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224734375-28384bbc-2c3a-4125-8f29-c102f3b7aa1d.png"/>
</details>

#### For reviewers

This introduces 4 new templates, with a very similar code base to the
original ones. To keep the PR focused, I decided to copy over duplicate
code, but we could potentially create a shared folder for files that are
the same across templates to somewhat reduce the CLI size. Not sure if
it's worth it, let me know. Probably fine for now, but something to
consider if we are adding more permutations in the future.

---

~Work remaining:~

- [x] app+ts
	- [x] layout
	- [x] dark mode
	- [x] media queries
	- [x] animations
- [x] app+js
- [x] pages+ts
- [x] pages+js
- [x] prompt/config
- [x] deprecate Tailwind CSS example in favor of CLI
- [x] update docs
- [x] add test
- [x] add [Prettier
plugin](https://github.com/tailwindlabs/prettier-plugin-tailwindcss)
 
Closes NEXT-772
Related #45814, #44286
2023-03-16 16:06:27 +01:00
Steven
0e91549397
chore(ci): automatically deploy selected examples (#47130)
fix NEXT-822 ([link](https://linear.app/vercel/issue/NEXT-822))
([NEXT-822](https://linear.app/vercel/issue/NEXT-822))

---------
2023-03-15 17:01:26 -07:00
Jan Kaifer
1e47bc23c3
Finish up otel example with working docker and small guide in readme (#46819)
Finish up OTEL example with HTTP (we don't recommend grpc because that
package is needlessly large).

Also added a link to a simple repo with otel collector and few backends:
https://github.com/vercel/opentelemetry-collector-dev-setup

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-03-14 09:05:23 +01:00
Mojtaba
2579ad7648
updated zustand example to 4.3.6, changed out deprecated methods (#46911)
updated zustand example to 4.3.6
changed out zustand's deprecated methods (createContext, create)
converted the example to typescript

## Why
zustand's example in nextjs repo is for zustand v3 which is quite
different to how things are done in v4, it was also in javascript.
back when when I started to use zustand in my nextjs app, this example
helped me a lot and now, I wanna do the same for devs that come here to
see how they can integrate next and zustand.

## Documentation / Examples
[✓] Make sure the linting passes by running pnpm build && pnpm lint
[✓] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-03-13 21:26:08 -07:00
Bradley Dirheimer
7e0bae4ce7
chore(examples): fix @ts-ignore in Cloudinary config (#47029)
This change will remove the typescript error. cloudinary.config doesn't
exist, it should be updated to cloudinary.v2.config

<!-- 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 or adding/fixing 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 #

-->

---------
2023-03-13 13:40:21 -07:00
Abhiyan Dhakal
e7cbf4b57d
Update _mongoClientPromise type error (#46985)
Fixes #46983. The type of `_mongoClientPromise` has been added as
Promise<MongoClient> which fixes the error.
… file @/examples/with-mongodb/lib/mongodb.ts

![image](https://user-images.githubusercontent.com/96732471/224264097-2f4f3181-73b3-4ebd-b756-2301bab1a3fd.png)


<!-- 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 or adding/fixing 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: JJ Kasper <jj@jjsweb.site>
2023-03-13 09:48:46 -07:00
John Daly
97299a67a7
[with-jest]: Update to use automatic path aliases (#46982)
<!-- 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 or adding/fixing 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 #

-->

Updating the `with-jest` example to make use of the automatic path alias
feature that was added in https://github.com/vercel/next.js/pull/45815

I've also updated the dependencies in the example

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-03-13 09:40:53 -07:00
zlrlyy
7457be0c74
chore(examples): upgrade Sentry to support Middleware (#47067)
Co-authored-by: zhenglr <zhenglr@rd.netease.com>
2023-03-13 14:29:28 +00:00
Ray Wong
9a1798b69d
Fix with-jest and with-jest-babel example test snapshot failure (#46885)
fixes #46838

This PR fixes the snapshot test failure of examples `with-jest` and `with-jest-babel`.

I have tested by running tests in the files generated by these 2 commands: 

```
$ npx create-next-app@latest --example https://github.com/rayrw/next.js/tree/fix-with-jest-example-test-failure/examples/with-jest fix-snapshots-failure
$ npx create-next-app@latest --example https://github.com/rayrw/next.js/tree/fix-with-jest-example-test-failure/examples/with-jest-babel fix-snapshots-failure
```
2023-03-08 01:16:15 +00:00
Hannes Bornö
527afe1cae
Change @next/font to next/font in examples (#46836)
Migrate examples using `@next/font` to `next/font`.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-03-06 21:01:13 +00:00
Jennifer Proust
605f7e0e0c
Update view-source.tsx (#46790)
Fixes #46789 





## Bug

- [X] Related issues linked using `fixes #number`

## Feature

- [X] Documentation added


## Documentation / Examples

- [X] Make sure the linting passes by running `pnpm build && pnpm lint`
- [X] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-03-05 17:47:15 +00:00
Danny
a20ce541bc
Add @types/mdx to app-dir-mdx example (#46523)
The `app-dir-mdx` is missing `@types/mdx` thus causing an error: `Cannot find module 'mdx/types' or its corresponding type...`

[Related PR](https://github.com/vercel/next.js/pull/45737) previously added types but was missing the line in `package.json`

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-03-02 09:07:02 +00:00
Snorre Eskeland Brekke
9d30f43aca
Updates cms-sanity example to use Sanity v3 (#45662
## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

Fixes issues reported, for instance here:
https://github.com/vercel/community/discussions/1449
(The example does not deploy atm and uses an old version of Sanity).
## Feature

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

* Updates the Sanity studio to use the latest v3 version. This required
changing some files, as per migrating to Studio v3 docs.
* Updated the README to reflect the changed procedure. 
* Update the next app to use the latest version of next-sanity. Changed
related code as a result.

### Testing
Tested using this deploy url (uses the branch from the forke repo):

https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fsanity-io%2Fnext.js%2Ftree%2Fsanity-v3%2Fexamples%2Fcms-sanity&repository-name=cms-sanity&project-name=cms-sanity&demo-title=Blog+using+Next.js+%26+Sanity&demo-description=On-demand+ISR%2C+sub-second+as-you-type+previews&demo-url=https%3A%2F%2Fnext-blog-sanity.vercel.app%2F&demo-image=https%3A%2F%2Fuser-images.githubusercontent.com%2F110497645%2F182727236-75c02b1b-faed-4ae2-99ce-baa089f7f363.png&integration-ids=oac_hb2LITYajhRQ0i4QznmKH7gx


## Documentation / Examples

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

fixes #46450
2023-02-27 11:58:43 +01:00
Jan Kaifer
f3ef4e99b0
Cover 1st-party examples with tests (#45270)Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
We want to make sure that our examples are not breaking.
We don't want to be slowed down by broken 3rd party packages, but we
need to ensure that examples covering next.js features are always green.

Added as a standalone workflow that doesn't parallelize. It will just
run on a cron schedule, so we can check for current status. We can add
Slack ping later if we need to.

The workflow tests just that our examples can build, so mostly TS
issues. We could definitely follow up with actual tests, but that is not
as low-hanging.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-02-27 11:54:24 +01:00
Johan Mattsson
bca8962303
Add missing 'key' (#46386)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-24 21:13:51 +00:00
Nick Anisimov
cd557c9667
fix(cms-examples): title warning (#46262)
## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

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

Fixes #46261
2023-02-23 15:21:03 +00:00
Michael Webb
4faf579c4f
[EXAMPLES] Update with-apollo-neo4j-graphql (#44570)
We replace neo4j-graphql-js with @neo4j/graphql and update Apollo server to version 4.

This refactor also changes the code from Javascript to Typescript.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-23 13:37:22 +00:00
Jimmy Lai
4072955eba
feat: add OTEL instrumentation for next-server + OTEL example (#46198)
fixes NEXT-479

## content

This PR adds a `getTracer` API to Next.js that uses the `otel/api` under
the hood to provide Next.js level instrumentation through Open
Telemetry.

This also adds an example `with-opentelemetry` to demonstrate how it can
be used, assuming you have a collector.

This allows most notably to have `getServerSideProps` and `fetch` calls
inside Server Components traced.

## details

- we hide most internals spans, if you want to see all of them, use the
NEXT_OTEL_VERBOSE=1 env var
- if you want to use this, you'll need to rely on the
`config.experimental.instrumentationHook` config option to initialise
OTEL, like in the example

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-22 16:08:22 +01:00
Abe Chen
cb03a79968
fix: <title> problem in example/blog-starter (#46122)
## Bug

Relate discussions: #38256

Occur in blog starter template. 

```
Warning: A title element received an array with more than 1 element as children. In browsers title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering
    at title
    at head
    at Head (webpack-internal:///./node_modules/.pnpm/next@13.1.6_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/pages/_document.js:279:1)
    at html
    at Html (webpack-internal:///./node_modules/.pnpm/next@13.1.6_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/pages/_document.js:678:104)
    at Document
```
2023-02-19 20:20:26 +00:00
Vasu Singh
f9346f15d7
Update @testing-library/react in with-redux example (#46085)
<!--
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:
-->

Updating the @testing-library/react as the older one is not compatible
with react-18.
<img width="926" alt="Screenshot 2023-02-18 at 12 26 55 PM"
src="https://user-images.githubusercontent.com/85363195/219846347-74a11525-1938-4fb2-aa4a-f97a81a8d4ab.png">


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-17 23:21:43 -08:00
Will Binns-Smith
7230258898
Add loader-runner to compiled packages (#45962)
This adds `loader-runner` to the compiled packages distributed with
Next.js

This is a dependency of Turbopack's webpack loader support. Currently,
users have to manually install `loader-runner` in their application to
use webpack loaders with Turbopack. This will allow Turbopack to require
loader-runner from within the installed version of Next.js instead.

Test Plan: `require('./packages/next/dist/compiled/loader-runner/')`

<!--
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:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

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

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-17 22:24:40 -08:00
Gergely Nemeth
ebcde03648
[examples] Use styletron-react 6.1.0 (#45810)
Co-authored-by: Jan Kaifer <jan@kaifer.cz>
2023-02-17 08:33:14 +00:00
Vasu Singh
5023e7fb7e
Fixing nextjs-recoil example (#46024) 2023-02-17 09:19:56 +01:00
Andrii Bodnar
c55345267e
chore(examples): update with-lingui example (#46007)
This PR updates the `with-lingui` example's dependencies and the actual Lingui site URL

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-16 22:15:53 +00:00
Vasu Singh
8d84dca5a9
chore(examples): more practical jotai example (#45973)
<!--
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:
-->

The previous jotai example is a very basic counter-example, I updated
this to an example in which we can draw points on a canvas using the
cursor.


![next-jotai](https://user-images.githubusercontent.com/85363195/219225036-98461698-f1c1-4b85-8b0d-1fc42a463846.gif)


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

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

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-02-16 12:33:30 +00:00
Rishabh Poddar
d2c7930992
chore(examples): updates supertokens dependencies (#45985)
Co-authored-by: NkxxkN <kevin@supertokens.io>
Co-authored-by: NkxxkN <kevin.antoine@protonmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Rishabh <rishabh@supertokens.io>
Co-authored-by: Bhumil Sarvaiya <sarvaiyabhumil@gmail.com>
Co-authored-by: jscyo <joelsteve97@hotmail.com>
Co-authored-by: Mihaly Lengyel <mihaly.lengyel@tresorit.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Mihaly Lengyel <mihaly@lengyel.tech>
Co-authored-by: Alisher <alisher@supertokens.com>
2023-02-16 13:21:31 +01:00
Kiichi Tachibana
65390b5c17
Update Material UI examples (#45974)
The links to the material-ui examples were broken and have been corrected.

## Documentation / Examples

- [ ] ~Make sure the linting passes by running `pnpm build && pnpm lint`~
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-16 03:14:16 +00:00
Matt Cote
08aafe4b2e
Fix syntax error in supabase auth example (#45926) 2023-02-14 19:46:08 -08:00
Michael Oliver
8af2881a29
Add MDXComponents type to useMDXComponents (#45737)
MDX publishes types which includes a proper `MDXComponents` type,
provides nicer autocomplete for users and also includes the `wrapper`
option:


![image](https://user-images.githubusercontent.com/55017335/217798272-2fc5e574-5a0b-49e5-92d8-62b56ad4d043.png)



<!--
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:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-14 16:41:49 -08:00
Tom Ballinger
d83a3c8e24
Update Convex demo to 0.9.1 (#45866)
Update Convex to 0.9.1

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-13 19:41:44 +00:00
Duc Tran
a8b3e7809a
chores(examples): Define base image for multi-stage build (#45862)
Just define base docker image for multi-stage build

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-13 18:14:26 +00:00
jomeswang
31cd027d3d
Fix 404 link in example with-turbopack (#45843)
Change 404 project codebase link in example with-turbopack to the
correct one

<!--
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:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-13 14:47:05 +00:00
Jonas A Walden
81164fb912
Update README for cms-kontent-ai (#45796) 2023-02-10 14:35:35 -08:00
Balázs Orbán
25466918e9
fix(next-mdx): mark mdx-js/* as optional (#45440)
Realized when I was checking out
https://github.com/vercel/next.js/issues/45431 that the package manager
will complain about missing peer deps, even though they are not required
with the `experimental.mdxRs` option.

Fixing a small visual issue too:
<details>
<summary>Before:</summary>
<img
src="https://user-images.githubusercontent.com/18369201/215777932-caf133c0-1459-4c25-a438-11020e41f879.png"/>
</details>
<details>
<summary>After:</summary>
<img
src="https://user-images.githubusercontent.com/18369201/215777802-d3f245ae-af56-46e9-8ccd-3bac241bdcfa.png"/>
</details>


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-07 15:59:22 -08:00
Mike Plummer
2246db680e
Add Cypress component testing to docs & example (#44869)
[Cypress](https://www.cypress.io/) recently went GA with a Component Testing offering which supports Next.js. This PR adds a brief section on what and how to use Cypress for component-level testing and updates the example project with a component test.

Any feedback on content or the example is welcome, thanks for considering!

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-07 23:42:35 +00:00
Bennett Dams
7fde79a9e8
Define base image for multi-stage build (#45090)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-07 15:21:20 -08:00
José Fernando Höwer Barbosa
268dd6e80b
Simplify with-google-analytics example (#43894)
<!--
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 that you're making:
-->
## Documentation / Examples

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

First of all thanks for this amazing project and all the help you
provide with these examples.

It seems there is code duplication in this example. After some tests
locally seem to _document.js is not necessary for `gtag` to work
properly.


9d97a1e34a/examples/with-google-analytics/pages/_app.js (L30-L34)


9d97a1e34a/examples/with-google-analytics/pages/_document.js (L13-L17)

I am aware of https://github.com/vercel/next.js/pull/40645 and I would
like to ask @dave-hay, @SukkaW and @ijjk to consider this is still
necessary. If so why then not move all content of the scripts from _app
to _document?

In any case, I am open to adding here some comments explaining what is
the reason for this code duplication if necessary.

<hr/>

Changes that come from  https://github.com/vercel/next.js/pull/43897

1. The `event` hashChangeComplete should be removed since `/home` and
`/home/#section` is not new pageview, but just reference to the same
page.

If we go from /home to /home/#section (with a button click or a link for
example) this shouldn't trigger a new page visit on `gtag`.

For this reason, I think we should revert the changes from
https://github.com/vercel/next.js/pull/36079. If there is a better
argument of why this should stay I am also open to creating comments to
clarify this on the example since I don't think should be the default
behavior and not useful in most cases.

2. The `id="gtag-init"` was added with no context to the example from
https://github.com/vercel/next.js/pull/29530

If there is a reason for this id in the script to existing I am open to
adding a comment that clarifies this since in my experience is not
necessary at all.


Edit: Batching with https://github.com/vercel/next.js/pull/43897 as
recommended by
https://github.com/vercel/next.js/pull/43897#issuecomment-1344635000

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-07 14:58:52 -08:00
Jan Kaifer
fc9b7d7791
Fix ts config in reproduction-template-app-dir (#45653)
Commited tsconfig generated by running `next build`.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-07 12:18:05 +00:00
Luke Schlangen
836ac9cc7f
bump node alpine to version 18 (LTS) (#45643)
Updating node version to LTS https://nodejs.org/
I tested locally and deploying to Google Cloud Run and build and deploy steps were successful in both cases.

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-07 02:31:38 +00:00
Ivan Kiráľ
7c15278cc2
Upgrade librabries and rebranding kontent.ai (#45260)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-06 13:21:52 -08:00