Commit graph

2742 commits

Author SHA1 Message Date
Jesse Jafa
c0986eed06
[examples] add @types/testing-library__jest-dom package (#44533)
## 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)

The https://www.npmjs.com/package/@testing-library/jest-dom is included
in the `with-jest` and `with-jest-babel` examples, but that package has
DT types which are not included and may cause TS errors. This PR adds
them
2023-01-03 15:55:40 -08:00
Arda TANRIKULU
00d7a35ed7
Use the stable GraphQL Yoga v3 in the GraphQL example (#44488)
Use the stable GraphQL Yoga v3 in the GraphQL example, and also disable body parser for fully functionality as in GraphQL Yoga's recipe for Next.js;
https://the-guild.dev/graphql/yoga-server/docs/integrations/integration-with-nextjs#example


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-01-03 00:53:12 +00:00
김형록
3dfb85d082
Update .gitignore in pwa example (#44391)
The files created when running the app using next-pwa should not be added to git, so I added them to `.gitignore`.

Updated by referring to https://github.com/shadowwalker/next-pwa/blob/master/.gitignore.
2023-01-03 00:39:44 +00:00
Bradley Dirheimer
f7b654e875
Update get-api-cookie.ts (#44466)
Added the types for req and res.



## 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`
- [x] The "examples guidelines" are followed from [our contributing doc]

Here is the documentation followed [Nextjs Link](https://nextjs.org/docs/basic-features/typescript)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-01-01 00:58:38 +00:00
Dmitry
87a419f821
fix link to index page in Image Component Example (#44388)
## Documentation / Examples
On [Image Component Example README](https://github.com/vercel/next.js/tree/canary/examples/image-component) was a old link to index.js file, instead of index.tsx, changed old link to a new, now page exist, insteadof 404.

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc]
2022-12-28 15:35:23 +00:00
Steven Eubank
d3c292dd4a
Update with-sentry README.md Next.js version (#44374)
Clarify requirement and move down, since Next.js versions <10 are already quite dated
2022-12-27 14:40:43 +00:00
Shu Uesugi
f0aa10b216
Remove experimental for modularizeImports from docs and example (#44311)
When `modularizeImports` was moved out of experiimental [on this PR](https://github.com/vercel/next.js/pull/44240), `docs` and `examples` were not updated.

- Update `modularize-imports` example by removing `experimental` from `next.config.js`, as it's currently failing when deployed
- For docs: https://nextjs.org/docs/advanced-features/compiler#modularize-imports
  - Move `Modularize Imports` section outside of `Experimental Features` section 
  - Remove `experimental` from code snippets
  - Added to version history, just like when SWC Minifier became stable.

## 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)
2022-12-23 20:46:18 +00:00
Hassan El Mghari
8a9133ddb3
Updated dependencies for with-tailwindcss example (#44289)
Updated dependencies for tailwindcss and typescript.
2022-12-23 02:08:26 +00:00
Tobias Koppers
3020c44df1
update with-turbopack example for postcss/tailwind support (#44261) 2022-12-22 13:20:15 +01:00
Jiachi Liu
ea7d85687b
Fix styled-components setup in turbo example (#44165)
Closes: #44164

Sync to the latest setup doc on https://beta.nextjs.org/docs/styling/css-in-js#styled-components

## 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)
2022-12-19 20:59:16 +00:00
Rishabh Poddar
064bd14371
Updates with-supertokens example (#44042)
Updated dependency of supertokens-auth-react
2022-12-15 22:59:37 -08:00
Damien Simonin Feugas
35f1a3501a
feat: enables 'edge' as a possible runtime for API routes (#44045) 2022-12-15 10:08:03 +01:00
Aaron Adler
ee266b9d9b
Move Google Analytics script to the <Head/> (#43838)
Fixes #[37957](https://github.com/vercel/next.js/issues/37957)

Google cannot read the Google Analytics script if it is placed at the bottom of the `<body />`.

It can only be read when it's placed here in the `<Head />`

This has been documented by other NextJS users online, and by Google themselves, which directs users to place the script in the head.

Hope this helps NextJS users!



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

- [ ] 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)
2022-12-13 02:53:42 +00:00
Balázs Orbán
5e3bb45f55
chore: add repro links in "verify canary" comment (#43979)
[Slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1669918824743499)

## 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)
2022-12-12 14:26:40 -08:00
labyrinthitis
af0ac941de
corrected /examples/github-pages readme (#43766)
`branch` is the correct subheading direction; the `source` subheading represents `deploying from a branch` or from a `github action`



## 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)
2022-12-12 02:33:38 +00:00
Max Proske
bfd96ac012
Fix with-webassembly example and convert to Typescript (#43677)
- Fixes `with-webassembly` example unable to build with the current
`next.config.js`.
https://github.com/vercel/next.js/issues/29362#issuecomment-932767530
- Converted example to TypeScript

```js
// Before
config.output.webassemblyModuleFilename = 'static/wasm/[modulehash].wasm'

// After
config.output.webassemblyModuleFilename =
  isServer && !dev
    ? '../static/wasm/[modulehash].wasm'
    : 'static/wasm/[modulehash].wasm'
```

```
> Build error occurred
Error: Export encountered errors on following paths:
        /
    at /Users/max/dev/next.js/examples/with-webassembly/node_modules/next/dist/export/index.js:408:19
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Span.traceAsyncFn (/Users/max/dev/next.js/examples/with-webassembly/node_modules/next/dist/trace/trace.js:79:20)
    at async /Users/max/dev/next.js/examples/with-webassembly/node_modules/next/dist/build/index.js:1342:21
    at async Span.traceAsyncFn (/Users/max/dev/next.js/examples/with-webassembly/node_modules/next/dist/trace/trace.js:79:20)
    at async /Users/max/dev/next.js/examples/with-webassembly/node_modules/next/dist/build/index.js:1202:17
    at async Span.traceAsyncFn (/Users/max/dev/next.js/examples/with-webassembly/node_modules/next/dist/trace/trace.js:79:20)
    at async Object.build [as default] (/Users/max/dev/next.js/examples/with-webassembly/node_modules/next/dist/build/index.js:65:29)
 ELIFECYCLE  Command failed with exit code 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)
2022-12-11 20:10:14 -06:00
Max Proske
ce0bcd38f2
Convert with-gsap, with-mqtt-js, with-mux-video examples to Typescript (#43874)
Converted three more examples to TypeScript.

Changes to individual examples pushed as separate commits.

## 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)
2022-12-12 01:53:08 +00:00
Thomas Ballinger
aa4b4bf8ae
Update dependencies for Convex demo (#43855)
Resolves the issue described in
https://github.com/microsoft/TypeScript/issues/51567 in the Convex demo
by updating type definitions.

## 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)**
- actually updated dependencies this time
2022-12-08 12:43:56 -08:00
Thomas Ballinger
dbc833440c
chore(examples): Update convex example (#43741) 2022-12-07 14:12:36 +01:00
Anuj Singh
8006dbc741
chore(examples): Remove deprecated function from chakra (#43784)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-07 14:10:32 +01:00
Max Proske
f56e5c942d
Convert with-why-did-you-render example to TypeScript (#43736) 2022-12-07 14:10:04 +01:00
Hassan El Mghari
c6ec490eb1
Fixed broken Cloudinary example (#43646)
Adding TypeScript as a dependency to fix the Cloudinary example
2022-12-02 17:12:54 +00:00
7yue
5fb243d2ad
examples(with-turbopack): Fix styling page default active stylingNav (#42739)
<!--
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:
-->

Closes: https://github.com/vercel/next.js/pull/42768

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `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`
- [ ] Integration 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`

## 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>
2022-12-01 20:18:14 -08:00
Hassan El Mghari
57dc7207e6
Add with-cloudinary example (#43250)
Added an image gallery example using Next.js and Cloudinary.

Edit: This is now ready to ship!

Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-12-02 04:05:34 +00:00
Alexis Rico
a45bf8c93b
Fix deploy button in with-xata example (#43608)
The deploy button of the `with-xata` example is not working properly
because we were lacking the integration to configure the env variables.

[![Deploy with
Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/SferaDev/nextjs-demo/tree/fix-with-xata-deploy/examples/with-xata&project-name=with-xata&repository-name=with-xata&integration-ids=oac_IDpMECDuYqBvAtu3wXXMQe0J)

Taking advantage of the PR, some other changes:

- Adding `alt` to `next/image` to fix build with latest version
- Update readme to add more information in the Xata CLI section
- Use a new command to initialize the database schema on first
deployment
- Remove hardcoded URL in `xata.codegen.ts`
- Remove deprecated `formatVersion` in `schema.template.json`
- Update dependencies

Note: The integration is still work in progress, it works for the
`Deploy to Vercel` button but we want to improve the UI/UX before
submitting it to the Marketplace, keeping it unlisted for a while.
2022-12-01 11:34:23 -08:00
Josh Slate
b2df2cff26
chore(examples): Update active-class-name example (#43581)
I updated the `active-class-name` example to stop using the legacy behavior.

## 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)
2022-12-01 12:21:57 +00:00
Aaron Yarborough
55e35c5144
chore(examples): reference main prop in README.md in Firebase example (#43434)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-11-30 12:47:39 +01:00
Max Proske
faaba0f8ec
Simplify and convert with-vercel-fetch example to TypeScript (#43403)
Simplified the example to just the specific feature, and converted to TypeScript.

- `node-fetch@2` is either polyfilled by Next.js or a peerDep of `@vercel/fetch`, I can't quite tell, but either way it can be removed from the dependencies.

## 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)
2022-11-30 11:41:14 +00:00
Max
f15b5d0af7
chore(examples): fix CLI commands for MobX examples (#43534)
Fixes https://github.com/vercel/next.js/issues/43512
2022-11-29 18:10:33 +01:00
Max Proske
d5c922b3ec
Fix with-docker-compose example (#43419)
1. Fixes example unable to build with the latest version of Next.
- Next.js 13 bumped the minimum React version to [18.2.0](https://nextjs.org/docs/upgrading), but this example seems to have gotten missed.

2. Fixes example unable to run by default on Linux. 
- Reverts #39372 
- Fixes @balazsorban44 comment https://github.com/vercel/next.js/pull/39372#issuecomment-1208012860
- Added a comment to the README to prevent this issue from being re-introduced. 

3. Build and start Next.js based on the preferred package manager.

4. Allow dependencies to install without lockfile present. 
- Outputs a warning instead of exiting.  
- Keeps the example faithful to the README "Develop locally without Node.js or TypeScript installed".

5. Added `next.config.js` types that got missed.

6. Updated README links now that output standalone is stable.

## 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)
2022-11-28 00:13:22 +00:00
Rishabh Poddar
08e6ceb594
updates with-supertokens example (#43379)
Prevents infinite redirect loop if someone is logged in and visits a
route like `/auth/random`
2022-11-27 16:04:43 -08:00
Jan Kaifer
1dd34620fd
Add example commands for creating reproductions (#43375)
To reduce friction when creating reproductions. It allso allows me to link to this file when I'm asking people to create reproductions



## 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`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-25 12:01:39 +00:00
Shu Uesugi
a746597430
chore(examples): Deprecate cms-strapi (#43325)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-11-24 12:01:10 +01:00
Max Proske
093354c6d3
Convert with-videojs, with-yoga, with-zones examples to TypeScript (#43280) 2022-11-23 13:46:54 +01:00
Max Proske
8eb82b3891
Convert more jsx/styled-components examples to TypeScript (#43117)
Converted 3 more examples to TypeScript. Individual contributions pushed as separate commits.

## 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)
2022-11-23 05:45:26 +00:00
Artur Bień
ef7a6e1210
docs: add missing AppProps import (#43136) 2022-11-22 14:33:29 +01:00
Rishabh Poddar
08ee7b22ec
Updates supertokens example app SSR behaviour (#43218)
Co-authored-by: Rishabh <rishabh@supertokens.io>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-11-22 14:32:49 +01:00
FomichRoman
807c59a215
chore(examples): update Next.js in with-redux-reducer (#43237)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-11-22 14:28:07 +01:00
Mateus Etto
3a2af8fb0b
Fix With Passport example (#43232) 2022-11-22 13:45:19 +01:00
Andy Kenward
f400adf5e9
chore(examples): with-msw update msw (#43224)
CLOSES https://github.com/vercel/next.js/issues/43221
2022-11-22 11:33:44 +01:00
Bennett Dams
37d5abaa94
fix: Wrong link to source in "responsive" image example (#43081) 2022-11-18 18:16:37 +01:00
Chuns Chen
e701c715f9
examples(with-ant-design): bump antd v5.0.0 (#43062) 2022-11-18 13:48:47 +01:00
Adil Ansari
b94b5beb70
chore: Updating Tigris example to use stable release (#43058) 2022-11-18 13:48:20 +01:00
Jamie Barton
0440404893
feat(examples): use experimental edge runtime with grafbase (#42992)
This PR adds the experimental runtime as shown in a guide that links to
this example.

##  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)
2022-11-17 14:02:55 -08:00
Max Proske
07d3da102d
Convert with-cssed, with-csx, with-styled-jsx examples to TypeScript (#43018)
Updated 3 more examples to TypeScript. Changes to individual examples
pushed as separate commits.

- Swapped `cxs/lite` for `cxs`, as it's the only mode supported by
`@types/cxs`.

## 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)
2022-11-17 10:28:57 -08:00
Max Proske
809303be59
Remove swcMinify option from example configs (#43012)
SWC minification is now [enabled by
default](https://nextjs.org/docs/advanced-features/compiler) in the
Next.js compiler.

## 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)
2022-11-16 13:39:26 -08:00
Max Proske
3fe9b4c867
Remove with-cerebral example (#42980) 2022-11-16 09:32:54 +01:00
Max Proske
365b164b48
Remove with-carbon-components example (#42976) 2022-11-16 09:18:00 +01:00
Max Proske
a916553420
Remove with-atlaskit example (#42973) 2022-11-16 09:17:56 +01:00
Silvio Clécio
10b635ea60
docs(examples): add postgres.js example (#42962) 2022-11-16 09:17:43 +01:00