Commit Graph
3397 Commits
Author SHA1 Message Date
Hendrik LiebauandGitHub d7fa64ea3b Update eslint and restore .eslintrc.cli.json being used for CLI/CI-based linting (#81553)
This will allow us (again) to selectively use type-checked rules
internally, as stipulated in #67689. In a follow-up, we'll likely add
https://typescript-eslint.io/rules/switch-exhaustiveness-check/ as a
first type-checked rule.
2025-07-11 21:17:40 +02:00
Nhan DoanandGitHub 33720a3be2 Add Biome example (#81334)
Add a Next.js example configured with Biome toolchain.
2025-07-07 17:33:19 -07:00
Dominik FerberandGitHub 301e79db45 remove with-fauna example (#80440) 2025-06-12 11:03:15 +02:00
Roman AandGitHub 2ecfdb8bf3 Fix a couple typos (#80080) 2025-06-11 14:43:59 +02:00
Benjamin WoodruffandGitHub 8fa42deefd refactor(napi): Implement napi traits for RcStr (#79806)
This lets us use `RcStr` directly in function arguments and as part of `#[napi(object)]`s.

*You can just `RcStr` things!*

Here's an example of rspack doing something similar for a custom napi type: https://github.com/web-infra-dev/rspack/blob/35f1126963d5ba6860e9eba939fd5d62f9aa217f/crates/rspack_regex/src/napi.rs
2025-05-28 17:09:45 -07:00
2b7a259169 chore: Update the with-supabase example to use the Supabase Auth block (#78913)
This PR updates the `with-supabase` template to better auth pages,
Tailwind v4 and newest `components.json` for full compatibility with
shadcn/ui.

The `(auth-pages)` folder has been removed. For auth, the template is
now using the [password based auth
block](https://supabase.com/ui/docs/nextjs/password-based-auth) from the
Supabase UI Library which makes it easier to update it and keep it
up-to-date.

---------

Co-authored-by: Lee Robinson <[email protected]>
2025-05-28 12:19:55 -05:00
Lee RobinsonandGitHub 4a97643664 examples: fix readmes (#78483) 2025-04-23 20:48:58 -05:00
fd438787f3 misc: use correct capitals for React terms (#78445)
- `Client/Server Component`
- `React Hooks`

---------

Co-authored-by: Sebastian "Sebbie" Silbermann <[email protected]>
2025-04-23 21:50:55 +09:00
3675453eac chore(examples): replace uuid dependency with crypto.randomUUID (#77901)
Starting from Node.js v14.17.0 and v15.6.0, we can use Node.js's
`randomUUID` function in the crypto module to generate version 4 UUID.

Since Next.js requires Node 18 or newer, we can replace `uuid`
dependency with `crypto.randomUUID`.

Reference:
https://nodejs.org/docs/latest-v18.x/api/crypto.html#cryptorandomuuidoptions

Signed-off-by: Eng Zer Jun <[email protected]>
Co-authored-by: Jiwon Choi <[email protected]>
2025-04-22 07:24:06 +00:00
Sebastian "Sebbie" SilbermannandGitHub 1ee500b01e [test] Use React 19.1 everywhere (#77895) 2025-04-10 14:39:55 +02:00
Will Binns-SmithandGitHub 4f5531b140 Turbopack: support config.turbopack and deprecate config.experimental.turbopack. (#77850)
Closes PACK-4263

This:
- Adds support for using `config.turbopack` for Turbopack. The accepted value for this option is identical to the previous experimental one without the deprecated field `loaders`.
- Deprecates `config.experimental.turbo`. Warns on its use, but will continue to accept it, merging it with `config.turbopack` while preferring fields on `config.turbopack`.
- also see https://github.com/vercel/next.js/pull/77850#pullrequestreview-2749738760

Test Plan:
- [x] Convert use of `config.experimental.turbo` in tests to `config.turbopack`
- [x] Automated test for accepting the experimental option for compatibility, as well as the config merging
2025-04-09 03:42:38 -07:00
Niklas MischkulnigandGitHub 2383b58ae8 Fix Wasm example (#77924)
<!-- 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 #

-->
2025-04-08 14:02:02 +02:00
Will Binns-SmithandGitHub 0f0ba8fca8 Rename alternate bundler package name (#77793)
Test Plan: CI. Tested locally with
`test/development/app-dir/basic/basic.test.ts`. Will test with a
create-next-app once published.
2025-04-03 14:42:52 -07:00
Will Binns-SmithandGitHub c41991b9a2 Alternate bundler example: use canary version (#77754)
The `latest` version is old and we now canary-gate Rspack support. Some folks are referencing this example now, so make it work using canary.

This can be set back to `latest` once 15.3.0 is published.
2025-04-02 15:36:47 -07:00
Sam KoandGitHub 49ba0acc18 chore(examples): remove examples that can be v0'd (#77349)
## Why?

Taking small steps towards reducing the large burden we are taking on with [examples](https://github.com/vercel/next.js/tree/canary/examples).
2025-04-02 14:27:08 -07:00
6d221f8672 Add example for alternate bundler (#77057)
This adds an example for rspack using the rspack plugin.

---------

Co-authored-by: JJ Kasper <[email protected]>
2025-03-17 14:24:42 -07:00
Will Binns-SmithandGitHub 8e2f470e0b with-polyfills example: only link to specific browsers (#77211)
Previously, this example named specific browsers, including IE 11 which
is no longer supported by default. This now links to the corresponding
docs page that lists what’s currently supported.

I couldn’t find any other examples of this in the codebase.
2025-03-17 14:02:07 -07:00
8c33e482de chore(cna): update tailwind styles to be closer to non-tw cna (#76647)
## Why?

Updating Tailwind templates to closer match the non-Tailwind template.

(before, `localhost:3000` is current Tailwind template)


https://github.com/user-attachments/assets/b5bef4c7-0c22-43e2-87f1-2dbd4903ea0f

(after)


https://github.com/user-attachments/assets/5b1d087c-60e6-45fc-b749-f3894834e339

- Minor fix to `a.secondary` style's `min-width` to be the same width as
`a.primary`
-

---------

Co-authored-by: Lee Robinson <[email protected]>
2025-03-04 09:34:33 -06:00
Lee RobinsonandGitHub 9eb47f11c0 docs: fix reading params code blocks (#76705)
These function the same, but the updated version looks cleaner.
2025-03-01 12:38:08 -06:00
Terry SuttonandGitHub c919f09a1c examples: fix supabase example for v15 (#76567) 2025-02-26 15:50:00 -06:00
aaebca93a0 Updated remove-console example to utilize the app router. (#76543)
This PR updates the remove-console example for using the App Router.
Here are the changes that have been made:

- I renamed the pages folder and moved it to the app folder.
- Added the layout.tsx file as part of the App Router.
- Updated the package.json file.

CC: @samcx

---------

Co-authored-by: MayuriPapat25 <[email protected]>
Co-authored-by: samcx <[email protected]>
2025-02-26 12:39:50 -08:00
00f56aa275 Update with urql example (#76485)
This PR updates the with-urql example for using the App Router.
Here are the changes that have been made:

- I renamed the pages folder and moved it to the app folder.
- Added the layout.tsx file as part of the App Router.
- Updated the package.json file.

CC: @samcx

---------

Co-authored-by: MayuriPapat25 <[email protected]>
Co-authored-by: samcx <[email protected]>
2025-02-25 21:35:02 +00:00
Lee RobinsonandGitHub 7aa6040a54 examples: Fix prettier issue (#76027)
Follow up from https://github.com/vercel/next.js/pull/75750.
2025-02-14 00:25:40 +01:00
Ícaro GuerraandGitHub 39712ba246 examples: Fix cms-plasmic example (#75750) 2025-02-13 16:50:07 -06:00
Jiwon ChoiandGitHub d9b27c9980 example: add next config to hello-world app (#76022)
### Why?

Since the `hello-world` app is also used for the default debugging app,
I used to add a config when testing a relevant feature and removed it
after. Hence, just added a config.


https://github.com/vercel/next.js/blob/959a31214341d1ea00c0f00bcc8fc6f6a9c7b6fc/.vscode/launch.json#L11
2025-02-14 06:33:32 +09:00
Lee RobinsonandGitHub cf73ab10eb examples: fix search usage (#75972) 2025-02-12 11:41:00 -06:00
106e17ca8f docs: recommend webp over avif (#75966)
Co-authored-by: Steven <[email protected]>
2025-02-12 10:43:41 -06:00
3e7a510fa4 docs: opengraph-image files work with the node.js runtime (#75274)
Co-authored-by: Jiachi Liu <[email protected]>
2025-01-24 15:08:13 +00:00
a2056c7383 Update readme for with-mux-video (#74966)
Co-authored-by: Jiachi Liu <[email protected]>
2025-01-16 18:23:56 +01:00
6616e20305 with-mux-video: updates for next 15 compat (#74881)
Co-authored-by: Jiachi Liu <[email protected]>
2025-01-14 22:48:20 +01:00
Darius CepulisandGitHub 09fe2542df with-mux-video: recommend environment variables instead of secrets (#74879) 2025-01-14 22:41:10 +01:00
Jam BalayaandGitHub 58255f9a64 examples: fix with-zones repository name in the deploy link (#74852)
## Summary

At #73546, I missed the deploy link of [`with-zones` example
README.md](https://github.com/vercel/next.js/blob/canary/examples/with-zones/README.md).
This PR fix it.

CC: @samcx 

### Adding or Updating 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
2025-01-13 21:49:26 -08:00
Jam BalayaandGitHub 6aafef389b examples: improve DX while copying command to create new project (#73463)
## Description

Follow up #38410.
Some examples remain the multiple commands in a single block, and we
couldn't use copy button to select one line.
With this change users would be able to copy the command (using their
choice package manager) with a single click using the github copy
feature.

CC: @samcx 

### Adding or Updating 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
2025-01-14 05:38:46 +00:00
Jam BalayaandGitHub 36dce2fe7e examples: add StackBlitz preview to README.md (#73546)
### Description

Follow up #35349.

1. Update the [example
template](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
with [StackBlitz](https://stackblitz.com/) preview
2. Add `preview live with StackBlitz` to the examples
3. Remove the below old StackBlitz preview section from the examples

```md
## Preview

Preview the example live on [StackBlitz](http://stackblitz.com/):

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/active-class-name)
```

CC: @samcx 

### Improving Documentation

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

### Adding or Updating 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
2025-01-14 05:24:51 +00:00
Jam BalayaandGitHub 78d5128217 examples: update README.md in mdx example (#73454)
## Description

[`mdx`](https://github.com/vercel/next.js/tree/canary/examples/mdx)
example
[README.md](https://github.com/vercel/next.js/blob/canary/examples/app-dir-mdx/README.md)
is inaccurate.
For instance, API routes is described even though it does not exist.

In conclusion, I rewrote the README.md following [example
guidelines](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md).

CC: @samcx 

### Adding or Updating 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
2025-01-13 21:19:27 -08:00
832c77d01f examples: remove app-dir and with prefix in the mdx directory name (#73458)
## What?

1. Rename the following examples.

| Before | After |
|--------|--------|
|
[app-dir-mdx](https://github.com/vercel/next.js/tree/canary/examples/app-dir-mdx)
| mdx |
|
[with-mdx](https://github.com/vercel/next.js/tree/canary/examples/with-mdx)
| mdx-pages |
|
[with-mdx-remote](https://github.com/vercel/next.js/tree/canary/examples/with-mdx-remote)
| mdx-remote |

2. Change the example names at README.md in the repositories.
3. Update the mdx pathname in the test files.

## Why?

### Why remove `app-dir-` in the directory name?

The default has already been App Router anyways and a lot of examples
have migrated over.
x-ref:
https://github.com/vercel/next.js/pull/72642#issuecomment-2474415343

### Why remove `with-` in the directory name?

According to [examples
guidelines](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md),

> Example directories should not be prefixed with `with-`

## How did you verify your code works?

I have tested the new
[with-mdx.test.ts](https://github.com/vercel/next.js/blob/canary/test/e2e/yarn-pnp/test/with-mdx.test.ts)
and
[example.test.ts](https://github.com/vercel/next.js/blob/canary/test/examples/examples.test.ts).

### Adding or Updating 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

CC: @samcx

Co-authored-by: Sam Ko <[email protected]>
2025-01-07 18:53:42 -08:00
6d6925765d chore(examples): updated the example of with-styled-components-rtl to utlize the App router (#74180)
This PR updates the with-styled-components-rtl example to use the App
Router. Here are the changes that have been made:

- Renamed the `pages` folder to the `app` folder.
- Converted the `index.tsx` to `page.tsx` file as part of the App
Router.
- Created `layout.tsx` in app directory, merging functionality from both
` _app.tsx` and `_document.tsx`:
  -  `ThemeProvider` setup from `_app.tsx`
  -   `RTL` and `styled-components` setup from `_document.tsx`
- Created `lib/registry.tsx` for styled-components server-side rendering
and moved styled-components server-side rendering logic from
`_document.tsx`
- Updated the package.json file.

The following actions were performed as part of this PR:

- Ran `pnpm prettier-check` with no issues found.
- Executed the `pnpm check-examples` script.

CC: @samcx

---------

Co-authored-by: samcx <[email protected]>
2025-01-07 20:26:26 +00:00
6a273df2cb chore(examples): updated the example of with-react-jss to utlize the App router (#74440)
This PR updates the with-react-jss example to use the App Router. Here
are the changes that have been made:

- Renamed the `pages` folder to the `app` folder.
- Converted the `index.tsx `to `page.tsx` file as part of the App
Router.
- Created `layout.tsx` in app directory, merging functionality from both
`_app.tsx` and `_document.tsx`:
  - Wraps content with `StyledComponentsRegistry`
- Created `app/registry.tsx` for JSS setup:
    - Moved JSS Provider and SheetsRegistry from _document.tsx
    - Moved style cleanup logic from _app.tsx
    - Handles server-side style generation
- Updated the package.json file.

The following actions were performed as part of this PR:

- Ran `pnpm prettier-check` with no issues found.
- Executed the `pnpm check-examples` script.

CC: @samcx

---------

Co-authored-by: samcx <[email protected]>
2025-01-07 19:08:59 +00:00
Sam KoandGitHub ca9af5bcad chore(examples): update React to stable 19 (#74499)
## Why?

- Update React in reproduction example templates to stable v19
- Switch `.ts` for `next.config`
- Fixes https://github.com/vercel/next.js/issues/74422
2025-01-06 17:32:37 -08:00
JJ KasperandGitHub 2e114e44c5 Fix linting between lint-check and lint-staged (#74503) 2025-01-03 23:17:14 +00:00
ef9890407c fix: update broken links in config-shared.d.ts (#74122)
<!-- 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 #

-->

Links beginning with
`"https://nextjs.org/docs/api-reference/next.config.js"` are broken in
https://github.com/vercel/next.js/blob/canary/packages/next/src/server/config-shared.ts#L616.

And I found other broken links with same problems and fixed those.
[09ff492](https://github.com/vercel/next.js/pull/74122/commits/09ff49228beae98107e2da1e7eb40aa4cfcebde1)

close https://github.com/vercel/next.js/issues/74121

---------

Co-authored-by: JJ Kasper <[email protected]>
2025-01-02 18:54:58 +00:00
a216207891 Removed duplicated cn function declaration from lib dir (#74065)
This pull request removes duplication of a utility function within the
`with-supabase` example as mentioned in the following issue #73942 - I
removed the duplicated code from the `utils` directory as when shadcn
installs a new component, that component will look for the helper
function in `lib/utils.ts` and forcing users to update every component
after installation or modify any config files for shadcn seems like a
worse DX.

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

---------

Co-authored-by: samcx <[email protected]>
2024-12-18 18:40:30 +00:00
9332370418 examples: update with-mdx-remote example to utilize the App Router (#74067)
## Description

This PR updates the
[`with-mdx-remote`](https://github.com/vercel/next.js/tree/canary/examples/with-mdx-remote)
example to use the App Router and TypeScript. Here are the changes that
have been made:

1. Renamed the `pages` folder to the `app` folder.
2. Converted JavaScript to TypeScript files and created `tsconfig.json`.
3. Created a new `global.css` and `layout.tsx` files in the app
directory.
4. Used [CSS module](https://github.com/css-modules/css-modules) instead
of [styled-jsx](https://github.com/vercel/styled-jsx).
5. Removed
[`next-remote-watch`](https://github.com/hashicorp/next-remote-watch)
due to incompatibility and no maintenance.
6. Removed [`gray-matter`](https://github.com/jonschlinkert/gray-matter)
and implement front-matter parser as well.
7. Updated the `.gitignore`, `package.json` and README.md files.

The new app looks and works much the same as the old one.

### Adding or Updating 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: Sam Ko <[email protected]>
2024-12-18 18:15:08 +00:00
1d5338f767 examples: update next-config-js document path (#73774)
## Description

Follow up #72465.
Update [`next-config-js`
document](https://nextjs.org/docs/canary/app/api-reference/config/next-config-js)
URL.

### Before

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

### After

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

### Adding or Updating 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

CC: @samcx

Co-authored-by: Sam Ko <[email protected]>
2024-12-17 21:14:33 +00:00
マルコメandGitHub dc4ed7cf3b examples: update with-orbit-components README (#74011)
## What?

Remove below 2 lines from [`with-orbit-components`
README.md](https://github.com/vercel/next.js/blob/canary/examples/with-orbit-components/README.md).

```md
For this purpose we are extending `<App />` of injected `<ThemeProvider/>`, and also adding `@kiwicom/babel-plugin-orbit-components`.

This fork comes from [styled-components-example](https://github.com/vercel/next.js/tree/canary/examples/with-styled-components).
```

## Why?

At #73266, Both `<ThemeProvider/>` and
`@kiwicom/babel-plugin-orbit-components` were deleted.
In addition, [styled-components](https://styled-components.com/) isn't
used anymore.

### Adding or Updating 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
2024-12-17 02:03:15 +00:00
d0e4aa068a examples: update with-styled-components README (#73729)
## What?

Delete Notes on `next/link` in the
[`with-styled-components`](https://github.com/vercel/next.js/tree/canary/examples/with-styled-components)
example.

## Why?


[`as`](https://github.com/vercel/next.js/blob/v9.5.2/docs/api-reference/next/link.md#dynamic-routes)
prop of `next/link` is no longer required at
[v10.0.0](https://nextjs.org/docs/app/api-reference/components/link#version-history)
Next.js.

Therefore, the
[as](https://styled-components.com/docs/api#as-polymorphic-prop) prop
provided by `styled` doesn't collide with the `next/Link`'s `as` prop.

CC: @samcx 

### Adding or Updating 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: Sam Ko <[email protected]>
2024-12-16 17:44:04 -08:00
d3bb11e265 updated with-orbit-components example to utilize the App Router. (#73266)
This PR updates the with-orbit-components example for using the App
Router.
Here are the changes that have been made:

- I renamed the `pages` folder and moved it to the `app` folder.
- Added the layout.tsx file as part of the App Router.
- Updated the package.json file.

CC: @samcx

---------

Co-authored-by: Sam Ko <[email protected]>
2024-12-16 17:28:54 -08:00
f54d597563 examples: update gitignore files for parity for yarn recommendations (#71956)
## What?
Update examples `.gitignore` files for parity with [Yarn's official
recommendations](https://v3.yarnpkg.com/getting-started/qa#which-files-should-be-gitignored),
accounting for Yarn's modern Plug-n-Play functionality.

## Why?
New projects initialized with `create-next-app` presently add various
extraneous files from the Yarn cache to the initial commit. This is most
notable in the case of the Next SWC binary, which may exceed 100M in
some environments (empirically, 64-bit Darwin and WSL2 Ubuntu, and very
probably other unix/linux environments), and prevent users from pushing
their new projects to free GitHub repositories without rewriting the
commit history to exclude the extraneous files, or unnecessarily setting
up Git LFS to include them.

## How?
I have errored on the side of exclusion to enable users to push their
CNA projects to GitHub as-is and for parity with other package managers,
while still providing the opportunity to opt in to additional
functionality provided by modern Yarn.

These changes follow the recommendations for
**non**-[Zero-Install](https://yarnpkg.com/features/caching#zero-installs)
configurations, as Zero-Install functionality is an extension on top of
the base package manager experience, and may necessitate additional
configuration and present additional complications for unsuspecting
users, so I think it's best left up to the user to opt-in. On account of
the majority of publicly available Next.js-based projects comprising
general consumer-facing websites, it is my belief that the majority of
Next projects would not benefit from Yarn's Zero-Install functionality,
and that explicitly facilitating it by default would break status quo
with all other non-Yarn CNA projects.

Contrary to the example `.gitignore`s provided by Yarn, I've excluded
the `.yarn/sdks` directory as it contains IDE-specific tooling; I feel
it would be presumptuous for an environmentally-agnostic tool to target
and provide package-manager-specific tooling for specific editors. This
too should be left to the user to opt-in to and provide for their
project if they deem necessary.

I have retained the current `.gitignore`'s exclusion of the `/.pnp`
directory for backwards compatibility with older versions of Yarn (the
files therein have since been reallocated to the `.yarn` directory
addressed by these changes, but I am not clear on when that delineation
occurred or the prevalence of Yarn installations which depend on the
former convention). Maintaining the exclusion here, in the worst case,
implies additional downloads (on an order of magnitude merely similar to
using npm from the outset) rather than failure.

CC: @samcx 

### Adding or Updating 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: Sam Ko <[email protected]>
2024-12-17 01:24:53 +00:00
6a609fa101 examples: convert @next/third-parties examples from JS to TS (#73602)
<!-- 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



Closes NEXT-
Fixes #

-->

### What?
- `with-google-maps-embed` example
- `with-google-tag-manager` example
- `with-youtube-embed` example

### Why?
The examples are written in JavaScript.

### How?
Converted JavaScript examples to TypeScript.

---------

Co-authored-by: samcx <[email protected]>
2024-12-16 17:22:16 -08:00
137fb7a954 examples: remove with-tailwindcss example (#73919)
Co-authored-by: Lee Robinson <[email protected]>
2024-12-15 14:38:46 -06:00