Commit graph

3099 commits

Author SHA1 Message Date
Lee Robinson
41d890aaec
examples: Remove outdated example (#58568)
Closes https://github.com/vercel/next.js/issues/54309.
2023-11-16 22:08:23 -06:00
Lee Robinson
d115ccad14
examples: fix import statement for lru-cache (#58567) 2023-11-16 21:55:24 -06:00
Milan K
0e55bb1a4a
examples: with-zustand update to App Router (#58042)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-11-16 21:52:34 -06:00
Sam Ennis
e224c2251a
examples: update lru-cache version (#58060) 2023-11-16 21:45:45 -06:00
Arseny
10c794a371
examples: Update cache-handler-redis (#58562) 2023-11-16 21:36:55 -06:00
Tom Ballinger
2b0288912b
examples: Upgrade Convex example to convex@1.2.1 (#54910)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-11-15 23:14:32 -06:00
rodrigo
6d9ce62f13
examples: update styled-components (#56457)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-11-15 23:14:00 -06:00
Joshua Santos
f163dd097f
examples: fix unhandled runtime error for forms (#56600)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-11-15 23:13:23 -06:00
ihommani
70389d0cfd
examples: update Dockerfile comment (#56646)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-11-15 23:11:21 -06:00
Heloi Neto
c6d30da394
examples: fix typo for component (#58330) 2023-11-15 23:00:27 -06:00
Prince Agrawal
6d29fc1bfd
examples: Fix hydration error in headers example (#58383) 2023-11-15 22:59:07 -06:00
Sean Gray
f5f0767ee5
examples: update Geist font path (#58349) 2023-11-15 22:58:44 -06:00
Karl Horky
ff257800fc
Remove copying of request headers to response (#58304)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

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

### Fixing a bug

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

### Adding a feature

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


## For Maintainers

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

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

Avoid copying request headers to response

### Why?

Copying request headers to response allows for reflection attacks
https://github.com/vercel/next.js/issues/57410

### How?

Remove the `headers:` property assignment

cc @leerob 

Followup to https://github.com/vercel/next.js/pull/58300

Fixes #57410
2023-11-10 16:14:54 +01:00
Lee Robinson
e50782829b
examples: Update Middleware for CSP (#58300) 2023-11-10 13:55:16 +00:00
Arseny
e2f3059b48
Add a self-hosted shared cache example (#58000)
### What?

This pull request integrates the exemplary setup for a self-hosted Next.js application utilizing Redis as a shared cache storage. The solution supports caching at both the App and Pages routers in default and standalone modes, as well as partial pre-rendering, facilitated by the [`@neshca/cache-handler`](https://github.com/caching-tools/next-shared-cache/tree/canary/packages/cache-handler) package. The package enables customizing cache handlers and replacing the default cache provided by Next.js seamlessly.

### Why?

The motivation behind this pull request is to provide an example demonstrating how Redis can be used as a shared cache in a self-hosted environment, thereby improving the scalability of hosting multiple instances of a Next.js application.
2023-11-09 14:29:11 +00:00
Lee Robinson
d3756fac5d
chore: cleanup more old examples. (#58066) 2023-11-07 13:53:53 -06:00
Jon Meyers
c3bf735263
Chore: refactor to use server actions in with-supabase example (#57858)
### What?
[1] Use Server Actions for auth
[2] Use Geist font
[3] Address warning about `metadataBase` in console

### Why?
[1] The co-location of Login page and authentication logic is simpler for beginners
[2] Looks nice
[3] Avoid confusing people with the starter template printing warnings

### How?
[1] Refactor Route Handlers to Server Actions
[2] Install font and set to `html`
[3] Explicitly declare the default value for `metadataBaseUrl`
2023-11-01 14:58:33 +00:00
Lee Robinson
ac54377e67
examples: cleanup (#57845)
Remove examples that were linking to just READMEs, or outdated / discontinued ones.
2023-11-01 00:08:55 +00:00
Jon Meyers
75958bbc46
Chore: simplify with-supabase example (#57562)
### What?

[1] Simplify example
[2] Refactor `delete` method to use `cookies.set`

### Why?

[1] Make it easier to follow
[2] Fix build errors

### How?

[1] Adding comments and abstracting code into helper functions
[2] Setting cookie to empty value when removed

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2023-10-31 18:33:55 -05:00
vinay
2f5dbd94c8
Update Explore the Next.js 13 playground. to Explore starter templates for Next.js (#57799)
Update `Explore the Next.js 13 playground.` --> `Explore starter templates for Next.js`
2023-10-31 20:17:51 +00:00
vinay
240730f3ed
Remove `experimental: { serverActions: true } from examples as it is stable in next 14. (#57598)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-10-31 13:01:26 +01:00
Joel Hooks
13d61529dc
examples: fix inngest example for 3.x sdk (#57712)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-29 11:38:21 -05:00
Joel Hooks
6a8010dbb6
examples: Add inngest next.js example (#56049)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-28 11:57:27 -05:00
xixinRunBoy
058f6f1cb0
active-class-name example style js has not taken effect (#56136)
example/active-class-name: the Nav.tsx's style has not taken effect
change <style jsx> to <style jsx global>

Co-authored-by: chenxixin <chenxixin>
2023-10-26 20:19:14 -05:00
vinay
5998e6a884
examples: Update example with-Clerk (#57050)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-26 20:14:37 -05:00
Kunall Banerjee
c380d91562
docs: fix broken link to demo (#57229)
<!-- 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 #

-->

Nothing too crazy, just pointing the demo to the right URL. The previous
URL is dead/unreachable.

💖
2023-10-26 20:14:08 -05:00
ChanHui
8d45aa9bfb
update @types/react version in examples (#57259)
### What?
When I ran `npx create-next-app --example with-turbopack` and installed
dependencies using `yarn`, I found an typescript error(`'SomeComponent'
cannot be used as a JSX component.`).

<img
src="https://github.com/vercel/next.js/assets/51700274/f6c7e478-c0b1-4ea2-996f-4c0c78e3bb4b"
width=400 />

and I realized that the bug is due to the version of
@types/react(18.0.x).
you can check this issue on
[here](https://github.com/vercel/next.js/issues/42292#issuecomment-1594351684)
too.

### Why?
It seems that there is an error occurring in the @types/react version
18.0.x.

### How?
It would be good to change the @types/react version to 18.2.8 in the
next.js examples.

I think this change will resolve [this
issue](https://github.com/vercel/next.js/issues/55080#issue-1884846177)
[NestJS
documentation](https://nextjs.org/docs/app/building-your-application/configuring/typescript#async-server-component-typescript-error)
also states to upgrade the version.

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-26 19:52:08 -05:00
Houssein Djirdeh
307bdcd04c
(Examples) Add with-google-maps-embed example (#57365)
Adds `with-google-maps-embed` example in `examples/` directory to show
how to use the `<GoogleMapsEmbed />` component from
_@next/third-parties_.

<!-- 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-10-26 19:13:12 -05:00
Houssein Djirdeh
aaf668a535
(Examples) Add with-youtube-embed example (#57367)
Adds `with-youtube-embed` example in `examples/` directory to show how
to use the `<YouTubeEmbed />` component from _@next/third-parties_.

<!-- 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-10-26 19:12:23 -05:00
Jon Meyers
b9dd6c4ff6
Fix: Call cookies function from route to flag as dynamic (#57494)
### What?

Move calling the `cookies` function up to the route

### Why?

This flags the route as `dynamic`, meaning we don't need to explicitly declare `export const dynamic = 'force-dynamic'`

### How?

Passing the returned `cookieStore` into Supabase helper functions, rather than the `cookies` function itself
2023-10-26 16:18:17 +00:00
Houssein Djirdeh
7bee486f7c
Docs: Add documentation for next/third-parties (#57345)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-10-25 23:07:18 -07:00
Jon Meyers
4bc549bf95
Fix: catch expected error in with-supabase example (#57378)
### What?

[1] Use camelCase for SVG properties
[2] Catch expected error in cookie functions

### Why?

[1] Prints error to the console
[2] If the cookies `set` or `delete` methods are called in a Server Component, an error is thrown

### How?

[1] Change property names from kebab-case to camelCase
[2] Catch error
2023-10-26 04:37:32 +00:00
Jon Meyers
d0e92b19af
chore: Refactor with-supabase example to use ssr package (#57100)
### What?

[1] Refactors `with-supabase` example to use new `@supabase/ssr` package
[2] Makes landing page dynamic steps to connect Next.js to Supabase
[3] Fixes a range of small bugs

### Why?

[1] Simplifies creating a Supabase client
[2] People were not understanding how to connect this template to Supabase
[3] People don't like bugs

### How?

[1] Declares a separate `createClient` function for client and server. Client version is used in Client Components, server version is used every where else - Server Components, Route Handlers, Server Actions, Middleware
[2] Makes landing page a dynamic list of next steps to guide the user to success
[3] Writing code to squash the bugs!
2023-10-23 23:34:10 +00:00
Steven
a3aa6590ff
chore(next/image)!: mark domains as deprecated in favor remotePatterns (#57062)
We already had `domains` as "not recommended" but this PR marks it as "deprecated" and prints a warning if its detected.

I also updated all examples to switch from `domains` to `remotePatterns`.
2023-10-19 20:24:48 +00:00
leung018
66597be8a7
Add .yarn/install-state.gz to .gitignore (#56637)
### Reason for making this change
https://yarnpkg.com/getting-started/qa#:~:text=yarn%2Finstall%2Dstate.,your%20workspaces%20all%20over%20again.
In the official documentation of `yarn`, it is stated that `.yarn/install-state.gz` is an optimization file that developer shouldn't ever have to commit. However, currently, when running `create-next-app`, `.yarn/install-state.gz` is being commited.

### Remaining work
I apologize for only modifying one template initially to initiate the discussion first.

If this change is agreed upon,  it should be synchronized with other `.gitignore` templates. Would it be possible to follow a similar approach as in https://github.com/vercel/next.js/pull/47241? I would appreciate any assistance in syncing this change.
2023-10-18 16:34:48 +00:00
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